diff --git a/service-launcher/src/main/resources/services/org.apache.flink.client.deployment.ClusterClientFactory b/service-launcher/src/main/resources/META-INF/services/org.apache.flink.client.deployment.ClusterClientFactory similarity index 100% rename from service-launcher/src/main/resources/services/org.apache.flink.client.deployment.ClusterClientFactory rename to service-launcher/src/main/resources/META-INF/services/org.apache.flink.client.deployment.ClusterClientFactory diff --git a/service-launcher/src/main/resources/services/org.apache.flink.core.execution.PipelineExecutorFactory b/service-launcher/src/main/resources/META-INF/services/org.apache.flink.core.execution.PipelineExecutorFactory similarity index 100% rename from service-launcher/src/main/resources/services/org.apache.flink.core.execution.PipelineExecutorFactory rename to service-launcher/src/main/resources/META-INF/services/org.apache.flink.core.execution.PipelineExecutorFactory diff --git a/service-launcher/src/main/resources/services/org.apache.flink.metrics.reporter.MetricReporterFactory b/service-launcher/src/main/resources/META-INF/services/org.apache.flink.metrics.reporter.MetricReporterFactory similarity index 100% rename from service-launcher/src/main/resources/services/org.apache.flink.metrics.reporter.MetricReporterFactory rename to service-launcher/src/main/resources/META-INF/services/org.apache.flink.metrics.reporter.MetricReporterFactory diff --git a/service-launcher/src/main/resources/services/org.apache.flink.table.factories.Factory b/service-launcher/src/main/resources/META-INF/services/org.apache.flink.table.factories.Factory similarity index 100% rename from service-launcher/src/main/resources/services/org.apache.flink.table.factories.Factory rename to service-launcher/src/main/resources/META-INF/services/org.apache.flink.table.factories.Factory diff --git a/utils/executor/src/main/java/com/lanyuanxiaoyao/service/executor/metrics/VictoriaMetricsReporter.java b/utils/executor/src/main/java/com/lanyuanxiaoyao/service/executor/metrics/VictoriaMetricsReporter.java index ee9b2a0..09a5163 100644 --- a/utils/executor/src/main/java/com/lanyuanxiaoyao/service/executor/metrics/VictoriaMetricsReporter.java +++ b/utils/executor/src/main/java/com/lanyuanxiaoyao/service/executor/metrics/VictoriaMetricsReporter.java @@ -11,6 +11,7 @@ import java.io.StringWriter; import java.util.Map; import java.util.stream.Collectors; import org.apache.flink.metrics.prometheus.AbstractPrometheusReporter; +import org.apache.flink.metrics.reporter.InstantiateViaFactory; import org.apache.flink.metrics.reporter.Scheduled; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -19,6 +20,7 @@ import org.slf4j.LoggerFactory; * @author ZhangJiacheng * @date 2022-06-22 */ +@InstantiateViaFactory(factoryClassName = "com.lanyuanxiaoyao.service.executor.metrics.VictoriaMetricsReporterFactory") public class VictoriaMetricsReporter extends AbstractPrometheusReporter implements Scheduled { private static final Logger logger = LoggerFactory.getLogger(VictoriaMetricsReporter.class); @@ -58,7 +60,7 @@ public class VictoriaMetricsReporter extends AbstractPrometheusReporter implemen logger.warn("Fail to push metrics: {}, {}, endpoint: {}, tags: {}", response.getStatus(), response.body(), endpoint, tags); } } catch (IOException e) { - logger.error("Fail to write metrics, endpoint: {}, tags: {}, exception: {}", endpoint, tags, e); + logger.error("Fail to write metrics, endpoint: {}, tags: {}", endpoint, tags, e); } } } diff --git a/utils/executor/src/main/java/com/lanyuanxiaoyao/service/executor/metrics/VictoriaMetricsReporterFactory.java b/utils/executor/src/main/java/com/lanyuanxiaoyao/service/executor/metrics/VictoriaMetricsReporterFactory.java index dee70d0..321f269 100644 --- a/utils/executor/src/main/java/com/lanyuanxiaoyao/service/executor/metrics/VictoriaMetricsReporterFactory.java +++ b/utils/executor/src/main/java/com/lanyuanxiaoyao/service/executor/metrics/VictoriaMetricsReporterFactory.java @@ -10,14 +10,18 @@ import org.apache.flink.metrics.reporter.MetricReporterFactory; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import static com.lanyuanxiaoyao.service.executor.metrics.VictoriaMetricsOptions.*; +import static com.lanyuanxiaoyao.service.executor.metrics.VictoriaMetricsOptions.AUTH_PASSWORD; +import static com.lanyuanxiaoyao.service.executor.metrics.VictoriaMetricsOptions.AUTH_USERNAME; +import static com.lanyuanxiaoyao.service.executor.metrics.VictoriaMetricsOptions.ENABLE_AUTH; +import static com.lanyuanxiaoyao.service.executor.metrics.VictoriaMetricsOptions.ENDPOINT; +import static com.lanyuanxiaoyao.service.executor.metrics.VictoriaMetricsOptions.TAGS; +import static com.lanyuanxiaoyao.service.executor.metrics.VictoriaMetricsOptions.TIMEOUT; /** * @author ZhangJiacheng * @date 2022-06-22 */ -@InterceptInstantiationViaReflection( - reporterClassName = "com.lanyuanxiaoyao.service.executor.metrics.VictoriaMetricsReporter") +@InterceptInstantiationViaReflection(reporterClassName = "com.lanyuanxiaoyao.service.executor.metrics.VictoriaMetricsReporter") public class VictoriaMetricsReporterFactory implements MetricReporterFactory { private static final Logger logger = LoggerFactory.getLogger(VictoriaMetricsReporterFactory.class); diff --git a/utils/executor/src/main/resources/services/org.apache.flink.client.deployment.ClusterClientFactory b/utils/executor/src/main/resources/META-INF/services/org.apache.flink.client.deployment.ClusterClientFactory similarity index 100% rename from utils/executor/src/main/resources/services/org.apache.flink.client.deployment.ClusterClientFactory rename to utils/executor/src/main/resources/META-INF/services/org.apache.flink.client.deployment.ClusterClientFactory diff --git a/utils/executor/src/main/resources/services/org.apache.flink.core.execution.PipelineExecutorFactory b/utils/executor/src/main/resources/META-INF/services/org.apache.flink.core.execution.PipelineExecutorFactory similarity index 100% rename from utils/executor/src/main/resources/services/org.apache.flink.core.execution.PipelineExecutorFactory rename to utils/executor/src/main/resources/META-INF/services/org.apache.flink.core.execution.PipelineExecutorFactory diff --git a/utils/executor/src/main/resources/services/org.apache.flink.metrics.reporter.MetricReporterFactory b/utils/executor/src/main/resources/META-INF/services/org.apache.flink.metrics.reporter.MetricReporterFactory similarity index 100% rename from utils/executor/src/main/resources/services/org.apache.flink.metrics.reporter.MetricReporterFactory rename to utils/executor/src/main/resources/META-INF/services/org.apache.flink.metrics.reporter.MetricReporterFactory diff --git a/utils/executor/src/main/resources/services/org.apache.flink.table.factories.TableFactory b/utils/executor/src/main/resources/META-INF/services/org.apache.flink.table.factories.TableFactory similarity index 100% rename from utils/executor/src/main/resources/services/org.apache.flink.table.factories.TableFactory rename to utils/executor/src/main/resources/META-INF/services/org.apache.flink.table.factories.TableFactory