From 3bbecc83fe79ff0812f09a5f306d82db6b59eb34 Mon Sep 17 00:00:00 2001 From: Varsha GS Date: Wed, 25 Sep 2024 16:24:35 +0530 Subject: [PATCH] fix: Remove an unsupported Span attribute. - Removed the span field "l" (which stores the span level) from the Span data since the Instana Backend does not support it. Signed-off-by: Varsha GS --- src/instana/span/base_span.py | 2 -- tests/frameworks/test_flask.py | 6 ------ tests/span/test_base_span.py | 2 -- 3 files changed, 10 deletions(-) diff --git a/src/instana/span/base_span.py b/src/instana/span/base_span.py index 1ff47b4d8..fbdb4c42b 100644 --- a/src/instana/span/base_span.py +++ b/src/instana/span/base_span.py @@ -23,9 +23,7 @@ def __init__(self, span: Type["Span"], source, **kwargs) -> None: # pylint: disable=invalid-name self.t = span.context.trace_id self.p = span.parent_id - # self.p = span.context.span_id if span.context.is_remote else None self.s = span.context.span_id - self.l = span.context.level self.ts = round(span.start_time / 10**6) self.d = round(span.duration / 10**6) if span.duration else None self.f = source diff --git a/tests/frameworks/test_flask.py b/tests/frameworks/test_flask.py index 145d0e333..fdbf49192 100644 --- a/tests/frameworks/test_flask.py +++ b/tests/frameworks/test_flask.py @@ -206,9 +206,6 @@ def test_get_request_with_suppression(self) -> None: # This should not be present assert response.headers.get("tracestate", None) is None - # Assert that there isn't any span, where level is not 0! - assert any(map(lambda x: x.l != 0, spans)) is False - # Assert that there are no spans in the recorded list assert spans == [] @@ -232,9 +229,6 @@ def test_get_request_with_suppression_and_w3c(self) -> None: # The 'in=' section can not be in the tracestate assert "in=" not in response.headers["tracestate"] - # Assert that there isn't any span, where level is not 0! - assert any(map(lambda x: x.l != 0, spans)) is False - # Assert that there are no spans in the recorded list assert spans == [] diff --git a/tests/span/test_base_span.py b/tests/span/test_base_span.py index 5f1a16c40..9a7d8891d 100644 --- a/tests/span/test_base_span.py +++ b/tests/span/test_base_span.py @@ -20,7 +20,6 @@ def test_basespan( "t": trace_id, "p": None, "s": span_id, - "l": 1, "ts": round(span.start_time / 10**6), "d": None, "f": None, @@ -32,7 +31,6 @@ def test_basespan( assert expected_dict["t"] == base_span.t assert expected_dict["s"] == base_span.s assert expected_dict["p"] == base_span.p - assert expected_dict["l"] == base_span.l assert expected_dict["ts"] == base_span.ts assert expected_dict["d"] == base_span.d assert not base_span.f