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

feat: Dynamic Headers support for OTLPExporters #5118

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

bozzelliandrea
Copy link

Which problem is this PR solving?

Still working progress to verify all use cases, tested locally with HTTP for Authentication header use case.

This PR add the dynamic header support where you can set a function (sync or async) and every signal sent through the exporter will execute and use the function result as http header value.

Fixes #2903

Usage example: demo-instrumentation

Short description of the changes

  • Types now support string and Function for headers
  • Header builder execute function param, resolve if needed the promise, and set the value

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • 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

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • ✅ Created a demo app (linked on the description), deps link to fork with new feature, and tested HTTP exporter with Auth standard header.

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added (TODO)
  • Documentation has been updated (TODO)

@bozzelliandrea bozzelliandrea requested a review from a team as a code owner November 6, 2024 22:37
Copy link

linux-foundation-easycla bot commented Nov 6, 2024

CLA Not Signed

@bozzelliandrea bozzelliandrea changed the title feat: dynamic header for OTLPTraceExporter feat: dynamic header for OTLPExporters Nov 6, 2024
@bozzelliandrea bozzelliandrea changed the title feat: dynamic header for OTLPExporters feat: Dynamic Headers support for OTLPExporters Nov 6, 2024
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.

Dynamic Header for OTLPTraceExporter - Package @opentelemetry/exporter-trace-otlp-http
1 participant