Skip to content

Commit 7c29ba8

Browse files
committed
fix: remove unsupported span attribute
Signed-off-by: Varsha GS <[email protected]>
1 parent 202f144 commit 7c29ba8

File tree

7 files changed

+2
-9
lines changed

7 files changed

+2
-9
lines changed

src/instana/instrumentation/asgi.py

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ def __init__(self, app: "ExceptionMiddleware") -> None:
3131

3232
def _collect_kvs(self, scope: Dict[str, Any], span: "InstanaSpan") -> None:
3333
try:
34-
span.set_attribute("span.kind", SpanKind.SERVER)
3534
span.set_attribute("http.path", scope.get("path"))
3635
span.set_attribute(SpanAttributes.HTTP_METHOD, scope.get("method"))
3736

src/instana/instrumentation/pep0249.py

-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ def _collect_kvs(
3838
sql: str,
3939
) -> None:
4040
try:
41-
span.set_attribute("span.kind", SpanKind.CLIENT)
42-
4341
db_parameter_name = next(
4442
(
4543
p

src/instana/instrumentation/pyramid.py

-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ def __call__(self, request: "Request") -> "Response":
3636
ctx = tracer.extract(Format.HTTP_HEADERS, dict(request.headers))
3737

3838
with tracer.start_as_current_span("wsgi", span_context=ctx) as span:
39-
span.set_attribute("span.kind", SpanKind.SERVER)
4039
span.set_attribute("http.host", request.host)
4140
span.set_attribute(SpanAttributes.HTTP_METHOD, request.method)
4241
span.set_attribute(SpanAttributes.HTTP_URL, request.path)

src/instana/instrumentation/sanic_inst.py

-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ def request_with_instana(request: Request) -> None:
5858
token = context.attach(ctx)
5959
request.ctx.token = token
6060

61-
span.set_attribute("span.kind", SpanKind.SERVER)
6261
span.set_attribute("http.path", request.path)
6362
span.set_attribute(SpanAttributes.HTTP_METHOD, request.method)
6463
span.set_attribute(SpanAttributes.HTTP_HOST, request.host)

src/instana/span/registered_span.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ def __init__(self, span, source, service_name, **kwargs) -> None:
3434
if "gcps" in span.name:
3535
self.n = "gcps"
3636

37-
# Store any leftover attributes in the custom section
37+
# Logic to store custom attributes for registered spans (not used yet)
3838
if len(span.attributes) > 0:
39-
self.data["custom"]["attributes"] = self._validate_attributes(
39+
self.data["sdk"]["custom"]["tags"] = self._validate_attributes(
4040
span.attributes
4141
)
4242

tests/clients/test_pep0249.py

-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ def test_collect_kvs(self) -> None:
116116
select * from tests;
117117
"""
118118
self.test_wrapper._collect_kvs(span, sample_sql)
119-
assert span.attributes["span.kind"] == SpanKind.CLIENT
120119
assert span.attributes["db.name"] == "instana_test_db"
121120
assert span.attributes["db.statement"] == sample_sql
122121
assert span.attributes["db.user"] == "root"

tests/span/test_registered_span.py

-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ def test_collect_http_attributes_with_attributes(
6666
) -> None:
6767
span_name = "test-registered-span"
6868
attributes = {
69-
"span.kind": "entry",
7069
"http.host": "localhost",
7170
"http.url": "https://www.instana.com",
7271
"http.header.test": "one more test",

0 commit comments

Comments
 (0)