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

Define SpanKind #29

Open
oxcafedead opened this issue Apr 6, 2023 · 1 comment
Open

Define SpanKind #29

oxcafedead opened this issue Apr 6, 2023 · 1 comment

Comments

@oxcafedead
Copy link

oxcafedead commented Apr 6, 2023

Hi,

I have a question regarding SpanKind which is set to INTERNAL now.

As per docs:

INTERNAL span kind should be used to instrument some internal functions/operations within application process.
Workers are technically a remote service, so I believe they should produce SERVER spans.

Overall, such inconsistency results in Elastic APM incorrectly "drawing" such spans on a timeline, because the timestamps of worker traces differ from client/backend traces, since they are sent in different times.

The current workaround for me looks like this:

const oTelSdk = new WorkersSDK(request, ctx, env, {
    service: "myWorker",
...
});
oTelSdk.span.kind = SpanKind.SERVER; // ugly hack :)

Is there possibility to change this default span kind or give possibility to override it on API level?

@RichiCoder1
Copy link
Owner

Yah, I think it'd be reasonable to make this configurable. Workers can behave a lot of different ways. I'll see if I can expose this as an option for now, though that may change in the future.

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

2 participants