Skip to content

Commit 4e1fa6f

Browse files
committed
just do underscore
1 parent 2e9dad1 commit 4e1fa6f

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

sentry_sdk/opentelemetry/span_processor.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,6 @@
4545

4646
DEFAULT_MAX_SPANS = 1000
4747

48-
# Span attributes internal to the SDK that should be omitted from the final payload
49-
IGNORE_SPAN_ATTRIBUTES = [
50-
"flag.count",
51-
]
52-
5348

5449
class SentrySpanProcessor(SpanProcessor):
5550
"""
@@ -297,7 +292,7 @@ def _span_to_json(self, span):
297292
if getattr(span, "attributes", {}):
298293
span_json["data"] = {}
299294
for key, value in span.attributes.items():
300-
if key not in IGNORE_SPAN_ATTRIBUTES:
295+
if not key.startswith("_"):
301296
span_json["data"][key] = value
302297

303298
return span_json

sentry_sdk/tracing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,10 +600,10 @@ def set_context(self, key, value):
600600

601601
def set_flag(self, flag, value):
602602
# type: (str, bool) -> None
603-
flag_count = self.get_attribute("flag.count") or 0
603+
flag_count = self.get_attribute("_flag.count") or 0
604604
if flag_count < _FLAGS_CAPACITY:
605605
self.set_attribute(f"flag.evaluation.{flag}", value)
606-
self.set_attribute("flag.count", flag_count + 1)
606+
self.set_attribute("_flag.count", flag_count + 1)
607607

608608

609609
# TODO-neel-potel add deprecation

tests/test_feature_flags.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,4 +274,4 @@ def test_flag_counter_not_sent(sentry_init, capture_events):
274274
add_feature_flag("3", True)
275275

276276
(event,) = events
277-
assert "flag.counter" not in event["spans"][0]["data"]
277+
assert "_flag.count" not in event["spans"][0]["data"]

0 commit comments

Comments
 (0)