Skip to content

Commit

Permalink
Properly handle a parsing edge case (#7717)
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek authored Oct 6, 2020
1 parent 3c7f38e commit 676c371
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions envoy/datadog_checks/envoy/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ def parse_metric(metric, metric_mapping=METRIC_TREE):
if metric_part in metric_mapping and num_tags >= minimum_tag_length:
# Rebuild any built up tags whenever we encounter a known metric part.
if tag_builder:
# Edge case where we hit a known metric part after a sequence of all unknown parts
if '|_tags_|' not in metric_mapping:
raise UnknownMetric

for tags in metric_mapping['|_tags_|']:
if num_tags >= len(tags):
break
Expand Down
5 changes: 5 additions & 0 deletions envoy/tests/fixtures/multiple_services
Original file line number Diff line number Diff line change
Expand Up @@ -4505,3 +4505,8 @@ tcp_mixer_filter.total_remote_check_calls: 0
tcp_mixer_filter.total_remote_quota_calls: 0
tcp_mixer_filter.total_remote_report_calls: 0
tcp_mixer_filter.total_report_calls: 0
wasm.envoy.wasm.runtime.null.active: 0
wasm.envoy.wasm.runtime.null.created: 0
wasm_vm.envoy.wasm.runtime.null.active: 0
wasm_vm.envoy.wasm.runtime.null.cloned: 0
wasm_vm.envoy.wasm.runtime.null.created: 0

0 comments on commit 676c371

Please sign in to comment.