-
Notifications
You must be signed in to change notification settings - Fork 238
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
OtelCol exporters should should only initialise for the telemetry types for which they're configured #251
Comments
I don't understand why the current behavior is a problem; can you explain more?
One issue with this approach is that if you update your config to stop sending a particular telemetry type, the lazy implementation will still continue running, since components have no knowledge of other components wired to them. |
It is possible to configure an LB exporter with metrics-specific config. This can be done by using a If a user wires a |
This issue has not had any activity in the past 30 days, so the |
#2242 may fix this issue. Only exporters supported by |
Closing this since we could use #2242 as a baseline for how we handle such cases in the future. Thank you, @madaraszg-tulip! |
Request
If a River config file contains an
otelcol.exporter
such asotelcol.exporter.otlp
, that exporter will always create the underlying Collector exporters for logs, metrics, and traces. For example, even if that exporter is only used for logs, it will still create the exporters for metrics and traces. The relevant code is in component/otelcol/exporter/exporter.go.The code needs to be changed in such a way so that the component only starts the exporters which it is used for. For example, if only logs are forwarded to the exporter component, only the logs exporter should be created.
Maybe one way to solve this is to create lazy implementations of the interfaces of exporter.Traces, exporter.Metrics and exporter.Logs. Those lazy implementations would call functions like
e.factory.CreateTracesExporter
only when theStart
function is called. Then have the code incomponent/otelcol/exporter/exporter.go
use those lazy exporters instead of the result ofe.factory.CreateTracesExporter
directly. I'm not 100% sure whether this would work, but it's the most obvious approach that I can think of.Use case
This change is necessary in order to support the load balancing exporter with metrics. The configuration for metrics is quite unique, and
otelcol.exporter.loadbalancing
can crash if it is configured to process a routing key of "trace ID" with a metrics exporter.Related to grafana/agent#5684
The text was updated successfully, but these errors were encountered: