Repository navigation
fix: handle a tracing provider without otlp_http on non-leader units - #2918
Open
Indian-boult wants to merge 3 commits into
Open
Indian-boult wants to merge 3 commits into
Indian-boult wants to merge 3 commits into
Conversation
When the tracing provider publishes receivers but none for `otlp_http`, `TracingEndpointRequirer.get_endpoint()` checks which protocols were requested by reading the charm's own application databag. Only the leader can read it, so on other units the hook failed with `RelationDataAccessError`, for example on start or on `charm-tracing-relation-changed`. Read the provider's receivers with `get_all_endpoints()` and pick the `otlp_http` one directly. The destination stays unset until the provider offers it, as it already did on the leader. `ProtocolNotRequestedError` was only raised by `get_endpoint()`, so it is no longer caught.
tonyandrewmeyer
approved these changes
Nov 18, 2026
tonyandrewmeyer
left a comment
Collaborator
There was a problem hiding this comment.
Nice catch, thanks! I checked that the follower case does fail on main without the fix (RelationDataAccessError reading our own app databag).
get_endpoint() logged this case, and it is the only clue as to why no traces are sent. Also run the provided-endpoint conformance test as a non-leader, since followers now look up the receiver too.
Collaborator
Please do not ping people like this. |
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.
When the tracing provider publishes receivers but none for
otlp_http,TracingEndpointRequirer.get_endpoint()checks which protocols were requested by reading the charm's own app databag. Only the leader can read it, so on other units the hook failed withRelationDataAccessError.Tracingnow reads the receivers withget_all_endpoints()and picks theotlp_httpone itself, so the destination stays unset until the provider offers it, as it already did on the leader. Until then it logs at debug level that the provider doesn't offerotlp_http, asget_endpoint()did.ProtocolNotRequestedErrorwas only raised byget_endpoint(), so it's no longer caught. The vendored library is unchanged.The conformance tests for a provided endpoint and for an unsupported protocol now run as a non-leader as well as the leader.