Repository navigation
fix(sdk): support OpenTelemetry 1.39+ OTLPSpanExporter and prevent 401 race on logfile upload - #1477
Open
zainrizvi0611-cmd wants to merge 3 commits into
Conversation
…logfile upload auth sync
…logfile upload auth sync
…tibility and logfile upload auth sync
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two runtime issues when using
agentopswith neweropentelemetry-exporter-otlp-proto-http(>= 1.39/1.45+) and short-lived scripts:OTLPSpanExporterattribute layout (agentops/sdk/exporters.py):opentelemetry-exporter-otlp-proto-httpstore headers onself._client._headersand therequests.Sessiononself._client._transport._sessioninstead ofself._headers/self._session.AuthenticatedOTLPExporternow falls back toself._client._headersandself._client._transport._sessionand propagates updated JWT headers cleanly.upload_logfileon short-lived scripts (agentops/client/client.py,agentops/logging/instrument_logging.py):agentops.init(), theatexitspan shutdown could invokeInternalSpanProcessor.on_end->upload_logfile()before the background authentication thread finished settingclient.api.v4.auth_token, resulting in[agentops.InternalSpanProcessor] Error uploading logfile: Upload failed: 401.Client.wait_for_auth()synchronization so the JWT token is awaited before span export and logfile upload.