fix: stop reporting metrics in client transport #43
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 there is no opentelemetry config provided, we default to report traces and metrics it there is an exporter configured.
However, if some property of a config is provided, those reporting by default do not apply and you must explicitly set what you want to be reported.
In the case of the transport, there was a bug, that was checking if either traces or metrics were enabled to instrument the client. That means that, if traces were enabled but not metrics, we would report both of them (or the other way around).
That also leads to an "unexpected behaviour" : if we only configure static attributes (either for metrics or traces) and we do not set the other options, the config still results in not instrumenation enabled. And if we provide static_attributes for one of them (for example metrics) , it ends disables, but if we do not provide any configuration at all for the other (for example traces), due to this bug, the metrics get reported with the provided attributes.
This fixes this behaviour. But still, it might be "unexpected" to provide static attributes, but having the instrumentation disabled for no providins something like
"round_trip": true
in the same config.