-
Notifications
You must be signed in to change notification settings - Fork 487
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
Flow: add OpenTelemetry Collector components #2213
Comments
This commit introduces the component/otelcol package, which will eventually hold a collection of `otelcol.*` components. Initial prototyping work for Flow OpenTelemetry Collector components was done in grafana#1843, which demonstrated that the full set of code needed to implement OpenTelemetry Components is quite large. I will be splitting up the needed code across a few changes; this is the first. This initial commit starts setting up the framework for running OpenTelemetry Collector components inside of Flow with a `componentScheduler` struct. Related to grafana#2213.
…onents (#2224) * component/otelcol: initial commit This commit introduces the component/otelcol package, which will eventually hold a collection of `otelcol.*` components. Initial prototyping work for Flow OpenTelemetry Collector components was done in #1843, which demonstrated that the full set of code needed to implement OpenTelemetry Components is quite large. I will be splitting up the needed code across a few changes; this is the first. This initial commit starts setting up the framework for running OpenTelemetry Collector components inside of Flow with a `componentScheduler` struct. Related to #2213. * move scheduler to an internal/scheduler package. The otelcol component scheduler code will need to be exposed to multiple packages, but it doesn't make sense to make it part of the public API. * fix linting errors
This commit introduces a new package, component/otelcol/exporter, which exposes a generic Flow component implementation which can run OpenTelemetry Collector exporters. There is some stuff left to do for this implementation to be complete: * A Zap logging adapter needs to be created to correctly process logs from OpenTelemetry Collector components. * Component-specific metrics are currently ignored. * Component-specific traces are currently ignored. All of the above will be done in separate PRs. As of this commit, there are no registered `otelcol.exporter.*` components. Implementations for OpenTelemetry Collector Flow components will be done in future PRs. Related to grafana#2213.
) * component/otelcol/exporter: initial commit This commit introduces a new package, component/otelcol/exporter, which exposes a generic Flow component implementation which can run OpenTelemetry Collector exporters. There is some stuff left to do for this implementation to be complete: * A Zap logging adapter needs to be created to correctly process logs from OpenTelemetry Collector components. * Component-specific metrics are currently ignored. * Component-specific traces are currently ignored. All of the above will be done in separate PRs. As of this commit, there are no registered `otelcol.exporter.*` components. Implementations for OpenTelemetry Collector Flow components will be done in future PRs. Related to #2213. * switch to using JSON reprsentation for test traces * fix typo * scheduler: clarify comment * Update component/otelcol/internal/scheduler/scheduler.go * scheduler: make customizing exports/extensions options on NewHost * fix flaky test
This commit introduces a new package, component/otelcol/receiver, which exposes a generic Flow component implementation which can run OpenTelemetry Collector receiver. Like grafana#2227, it leaves some work unfinished for future PRs: * A Zap logging adapter needs to be created to correctly process logs from OpenTelemetry Collector components. * Component-specific metrics are currently ignored. * Component-specific traces are currently ignored. As of this commit, there are no registered `otelcol.receiver.*` components. Implementations for OpenTelemetry Collector Flow components will be done in future PRs. Related to grafana#2213.
) This commit introduces a new package, component/otelcol/receiver, which exposes a generic Flow component implementation which can run OpenTelemetry Collector receiver. Like #2227, it leaves some work unfinished for future PRs: * A Zap logging adapter needs to be created to correctly process logs from OpenTelemetry Collector components. * Component-specific metrics are currently ignored. * Component-specific traces are currently ignored. As of this commit, there are no registered `otelcol.receiver.*` components. Implementations for OpenTelemetry Collector Flow components will be done in future PRs. Related to #2213.
This commit introduces a new package, component/otelcol/processor, which exposes a generic Flow component implementation which can run OpenTelemetry Collector processor. Like grafana#2227 and grafana#2254, it leaves some work unfinished for future PRs: * A Zap logging adapter needs to be created to correctly process logs from OpenTelemetry Collector components. * Component-specific metrics are currently ignored. * Component-specific traces are currently ignored. As of this commit, there are no registered `otelcol.processor.*` components. Implementations for OpenTelemetry Collector Flow components will be done in future PRs. Related to grafana#2213.
This commit introduces a new package, component/otelcol/processor, which exposes a generic Flow component implementation which can run OpenTelemetry Collector processor. Like grafana#2227 and grafana#2254, it leaves some work unfinished for future PRs: * A Zap logging adapter needs to be created to correctly process logs from OpenTelemetry Collector components. * Component-specific metrics are currently ignored. * Component-specific traces are currently ignored. As of this commit, there are no registered `otelcol.processor.*` components. Implementations for OpenTelemetry Collector Flow components will be done in future PRs. Related to grafana#2213.
…ents This introduces component/otelcol/internal/zapadapter, which creates a *zap.Logger instance from a github.com/go-kit/log.Logger instance. This is then used when creating OpenTelemetry Collector components, allowing us to continue to use github.com/go-kit/log consistently throughout Flow. Related to grafana#2213.
This commit introduces a new package, component/otelcol/processor, which exposes a generic Flow component implementation which can run OpenTelemetry Collector processor. Like grafana#2227 and grafana#2254, it leaves some work unfinished for future PRs: * A Zap logging adapter needs to be created to correctly process logs from OpenTelemetry Collector components. * Component-specific metrics are currently ignored. * Component-specific traces are currently ignored. As of this commit, there are no registered `otelcol.processor.*` components. Implementations for OpenTelemetry Collector Flow components will be done in future PRs. Related to grafana#2213.
…2284) This commit introduces a new package, component/otelcol/processor, which exposes a generic Flow component implementation which can run OpenTelemetry Collector processor. Like #2227 and #2254, it leaves some work unfinished for future PRs: * Component-specific metrics are currently ignored. * Component-specific traces are currently ignored. As of this commit, there are no registered `otelcol.processor.*` components. Implementations for OpenTelemetry Collector Flow components will be done in future PRs. Related to #2213.
I'm on the fence about this now. Authentication is handled by extensions, and the way we wrap components doesn't make it easy for There seems to be two choices here:
|
OpenTelemetry supports many extensions. Extensions are used as a generic way to put "everything else" into OpenTelemetry. There are two types of extensions relevant to us: * [Authentication extensions][auth-ext]: used for both client and server authentication. * [Storage extensions][storage-ext]: used for external storage of state. Other extensions, such as [awsproxy][] are useful but better suited as generic Flow components rather than being shoved in the otelcol namespace, since they are unrelated to telemetry pipelines and aren't referenced by other otelcol components in the upstream configuration. This commit introduces a new package, component/otelcol/auth, which exposes a generic Flow component implementation which can run OpenTelemetry Collector extensions meant for authentication. While storage extensions may end up being Flow components eventually, it's currently marked as experimental upstream. We will reevaluate storage extension components once things have stabilized a little more. Like grafana#2227, grafana#2254, and grafana#2284, it leaves some work unfinished for future PRs: * Component-specific metrics are currently ignored. * Component-specific traces are currently ignored. As of this commit, there are no registered `otelcol.auth.*` components. Implementations for OpenTelemetry Collector Flow components will be done in future PRs. Related to grafana#2213. [auth-ext]: https://pkg.go.dev/go.opentelemetry.io/collector@v0.61.0/config/configauth [storage-ext]: https://pkg.go.dev/go.opentelemetry.io/collector/extension/experimental/storage [awsproxy]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.61.0/extension/awsproxy
OpenTelemetry supports many extensions. Extensions are used as a generic way to put "everything else" into OpenTelemetry. To quote their [documentation][ext-docs]: > Extension is the interface for objects hosted by the OpenTelemetry > Collector that don't participate directly on data pipelines but provide > some functionality to the service, examples: health check endpoint, > z-pages, etc. There are two types of extensions relevant to us: * [Authentication extensions][auth-ext]: used for both client and server authentication. * [Storage extensions][storage-ext]: used for external storage of state. Other extensions, such as [awsproxy][] are useful but better suited as generic Flow components rather than being shoved in the otelcol namespace, since they are unrelated to telemetry pipelines and aren't referenced by other otelcol components in the upstream configuration. This commit introduces a new package, component/otelcol/auth, which exposes a generic Flow component implementation which can run OpenTelemetry Collector extensions meant for authentication. While storage extensions may end up being Flow components eventually, it's currently marked as experimental upstream. We will reevaluate storage extension components once things have stabilized a little more. Like grafana#2227, grafana#2254, and grafana#2284, it leaves some work unfinished for future PRs: * Component-specific metrics are currently ignored. * Component-specific traces are currently ignored. As of this commit, there are no registered `otelcol.auth.*` components. Implementations for OpenTelemetry Collector Flow components will be done in future PRs. Related to grafana#2213. [ext-docs]: https://pkg.go.dev/go.opentelemetry.io/collector@v0.61.0/component#Extension [auth-ext]: https://pkg.go.dev/go.opentelemetry.io/collector@v0.61.0/config/configauth [storage-ext]: https://pkg.go.dev/go.opentelemetry.io/collector/extension/experimental/storage [awsproxy]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.61.0/extension/awsproxy
OpenTelemetry supports many extensions. Extensions are used as a generic way to put "everything else" into OpenTelemetry. To quote their [documentation][ext-docs]: > Extension is the interface for objects hosted by the OpenTelemetry > Collector that don't participate directly on data pipelines but provide > some functionality to the service, examples: health check endpoint, > z-pages, etc. There are two types of extensions relevant to us: * [Authentication extensions][auth-ext]: used for both client and server authentication. * [Storage extensions][storage-ext]: used for external storage of state. Other extensions, such as [awsproxy][] are useful but better suited as generic Flow components rather than being shoved in the otelcol namespace, since they are unrelated to telemetry pipelines and aren't referenced by other otelcol components in the upstream configuration. This commit introduces a new package, component/otelcol/auth, which exposes a generic Flow component implementation which can run OpenTelemetry Collector extensions meant for authentication. While storage extensions may end up being Flow components eventually, it's currently marked as experimental upstream. We will reevaluate storage extension components once things have stabilized a little more. Like grafana#2227, grafana#2254, and grafana#2284, it leaves some work unfinished for future PRs: * Component-specific metrics are currently ignored. * Component-specific traces are currently ignored. As of this commit, there are no registered `otelcol.auth.*` components. Implementations for OpenTelemetry Collector Flow components will be done in future PRs. Related to grafana#2213. [ext-docs]: https://pkg.go.dev/go.opentelemetry.io/collector@v0.61.0/component#Extension [auth-ext]: https://pkg.go.dev/go.opentelemetry.io/collector@v0.61.0/config/configauth [storage-ext]: https://pkg.go.dev/go.opentelemetry.io/collector/extension/experimental/storage [awsproxy]: https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/v0.61.0/extension/awsproxy
The tracing subsystem in Static mode also supports "load_balancing" and "automatic_logging". Are we going to offer feature parity on those? The Static mode uses the Collector's loadbalancing exporter directly. Should we add it ot the list of components which we need to port over? For automatic logging I cannot find an equivalent Collector process so we might have to port our own. |
For automatic_logging: For load_balancing: yes, that needs to be added to the list; it was something I missed originally. |
Hello @rfratto, I tried So with thanks for the tool! |
@zeitlinger and I faced the same |
Hi @sylvainOL and @cyrille-leclerc, thank you for your feedback. I opened another issue for this: #4261 |
Hi @ptodev, thanks for the comment, I'll follow it :) |
@rfratto Any plans to add the https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/filterprocessor into Grafana Agent Flow so that we can filter spans from traces https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/processor/filterprocessor/README.md#filter-spans-from-traces ? Tracked on #4628 |
@kago-dk We're open to it, but this issue is just to track the initial set of OpenTelemetry Collector components which are already available in static mode; for anything net-new we'd want to track it in a separate issue. Would you mind opening a new issue requesting filter processor to be added to flow mode? |
This issue proposes a set of
otelcol
components to add first-class OpenTelemetry Collector support in Grafana Agent Flow.Adding first-class OpenTelemetry Collector support enables Grafana Agent to embrace Grafana's big tent philosophy, allowing the agent to support multiple vendors outside of the LGTM stack.
Proposal
We will create a set of OpenTelemetry Collector components across three namespaces:
otelcol.receiver
: A list of OpenTelemetry Collector receiversotelcol.processor
: A list of OpenTelemetry Collector processorsotelcol.exporter
: A list of OpenTelemetry Collector exportersA description of how to handle extensions is out of scope for this proposal. However, extensions for at least authentication will be included.
Pipeline construction
Grafana Agent Flow creates a pipeline by having each component reference other components where data will be sent. This contrasts OpenTelemetry Collector, where components are defined separately from the pipeline.
For consistency with other Flow components, the set of
otelcol
components will form a pipeline the same way: by having each component reference other components where data will be sent.Arguments
All
otelcol
Flow components which send data to a consumer will support the following arguments:output.traces
: A list of consumers where traces should be forwarded. Only available if the configured component supports traces.output.metrics
: A list of consumers where metrics should be forwarded. Only available if the configured component supports metrics.output.logs
: A list of consumers where logs should be forwarded. Only available if the configured component supports logs.Exported fields
otelcol
Flow components which act as consumers will support the following exported fields:input
: A consumer for telemetry data. Any telemetry type supported by the OTel component can be sent to this consumer.Note that there is only one exported field for input for all telemetry types. This simplifies the config, and there doesn't seem to be much value in separating the fields.
Example config
Flow component list
We will cherry-pick specific OpenTelemetry Collector components from both the otelcol and otelcol-contrib distributions to include in Grafana Agent Flow.
Our initial set of components is minimal, but will grow over time. While we should consider supporting most existing OTel components, we should initially avoid supporting any OTel components whose functionality is covered by an existing Flow component. This will be the case for
otelcol-contrib
receivers which collide with functionality ofprometheus.integration
Flow components.We will start with the following components:
otelcol
distribution components:otelcol.receiver.otlp
: Receives OTLP data over the network.otelcol.processor.batch
: Batches telemetry data before sending to another consumer.otelcol.processor.memory_limiter
: Drops telemetry data if memory usage is getting too high.otelcol.exporter.otlp
: Sends telemetry data via gRPC using OTLP.otelcol.exporter.otlphttp
: Sends telemetry data via HTTP using OTLP.otelcol-contrib
: distribution components:otelcol.receiver.jaeger
: Receives telemetry data from Jaeger applications.otelcol.receiver.kafka
: Receives telemetry data from Kafka.otelcol.receiver.opencensus
: Receives telemetry data from OpenCensus.otelcol.receiver.zipkin
: Receives telemetry data from Zipkin.otelcol.processor.attributes
: Processes span attributes.otelcol.processor.spanmetrics
: Creates metrics from spans.otelcol.processor.tail_sampling
: Performs tail sampling against tracing data.otelcol.exporter.jaeger
: Writes telemetry data to a Jaeger server.This list of components is based solely on the current exposed functionality of the tracing subsystem within Grafana Agent. As the intent is to embrace the big tent philosophy, we should continue to add more exporters for other vendors over time.
Additionally, we will create Grafana Agent-specific custom components:
otelcol.exporter.logging
: Logs telemetry data in-process.otelcol.processor.discovery
: Associates incoming spans with a Prometheus discovery target.otelcol.processor.servicegraph
: Generates a service graph from incoming spans.otelcol.receiver.prometheus
: Receives Prometheus metrics from aprometheus.scrape
Flow component.otelcol.exporter.prometheus
: Sends Prometheus metrics to aprometheus.remote_write
Flow component.The last two components,
otelcol.receiver.prometheus
andotelcol.exporter.prometheus
, enable interoperability between the Prometheus-specific and OpenTelemetry-specific components, allowing users to freely switch between both as needed.Implementation
Flow
otelcol.*
components should work by wrapping around upstream components from OpenTelemetry Collector, using River for configuration. We should not reimplement components that already exist, with the except for the Grafana Agent-specific custom components.An initial prototype for this was done in #1843. The prototype can serve as a base for the final implementation.
Tasks
This is the list of components to implement for the initial set of components:
otelcol.processor.spanprocessor
component #2612These components will be gradually introduced across a few releases.
The text was updated successfully, but these errors were encountered: