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

Fix Basic auth key encoding #446

Merged
merged 2 commits into from
Nov 16, 2023
Merged

Fix Basic auth key encoding #446

merged 2 commits into from
Nov 16, 2023

Conversation

mariomac
Copy link
Contributor

Fixes: #442

We weren't closing the encoder and sometimes we missed some bytes in the API key 😱

Copy link
Contributor

@grcevski grcevski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@codecov-commenter
Copy link

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (7ba3c5f) 78.32% compared to head (39da7d5) 65.96%.
Report is 1 commits behind head on main.

Files Patch % Lines
pkg/internal/export/otel/grafana.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #446       +/-   ##
===========================================
- Coverage   78.32%   65.96%   -12.37%     
===========================================
  Files          61       58        -3     
  Lines        5039     4933      -106     
===========================================
- Hits         3947     3254      -693     
- Misses        882     1412      +530     
- Partials      210      267       +57     
Flag Coverage Δ
integration-test 65.96% <0.00%> (+0.12%) ⬆️
unittests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mariomac mariomac merged commit afc126f into grafana:main Nov 16, 2023
3 checks passed
@mariomac mariomac deleted the fix-auth branch November 16, 2023 15:39
@NiranjanHD
Copy link

@mariomac: I am looking at 401 Unauthorized errors in the latest release code [Beyla v1.2.1], am I missing anything?

ERROR: 2024/02/18 05:06:10 failed to upload metrics: failed to send metrics to https://otlp-gateway-prod-ap-south-1.grafana.net/otlp/v1/metrics: 401 Unauthorized

Grafana Beyla version used https://github.com/grafana/beyla/releases/download/v1.2.1/beyla-linux-amd64-v1.2.1.tar.gz

Reproducing error: followed steps mentioned in this link Grafana Beyla to upload OTEL traces to Grafana cloud which is static single instance agent basis.

@mariomac
Copy link
Contributor Author

@NiranjanHD please check that, in the Grafana cloud API key, you are copying the raw API key and not the generated OTEL Headers ("Authorization: Basic ....").

As an alternative, try using the OTEL_EXPORTER_OTLP_HEADERS, as stated in the steps here:
https://grafana.com/docs/beyla/latest/quickstart/golang/#3-optional-get-grafana-cloud-credentials
https://grafana.com/docs/beyla/latest/quickstart/golang/#4-run-beyla-with-minimal-configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OTEL Enpdoint submission: Beyla does not work with Access Policies key
4 participants