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

Add basicauth extension to collectors #1930

Open
cedricziel opened this issue Mar 25, 2023 · 21 comments
Open

Add basicauth extension to collectors #1930

cedricziel opened this issue Mar 25, 2023 · 21 comments
Assignees

Comments

@cedricziel
Copy link
Contributor

Is your feature request related to a problem? Please describe.
As a user, I want to use credentials in a transparent way, without having to transform them first. As such, basic auth credentials currently have to be base64 encoded and passed as raw header array.

receivers:
  otlp:
exporters:
  otlphttp:
    endpoint: ${OTLPHTTP_ENDPOINT}
    headers:
      Authorization: "Basic base64encodedcreds="
processors:
  batch:
extensions:
  health_check:
service:
  extensions: [health_check]
  pipelines:
    traces:
      receivers: [otlp]
      processors: []
      exporters: [otlphttp]

Describe the solution you'd like
The otelcol-contrib offers a basicauth extension so configuration and secret values become more readable and less opaque.

The following example uses the extension and allows users to work with explicit values instead of opaque strings:

receivers:
  otlp:
exporters:
  otlphttp:
    auth:
      authenticator: basicauth
    endpoint: ${OTLPHTTP_ENDPOINT}
processors:
  batch:
extensions:
  health_check:
  basicauth:
    client_auth:
      username: ${USERNAME}
      password: ${PASSWORD}
service:
  extensions: [health_check, basicauth]
  pipelines:
    traces:
      receivers: [otlp]
      processors: []
      exporters: [otlphttp]

I thought this was a straight forward change so I added the implementation in #1923 which is ready to bring in. The extension itself is very lean and doesnt add a lot of overhead in the binary or the startup.

@jonbretman
Copy link

jonbretman commented Apr 11, 2023

Would also love to see this land 🙌 Interestingly came across this issue while trying to set up Tempo and following Grafana's docs.

@eriweb
Copy link

eriweb commented Apr 25, 2023

Plus one from here as well, also we'd like to see oauth2client extension to allow more sophisticated 3rd parties

@github-actions
Copy link
Contributor

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale label Jun 25, 2023
@github-actions
Copy link
Contributor

This issue was closed because it has been marked as stale for 30 days with no activity.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 30, 2023
@cedricziel
Copy link
Contributor Author

Bump?

@mhausenblas mhausenblas removed the stale label Jul 31, 2023
@mhausenblas mhausenblas reopened this Jul 31, 2023
@johnjunjiezhao
Copy link

Updates on it? I really want this extension!

@mhausenblas
Copy link
Member

Thanks for reaching out @johnjunjiezhao and could you share your use case please?

@johnjunjiezhao
Copy link

Hi @mhausenblas , I want the adot sidecar on my ecs cluster also sends traces to grafana cloud. According their guide, I need this extension. https://grafana.com/docs/opentelemetry/collector/send-otlp-to-grafana-cloud-databases/ I think it will be convenient if adot can have it. Thanks!

@wjoel
Copy link

wjoel commented Sep 27, 2023

@johnjunjiezhao if you can use Grafana's OTLP gateway (currently only available in some regions) it's possible to send data to Grafana Cloud with a config similar to this:

exporters:
  otlphttp:
    endpoint: "https://otlp-gateway-prod-eu-west-2.grafana.net/otlp"
    headers: {"Authorization": "Basic the-base64-encoded-value"}

service:
  pipelines:
    traces:
      receivers: [otlp]
      processors: [batch/traces]
      exporters: [otlphttp]
    metrics:
      receivers: [otlp]
      processors: [batch/metrics]
      exporters: [otlphttp]
    logs:
      receivers: [otlp]
      processors: [batch/logs]
      exporters: [otlphttp]

where the-base64-encoded-value is the output from echo -n $GRAFANA_INSTANCE_ID:$TOKEN | base64 -w 0.

I suspect it's possible to set the basic auth header manually like this also for https://grafana.com/docs/opentelemetry/collector/send-otlp-to-grafana-cloud-databases/, but I haven't tried it, as I'm able to use Grafana's OTLP gateway.

Still, +1 for requesting the extension, it would make using basic auth easier and clearer.

@johnjunjiezhao
Copy link

Thanks @wjoel , I am using it. And I do think this extension is useful to make auth cleaner

Copy link
Contributor

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale label Nov 26, 2023
@cedricziel
Copy link
Contributor Author

Keep open

@github-actions github-actions bot removed the stale label Dec 3, 2023
Copy link
Contributor

github-actions bot commented Feb 4, 2024

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale label Feb 4, 2024
@luxaritas
Copy link

Keep open

@github-actions github-actions bot removed the stale label Feb 11, 2024
@akhileshreddy98
Copy link

I want to configure auth using this extension b/w Auto instrumentation resource and an Otel collector. Can someone please help me out?

Copy link
Contributor

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale label Apr 21, 2024
@luxaritas
Copy link

Not stale

@github-actions github-actions bot removed the stale label Apr 28, 2024
Copy link
Contributor

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@NinjaPerson24119
Copy link

Not stale

Copy link
Contributor

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the stale label Sep 15, 2024
@cedricziel
Copy link
Contributor Author

Not stale.

@mhausenblas any Feedback for us here?

@github-actions github-actions bot removed the stale label Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

9 participants