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

Consider detecting resources during initialization #1188

Closed
1 of 2 tasks
mwear opened this issue Jun 11, 2020 · 2 comments
Closed
1 of 2 tasks

Consider detecting resources during initialization #1188

mwear opened this issue Jun 11, 2020 · 2 comments

Comments

@mwear
Copy link
Member

mwear commented Jun 11, 2020

  • This only affects the JavaScript OpenTelemetry library
  • This may affect other libraries, but I would like to get opinions here first

The SDK currently has resource auto-detection, but the detection must be user initiated. For example:

import { NodeTracerProvider } from '@opentelemetry/node`;
import { MeterProvider } from '@opentelemetry/metrics`;
import { detectResources } from '@opentelemetry/resources';

const resource = detectResources();
const tracerProvider = new NodeTracerProvider({ resource });
const meterProvider = new MeterProvider({ resource });
...

There are some detectors that make network calls to determine if they are running in a cloud provider (GCP, or AWS) to gather metadata, which introduces some latency. Ideally, resources will only be detected once and passed along as arguments where needed.

Is there a reasonable way that we can detect resources during initialization, without putting the responsibility on the user? Can we do so in a way that minimizes overhead, and possibly offer opt-out mechanisms for those who do not want or need this functionality?

@mwear
Copy link
Member Author

mwear commented Jun 11, 2020

It looks like these concerns are largely being addressed in: #1187

@mwear
Copy link
Member Author

mwear commented Oct 12, 2020

This is already being done and improvements are being discussed in #1533. Closing this issue.

@mwear mwear closed this as completed Oct 12, 2020
pichlermarc pushed a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this issue Dec 15, 2023
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

No branches or pull requests

1 participant