Closed cvrajeesh closed 3 years ago
Thanks for bringing this to our attention @cvrajeesh! 👍
I think using routerPath
is the way to go. But we'll need to update opts.formatSpanName
to receive the entire Fastify request object.
Technically this will be a breaking change, although it looks like most fields in request.raw
exist top-level in request
.
Would you like to open a PR to implement this?
sure @HW13, I'll try to find some time this week and submit a PR.
Technically this will be a breaking change, although it looks like most fields in request.raw exist top-level in request.
for TypeScript users this will be a breaking change as the formatSpanName
signature is going to change
https://github.com/autotelic/fastify-opentelemetry/blob/dd3a6b64f45da36288b331e09f1f681f3160e842/fastify-opentelemetry.d.ts#L27
otel spec recommending to use low cardinality span names
Do you think it's a good choice to
routerPath
from fastify request instead of raw request URL by default when generating span name? https://github.com/autotelic/fastify-opentelemetry/blob/dd3a6b64f45da36288b331e09f1f681f3160e842/index.js#L13-L15