Skip to content

Instrumentation scope - move to builder pattern? #1527

@cijothomas

Description

@cijothomas

#1021 added supported for Attributes to instrumentation scope, which already had version, schema_url.
This started with just name and evolved to add more and more (because spec added them). #1021 (comment) called out the need for potentially making this to a builder pattern, so as to protect us from breaking change in the future, if there are more stuff added to scope.

let tracer = TracerProvider.tracer("tracer_name"); // common case. this is still a good idea to keep to keep things simple for majority.
let tracer = TracerProvider::tracer_builder("tracer_name") // advanced scenario.
    .with_version("1.0.0")
    .with_attributes([kv])
    .build();

Opening an issue to explore if moving to builder pattern makes sense here (all 3 signals), and if yes, implement the actual change.
Also, there could be other places where such changes are required to make things cleaner/more idiomatic and also protect from future breaking changes.

Metadata

Metadata

Labels

A-commonArea:common issues that not related to specific pillarA-logArea: Issues related to logsA-metricsArea: issues related to metricsA-traceArea: issues related to tracinghelp wantedGood for taking. Extra help will be provided by maintainers/approvers

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions