Skip to content

Conversation

@Ferenc-
Copy link
Member

@Ferenc- Ferenc- commented Jul 29, 2024

No description provided.

@Ferenc- Ferenc- force-pushed the fix-tracing-level branch 2 times, most recently from a2d18bc to 7c54ae0 Compare July 29, 2024 17:07
@Ferenc- Ferenc- marked this pull request as draft July 29, 2024 17:07
@Ferenc- Ferenc- force-pushed the fix-tracing-level branch from 7c54ae0 to dde4f13 Compare July 31, 2024 08:25
@Ferenc- Ferenc- changed the title fix: Prioritize trace level from current context fix: Ensure trace level from current context is considered Jul 31, 2024
@Ferenc- Ferenc- marked this pull request as ready for review July 31, 2024 08:31
Signed-off-by: Ferenc Géczi <ferenc.geczi@ibm.com>
Copy link
Member

@pvital pvital left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me.

@Ferenc- Ferenc- merged commit eb5f7bc into master Jul 31, 2024
@Ferenc- Ferenc- deleted the fix-tracing-level branch July 31, 2024 18:55
span_id = span_context.span_id
# Suppression `level` made in the child context or in the parent context
# has priority over any non-suppressed `level` setting
child_level = int(self.extract_instana_headers(carrier)[2] or "1")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Ferenc- , according to PEP 333, response_headers are a list of tuples. I tested with wsgi frameworks bottle and cherrypy and both of them produce errors with our existing code on the master branch.

2024-08-07 18:38:40,399: 43705 DEBUG instana: extract error:
Traceback (most recent call last):
  File "/Users/varsha/Documents/GitHub/instana-repos/tracer-repos/python-sensor/src/instana/propagators/base_propagator.py", line 221, in extract_instana_headers
    trace_id = dc.get(self.LC_HEADER_KEY_T) or dc.get(self.ALT_LC_HEADER_KEY_T) or dc.get(
AttributeError: 'list' object has no attribute 'get'
# bottle
<class 'list'> [('Content-Length', '12'), ('Content-Type', 'text/html; charset=UTF-8')]
# cherrypy
<class 'list'> [('Content-Type', 'text/html;charset=utf-8'), ('Server', 'CherryPy/18.10.0'), ('Date', 'Wed, 07 Aug 2024 13:08:40 GMT'), ('Content-Length', '11')]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants