Skip to content

Commit c5f49c9

Browse files
authored
feat(asm): remove telemetry tag (#5648)
Remove telemetry tag until telemetry-intake service enables it ## Checklist - [x] Change(s) are motivated and described in the PR description. - [x] Testing strategy is described if automated tests are not included in the PR. - [x] Risk is outlined (performance impact, potential for breakage, maintainability, etc). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] [Library release note guidelines](https://ddtrace.readthedocs.io/en/stable/contributing.html#Release-Note-Guidelines) are followed. - [x] Documentation is included (in-code, generated user docs, [public corp docs](https://github.com/DataDog/documentation/)). - [x] PR description includes explicit acknowledgement/acceptance of the performance implications of this PR as reported in the benchmarks PR comment. ## Reviewer Checklist - [x] Title is accurate. - [x] No unnecessary changes are introduced. - [x] Description motivates each change. - [x] Avoids breaking [API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces) changes unless absolutely necessary. - [x] Testing strategy adequately addresses listed risk(s). - [x] Change is maintainable (easy to change, telemetry, documentation). - [x] Release note makes sense to a user of the library. - [x] Reviewer has explicitly acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment.
1 parent e46f345 commit c5f49c9

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

ddtrace/appsec/_metrics.py

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,25 +68,20 @@ def _set_waf_request_metrics():
6868
is_blocked = any(list_is_blocked)
6969
is_triggered = any((result.data for result in list_results))
7070
is_timeout = any((result.timeout for result in list_results))
71-
is_truncation = any((result.truncation for result in list_results))
71+
# TODO: enable it when Telemetry intake accepts this tag
72+
# is_truncation = any((result.truncation for result in list_results))
7273
has_info = any(list_result_info)
7374

74-
common_tags = {
75+
tags_request = {
7576
"waf_version": version(),
7677
"rule_triggered": is_triggered,
7778
"request_blocked": is_blocked,
7879
"waf_timeout": is_timeout,
79-
"request_truncated": is_truncation,
80+
# "request_truncated": is_truncation,
8081
}
8182

8283
if has_info and list_result_info[0].version:
83-
common_tags["event_rules_version"] = list_result_info[0].version
84-
85-
tags_request = {
86-
"rule_triggered": is_triggered,
87-
"request_blocked": is_blocked,
88-
}
89-
tags_request.update(common_tags)
84+
tags_request["event_rules_version"] = list_result_info[0].version
9085

9186
telemetry_metrics_writer.add_count_metric(
9287
TELEMETRY_NAMESPACE_TAG_APPSEC,

tests/appsec/test_telemety.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def _assert_generate_metrics(metrics_result, is_rule_triggered=False, is_blocked
4949
if metric.name == "waf.requests":
5050
assert metric._tags["rule_triggered"] is is_rule_triggered
5151
assert metric._tags["request_blocked"] is is_blocked_request
52-
assert metric._tags["request_truncated"] is False
52+
# assert metric._tags["request_truncated"] is False
5353
assert metric._tags["waf_timeout"] is False
5454
assert len(metric._tags["waf_version"]) > 0
5555
assert len(metric._tags["event_rules_version"]) > 0

0 commit comments

Comments
 (0)