Skip to content
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 extension components #2353

Closed
5 tasks done
rfratto opened this issue Oct 12, 2022 · 2 comments
Closed
5 tasks done

Flow: add OpenTelemetry Collector extension components #2353

rfratto opened this issue Oct 12, 2022 · 2 comments
Labels
flow Related to Grafana Agent Flow frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. proposal Proposal or RFC
Milestone

Comments

@rfratto
Copy link
Member

rfratto commented Oct 12, 2022

This issue extends #2213 and proposes a set of otelcol components which wrap around OpenTelemetry Collector extensions.

Background

#2343 added the otelcol.exporter.otlp component, wrapping around the OpenTelemetry Collector otlp exporter. The upstream exporter can be configured with a reference to an ID of an extension component to use for authentication. The instance of the component is then retrieved from the component.Host instance.

Authentication was descoped from the initial PR while an approach to handle extensions was undetermined.

There were two approaches that could be taken:

  1. Bake in support for authentication into components, similar to what is done for the prometheus.remote_write component.
  2. Introduce new components which handle authentication extensions and allow the user to wire them together.

To remain close to how upstream handles it, this issue proposes the latter approach.

Proposal

We will create a set of OpenTelemetry Collector extension components in an otelcol.auth namespace. The namespace will be composed of OpenTelemetry Collector extensions which are intended for authentication and implement one or more of the interfaces from the OpenTelemetry Collector configauth package.

Other extensions are considered out of scope for this proposal. Storage extensions are likely to be included eventually, but are out of scope due to being experimental. Extensions that aren't authentication extensions or storage extensions may be added in the future, but would likely belong in a dedicated namespace rather than being scoped to otelcol.

Exported fields

otelcol.auth namespace will support the following exported fields:

  • handler: The raw OpenTelemetry Collector extension instance which other components can use.

Example config

otelcol.exporter.otlp "default" {
  // Configure this component to use otelcol.auth.basic.default 
  // for authentication. 
  auth = otelcol.auth.basic.default.handler 

  ...
}

otelcol.auth.basic "default" {
  username = ...
  password = ... 
}

Flow component list

We will cherry-pick specific OpenTelemetry Collector extensions from both the otelcol and otelcol-contrib distributions to include in Grafana Agent Flow. Our initial set of extensions is minimal, but will grow over time.

We will start with the following extensions:

otelcol-contrib distribution components:

  • otelcol.auth.basic: Performs Basic authentication (from basicauthextension).
  • otelcol.auth.bearer: Performs Bearer token authentication (from bearertokenauthextension).
  • otelcol.auth.headers: Adds custom headers for authentication (from headerssetterextension).
  • otelcol.auth.oauth2: Performs OAuth2 authentication (from oauth2clientauthextension).
  • otelcol.auth.sigv4: Performs SigV4 authentication (from sigv4authextension).

Tasks

This is the list of components to implement for the initial set of extensions:

@rfratto rfratto added this to the v0.30.0 milestone Oct 12, 2022
@rfratto rfratto added the proposal Proposal or RFC label Oct 12, 2022
@fawadasaurus
Copy link

I can't wait for headerssetterextension support. I switched to Otel collector because of it. It will be nice to have the choice to switch back to Grafana Agent once that is available.

@rfratto rfratto moved this from Todo to In Progress in Grafana Agent (Public) Nov 3, 2022
@rfratto rfratto modified the milestones: v0.30.0, v0.31.0, v0.32.0 Jan 3, 2023
@rfratto rfratto added flow Related to Grafana Agent Flow flow/feature-parity labels Jan 19, 2023
@rfratto rfratto modified the milestones: v0.32.0, v0.33.0 Feb 28, 2023
@rfratto
Copy link
Member Author

rfratto commented Apr 26, 2023

This is completed; all tracking tasks are done.

@rfratto rfratto closed this as completed Apr 26, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Grafana Agent (Public) Apr 26, 2023
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Feb 21, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
flow Related to Grafana Agent Flow frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. proposal Proposal or RFC
Projects
No open projects
Development

No branches or pull requests

2 participants