Modifying how we handle OTEL traces/metrics endpoints #300
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.
Investigating about #297, I realized an edge case in which a user setting the endpoint value via the
endpoint
YAML property would get automatically attached the/v1/metrics
or/v1/traces
path.Since there each
endpoint
sets the value separately for their respective metrics or traces exporter, I think they should behave like theOTEL_EXPORTER_OTLP_TRACES_ENDPOINT
orOTEL_EXPORTER_OTLP_METRICS_ENDPOINT
env vars (use the endpoint without modification) instead of the currentOTEL_EXPORTER_OTLP_ENDPOINT
(add/v1/metrics
or/v1/traces
accordingly).There was also the issue that we indiscriminately added the
/v1/metrics
or/v1/traces
path suffix even if a user explicitly set the values through theOTEL_EXPORTER_OTLP_TRACES_ENDPOINT
orOTEL_EXPORTER_OTLP_METRICS_ENDPOINT
. That means that an OTEL ingestor not exposing these standard paths but custom ones would not properly work with Beyla.The breaking change relies in the way the YAML file is handled, and that we now stick to the standard.
This PR also refines the way the different exporter options are tested.