Skip to content

Commit

Permalink
[FLINK-29002][datadog] Deprecate 'tags' option
Browse files Browse the repository at this point in the history
  • Loading branch information
zentol committed Aug 17, 2022
1 parent 62e53e0 commit 3e6f47c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 0 additions & 2 deletions docs/content.zh/docs/deployment/metric_reporters.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ metrics.reporter.stsd.interval: 60 SECONDS
参数:

- `apikey` - Datadog 的 API KEY。
- `tags` - (可选的)发送到 Datadog 时将会转换为指标的全局 tag。tag 间只能以逗号分隔。
- `proxyHost` - (可选的)发送到 Datadog 时使用的代理主机。
- `proxyPort` - (可选的)发送到 Datadog 时使用的代理端口,默认为 8080。
- `dataCenter` - (可选的)要连接的数据中心(`EU`/`US`),默认为 `US`。
Expand All @@ -282,7 +281,6 @@ metrics.reporter.stsd.interval: 60 SECONDS
```yaml
metrics.reporter.dghttp.factory.class: org.apache.flink.metrics.datadog.DatadogHttpReporterFactory
metrics.reporter.dghttp.apikey: xxx
metrics.reporter.dghttp.tags: myflinkapp,prod
metrics.reporter.dghttp.proxyHost: my.web.proxy.com
metrics.reporter.dghttp.proxyPort: 8080
metrics.reporter.dghttp.dataCenter: US
Expand Down
2 changes: 0 additions & 2 deletions docs/content/docs/deployment/metric_reporters.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,6 @@ In contrast to Datadog-provided Histograms the reported aggregations are not com
Parameters:

- `apikey` - the Datadog API key
- `tags` - (optional) the global tags that will be applied to metrics when sending to Datadog. Tags should be separated by comma only
- `proxyHost` - (optional) The proxy host to use when sending to Datadog.
- `proxyPort` - (optional) The proxy port to use when sending to Datadog, defaults to 8080.
- `dataCenter` - (optional) The data center (`EU`/`US`) to connect to, defaults to `US`.
Expand All @@ -266,7 +265,6 @@ Example configuration:
```yaml
metrics.reporter.dghttp.factory.class: org.apache.flink.metrics.datadog.DatadogHttpReporterFactory
metrics.reporter.dghttp.apikey: xxx
metrics.reporter.dghttp.tags: myflinkapp,prod
metrics.reporter.dghttp.proxyHost: my.web.proxy.com
metrics.reporter.dghttp.proxyPort: 8080
metrics.reporter.dghttp.dataCenter: US
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,16 @@
import org.apache.flink.metrics.reporter.MetricReporter;
import org.apache.flink.metrics.reporter.MetricReporterFactory;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Properties;

/** {@link MetricReporterFactory} for {@link DatadogHttpReporter}. */
public class DatadogHttpReporterFactory implements MetricReporterFactory {

private static final Logger LOG = LoggerFactory.getLogger(DatadogHttpReporterFactory.class);

private static final String API_KEY = "apikey";
private static final String PROXY_HOST = "proxyHost";
private static final String PROXY_PORT = "proxyPort";
Expand All @@ -43,6 +48,10 @@ public MetricReporter createMetricReporter(Properties config) {
final int maxMetricsPerRequestValue =
Integer.valueOf(config.getProperty(MAX_METRICS_PER_REQUEST, "2000"));
final DataCenter dataCenter = DataCenter.valueOf(rawDataCenter);
if (config.containsKey(TAGS)) {
LOG.warn(
"The 'tags' option is deprecated; please use 'scope.variables.additional' instead.");
}
final String tags = config.getProperty(TAGS, "");
final boolean useLogicalIdentifier =
Boolean.parseBoolean(config.getProperty(USE_LOGICAL_IDENTIFIER, "false"));
Expand Down

0 comments on commit 3e6f47c

Please sign in to comment.