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

[sdk-node] automatically configure exporters based on enviornment variables #3871

Open
jakobjoachim opened this issue Jun 7, 2023 · 8 comments
Labels
never-stale pkg:sdk-node triage:accepted This feature has been accepted type:feature-tracking A feature with sub-issues that need to be addressed

Comments

@jakobjoachim
Copy link

Issue I'm facing

The open-telemetry spec defines environment variables that specify which metric / logs / trace reader should be used.
There is currently no way of automatically configuring the instrumentation using these variables.
This is especially useful when using the Kubernetes auto instrumentation.

Describe the solution you'd like

A function that reads the env vars and returns the corresponding metric reader. Maybe getMetricReaderFromEnv().
Same thing for logs and traces.
Similar to how we have a getNodeAutoInstrumentations() function already.

Additional context

This solution was also discussed in a pr in the auto instrumentation project. see: here

@pichlermarc
Copy link
Member

pichlermarc commented Jun 14, 2023

Hi, the trace part of this already exists (not specifying any trace exporter or span exporter in code, NodeSDK will set up an exporter according to the specification (using the OTEL_EXPORTER_TRACE env var.)

To add support for env var configuration for logs, we'll first need to tackle #3826

I'm marking this up-for-grabs as metrics is already in a state where this could be implemented 🙂

@pichlermarc pichlermarc added the up-for-grabs Good for taking. Extra help will be provided by maintainers label Jun 14, 2023
@psk001
Copy link
Contributor

psk001 commented Jul 9, 2023

As #3826 is solved by pr #3969 , can I go ahead and implement this?

@pichlermarc
Copy link
Member

@psk001 sure, go ahead once #3826 is merged. 🙂 Ideally, this function would be internal to the @opentelemetry/sdk-node module, so that it is used as the default behavior if no logging SDK is specified. Currently, the trace setup is way different, so there's not really a precedence impelemtnation to work on.

@psk001
Copy link
Contributor

psk001 commented Jul 10, 2023

Great, waiting for #3969 to get merged 🙂

@github-actions
Copy link

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 14 days.

@pichlermarc
Copy link
Member

@psk001 are you still working on the remaining parts of this issue? Otherwise, I'll unassign to indicate that others can pick this up. 🙂

Copy link

github-actions bot commented Jan 8, 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 14 days.

@pichlermarc
Copy link
Member

pichlermarc commented Mar 18, 2024

@pichlermarc pichlermarc added triage:accepted This feature has been accepted type:feature-tracking A feature with sub-issues that need to be addressed and removed up-for-grabs Good for taking. Extra help will be provided by maintainers feature-request labels Mar 18, 2024
@pichlermarc pichlermarc changed the title function to create the correct metric / logs / trace reader from env vars [sdk-node] automatically configure exporters based on enviornment variables Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
never-stale pkg:sdk-node triage:accepted This feature has been accepted type:feature-tracking A feature with sub-issues that need to be addressed
Projects
None yet
Development

No branches or pull requests

3 participants