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

chore: add otel headers config to support axiom #724

Merged
merged 3 commits into from
Aug 27, 2024

Conversation

lrnt
Copy link
Contributor

@lrnt lrnt commented Aug 22, 2024

🖤

What does this PR do?

Add the ability to set authentication headers for the traces and logs OpenTelemetry endpoints.

Context: Axiom works out of the box with the otel package from uninbox but requires 2 additional headers to be set. See Axiom documentation here.

How to test:

  1. Create a free Axiom account
  2. Create a dataset in Axiom
  3. Create an API token in Axiom
  4. Change or add the following lines in .env.local. Be sure to set your API token in the Authorization header and your dataset name in the X-Axiom-Dataset header.
OTEL_ENABLED=true
OTEL_EXPORTER_TRACES_ENDPOINT="https://api.axiom.co/v1/traces"
OTEL_EXPORTER_TRACES_HEADERS="{"Authorization": "Bearer ***AXIOM-API-KEY***", "X-Axiom-Dataset": "***AXIOM-DATASET***"}"
OTEL_EXPORTER_LOGS_ENDPOINT="https://api.axiom.co/v1/logs"
OTEL_EXPORTER_LOGS_HEADERS="{"Authorization": "Bearer ***AXIOM-API-KEY***", "X-Axiom-Dataset": "***AXIOM-DATASET***"}"

Screenshot from a trace in Axiom:
image

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Chore (refactoring code, technical debt, workflow improvements)
  • Enhancement (small improvements)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

Required

  • Read Contributing Guide
  • Self-reviewed my own code
  • Tested my code in a local environment
  • Commented on my code in hard-to-understand areas
  • Checked for warnings, there are none
  • Removed all console.logs
  • Merged the latest changes from main onto my branch with git pull origin main
  • My changes don't cause any responsiveness issues

Appreciated

  • If a UI change was made: Added a screen recording or screenshots to this PR
  • Updated the UnInbox Docs if changes were necessary

@lrnt lrnt requested a review from McPizza0 as a code owner August 22, 2024 12:50
@CLAassistant
Copy link

CLAassistant commented Aug 22, 2024

CLA assistant check
All committers have signed the CLA.

@McPizza0
Copy link
Member

McPizza0 commented Aug 22, 2024

CleanShot 2024-08-22 at 14 55 35@2x

@lrnt

@benjaminshafii benjaminshafii merged commit 038d143 into un:main Aug 27, 2024
3 checks passed
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.

4 participants