Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename cluster_name tag to envoy_cluster #9430

Merged
merged 5 commits into from
Jun 14, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions envoy/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ files:
value:
type: boolean
example: true
- name: disable_legacy_cluster_tag
description: |
Enable to stop submitting the tag `cluster_name` and `virtual_cluster_name`,
coignetp marked this conversation as resolved.
Show resolved Hide resolved
which has been renamed to `envoy_cluster` and `virtual_envoy_cluster`.
value:
coignetp marked this conversation as resolved.
Show resolved Hide resolved
type: boolean
display_default: false
example: true
- template: instances/default
- template: instances/http
overrides:
Expand Down
4 changes: 4 additions & 0 deletions envoy/datadog_checks/envoy/config_models/defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ def instance_connect_timeout(field, value):
return get_default_field_value(field, value)


def instance_disable_legacy_cluster_tag(field, value):
return True


def instance_empty_default_hostname(field, value):
return False

Expand Down
1 change: 1 addition & 0 deletions envoy/datadog_checks/envoy/config_models/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class Config:
cache_metrics: Optional[bool]
collect_server_info: Optional[bool]
connect_timeout: Optional[float]
disable_legacy_cluster_tag: Optional[bool]
empty_default_hostname: Optional[bool]
excluded_metrics: Optional[Sequence[str]]
extra_headers: Optional[Mapping[str, Any]]
Expand Down
6 changes: 6 additions & 0 deletions envoy/datadog_checks/envoy/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ instances:
#
# collect_server_info: true

## @param disable_legacy_cluster_tag - boolean - optional - default: false
## Enable to stop submitting the tag `cluster_name` and `virtual_cluster_name`,
## which has been renamed to `envoy_cluster` and `virtual_envoy_cluster`.
#
# disable_legacy_cluster_tag: true
coignetp marked this conversation as resolved.
Show resolved Hide resolved

## @param tags - list of strings - optional
## A list of tags to attach to every metric and service check emitted by this instance.
##
Expand Down
7 changes: 6 additions & 1 deletion envoy/datadog_checks/envoy/envoy.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def __init__(self, name, init_config, instances):

self.caching_metrics = None
self.parse_unknown_metrics = is_affirmative(self.instance.get('parse_unknown_metrics', False))
self.disable_legacy_cluster_tag = is_affirmative(self.instance.get('disable_legacy_cluster_tag', False))

def check(self, _):
self._collect_metadata()
Expand Down Expand Up @@ -88,7 +89,11 @@ def check(self, _):
continue

try:
metric, tags, method = parse_metric(envoy_metric, retry=self.parse_unknown_metrics)
metric, tags, method = parse_metric(
envoy_metric,
retry=self.parse_unknown_metrics,
disable_legacy_cluster_tag=self.disable_legacy_cluster_tag,
)
except UnknownMetric:
if envoy_metric not in self.unknown_metrics:
self.log.debug('Unknown metric `%s`', envoy_metric)
Expand Down
Loading