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

NodeSDK should take a serviceName prop #2799

Closed
naseemkullah opened this issue Feb 20, 2022 · 4 comments · Fixed by #2867
Closed

NodeSDK should take a serviceName prop #2799

naseemkullah opened this issue Feb 20, 2022 · 4 comments · Fixed by #2867
Assignees
Labels
enhancement New feature or request

Comments

@naseemkullah
Copy link
Member

naseemkullah commented Feb 20, 2022

Add a convenience prop because

  resource: new Resource({
    [SemanticResourceAttributes.SERVICE_NAME]: 'my-service-name',
  }),

is imho verbose for this option which is always needed, also it requires explicitly installing '@opentelemetry/resources' and '@opentelemetry/semantic-conventions'

Would be added here (among other places):

export interface NodeSDKConfiguration {
autoDetectResources: boolean;
contextManager: ContextManager;
defaultAttributes: SpanAttributes;
textMapPropagator: TextMapPropagator;
metricProcessor: Processor;
metricExporter: MetricExporter;
metricInterval: number;
instrumentations: InstrumentationOption[];
resource: Resource;
sampler: Sampler;
spanProcessor: SpanProcessor;
traceExporter: SpanExporter;
spanLimits: SpanLimits;
}

@naseemkullah naseemkullah added Discussion Issue or PR that needs/is extended discussion. onHold labels Feb 21, 2022
@naseemkullah
Copy link
Member Author

Thoughts @open-telemetry/javascript-maintainers ?
Putting on hold until there is agreement to move forward on this, will close if not

@naseemkullah naseemkullah self-assigned this Feb 21, 2022
@dyladan
Copy link
Member

dyladan commented Feb 24, 2022

I completely agree. The current API to create resources in the NodeSDK module is very annoying to use, and service.name is important enough to have its own special handling.

@vmarchaud
Copy link
Member

I agree too, is there any other required field or maybe some that are not required but strongly suggested to set that we could offer as top level config ?

@naseemkullah
Copy link
Member Author

naseemkullah commented Feb 26, 2022

I guess whatever is here https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/README.md#attributes-with-special-handling ? Which is just service.name today

@naseemkullah naseemkullah added enhancement New feature or request and removed Discussion Issue or PR that needs/is extended discussion. onHold labels May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants