Skip to content

Commit

Permalink
fix: Remove an unsupported Span attribute.
Browse files Browse the repository at this point in the history
- 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 <varsha.gs@ibm.com>
  • Loading branch information
Varsha GS authored and pvital committed Sep 25, 2024
1 parent fd82b29 commit 3bbecc8
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 10 deletions.
2 changes: 0 additions & 2 deletions src/instana/span/base_span.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions tests/frameworks/test_flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 == []

Expand All @@ -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 == []

Expand Down
2 changes: 0 additions & 2 deletions tests/span/test_base_span.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down

0 comments on commit 3bbecc8

Please sign in to comment.