Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'otel_attributes' #1509

Closed
kvspb opened this issue Mar 30, 2022 · 1 comment · Fixed by #1510
Closed

KeyError: 'otel_attributes' #1509

kvspb opened this issue Mar 30, 2022 · 1 comment · Fixed by #1510
Labels
agent-python community Issues opened by the community triage Issues awaiting triage

Comments

@kvspb
Copy link

kvspb commented Mar 30, 2022

elastic-apm: 6.9.0

KeyError: 'otel_attributes'
  File "elasticapm/contrib/starlette/__init__.py", line 185, in __call__
    self.client.end_transaction()
  File "elasticapm/base.py", line 313, in end_transaction
    transaction = self.tracer.end_transaction(result, name, duration=duration)
  File "elasticapm/traces.py", line 898, in end_transaction
    transaction.end(duration=duration)
  File "elasticapm/traces.py", line 232, in end
    super().end(skip_frames, duration)
  File "elasticapm/traces.py", line 126, in end
    self.compression_buffer.report()
  File "elasticapm/traces.py", line 670, in report
    self.tracer.queue_func(SPAN, self.to_dict())
  File "elasticapm/traces.py", line 580, in to_dict
    attributes = self.context.pop("otel_attributes")
@github-actions github-actions bot added agent-python community Issues opened by the community triage Issues awaiting triage labels Mar 30, 2022
beniwohli added a commit to beniwohli/apm-agent-python that referenced this issue Mar 30, 2022
the issue wasn't originally caught in testing because we hardcode
the server_version to a certain value (currently 8.0.0), and this
bug was in a branch that only is hit with a server version lower
than 7.16

fixes elastic#1509
@beniwohli
Copy link
Contributor

Hey @kvspb, thanks for raising this! I opened #1510, which should fix this. We'll get a release shipped ASAP. In the meantime, you could either downgrade elastic-apm to the previous version, or update APM Server to 7.16 (and the rest of the Elastic stack, if necessary)

basepi added a commit that referenced this issue Mar 30, 2022
* fix issue in span serialization when using APM Server < 7.16

the issue wasn't originally caught in testing because we hardcode
the server_version to a certain value (currently 8.0.0), and this
bug was in a branch that only is hit with a server version lower
than 7.16

fixes #1509

* CHANGELOG

Co-authored-by: Colton Myers <colton.myers@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-python community Issues opened by the community triage Issues awaiting triage
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants