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

How to handle "Accessing resource attributes before async attributes settled" errors #4638

Open
1 of 2 tasks
sgohlke opened this issue Apr 16, 2024 · 1 comment · May be fixed by #4687
Open
1 of 2 tasks

How to handle "Accessing resource attributes before async attributes settled" errors #4638

sgohlke opened this issue Apr 16, 2024 · 1 comment · May be fixed by #4687

Comments

@sgohlke
Copy link

sgohlke commented Apr 16, 2024

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

In the logs of one of our applications I see the following error from time to time:
Accessing resource attributes before async attributes settled
I took a look into https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/opentelemetry-resources/src/Resource.ts#L98 which I assume is the code line that writes this error.

I'm not sure what to do with this error. Is is necessary to take an action or can this error be ignored? There isn't really much information about the origin of this error so I'm not sure how to find the root problem/how to debug this.

We are using the following packages:

  • "@opentelemetry/api": "1.8.0",
  • "@opentelemetry/exporter-trace-otlp-http": "0.50.0",
  • "@opentelemetry/instrumentation-http": "0.50.0",
  • "@opentelemetry/resources": "1.23.0",
  • "@opentelemetry/sdk-node": "0.50.0",
  • "@opentelemetry/semantic-conventions": "1.23.0",

In our instrumentation create a new SDK using the following resource:

resource: Resource.default().merge(
                new Resource({
                    [SEMRESATTRS_SERVICE_NAME]: 'our-service',
                })
            )

Maybe someone has an idea how to handle this.

@tmokmss
Copy link

tmokmss commented Apr 23, 2024

I'm also seeing this message. My otel config is here: https://gist.github.com/tmokmss/b6b0d639658161cd28519a65992866f9

packages versions are same as the OP.

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

Successfully merging a pull request may close this issue.

2 participants