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

[Resource] remove class and namespace export #5358

Open
Tracked by #5350
dyladan opened this issue Jan 22, 2025 · 1 comment · May be fixed by #5421
Open
Tracked by #5350

[Resource] remove class and namespace export #5358

dyladan opened this issue Jan 22, 2025 · 1 comment · May be fixed by #5421
Assignees
Labels
type:feature A feature with no sub-issues to address

Comments

@dyladan
Copy link
Member

dyladan commented Jan 22, 2025

Remove the Resource class from the exports of @opentelemetry/resource making it purely an implementation detail. This will include exporting top-level functions and types for interacting with resource objects.

@dyladan dyladan added this to the OpenTelemetry SDK 2.0 milestone Jan 22, 2025
@pichlermarc pichlermarc added the type:feature A feature with no sub-issues to address label Jan 23, 2025
@trentm
Copy link
Contributor

trentm commented Jan 23, 2025

The intent here is that this usage: https://opentelemetry.io/docs/languages/js/resources/#adding-resources-in-code
would change to the user passing in a plain old JS object for the resource attributes? E.g.:

const sdk = new opentelemetry.NodeSDK({
  resource: {
    [ ATTR_SERVICE_NAME ]: "yourServiceName",
    [ ATTR_SERVICE_VERSION ]: "1.0",
  }
});

?

Or, perhaps something that includes "attributes" to prepare for future entity-related things?

const sdk = new opentelemetry.NodeSDK({
  resourceAttributes: {
    [ ATTR_SERVICE_NAME ]: "yourServiceName",
    [ ATTR_SERVICE_VERSION ]: "1.0",
  }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature A feature with no sub-issues to address
Projects
None yet
3 participants