Skip to content

Commit

Permalink
feat: improve robustness of custom service naming
Browse files Browse the repository at this point in the history
Previously, we only added span.data.service to _entry_ spans (when
the environment variable INSTANA_SERVICE_NAME is set). The
requirements around this have changed, now we add this annotation to
_all_ spans (but still only if it has been explicitly configured).
  • Loading branch information
Bastian Krol committed Mar 6, 2023
1 parent 649e607 commit 8009291
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions instana/span.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ def __init__(self, span, source, service_name, **kwargs):
self.n = "sdk"
self.k = span_kind[1]

if self.k == 1 and service_name is not None:
if service_name is not None:
self.data["service"] = service_name

self.data["sdk"]["name"] = span.operation_name
Expand Down Expand Up @@ -263,10 +263,10 @@ def __init__(self, span, source, service_name, **kwargs):
self.n = span.operation_name
self.k = 1

self.data["service"] = service_name
if span.operation_name in self.ENTRY_SPANS:
# entry
self._populate_entry_span_data(span)
self.data["service"] = service_name
self._populate_extra_span_attributes(span)
elif span.operation_name in self.EXIT_SPANS:
self.k = 2 # exit
Expand Down

0 comments on commit 8009291

Please sign in to comment.