Repository navigation
chore(otlp-exporter): corrected span name for db - #2850
aryamohanan wants to merge 2 commits into
Conversation
|
|
||
| [INSTRUMENTATION_TYPES.PG]: { | ||
| spanName: data => `pg.${data.stmt?.split(/\s+/)[0]?.toUpperCase()}`, | ||
| spanName: data => getSqlOperation(data.stmt) || data.db || 'postgresql', |
There was a problem hiding this comment.
In 99% of regular cases, getSqlOperation(data.stmt) evaluates to the SQL verb (e.g. SELECT, INSERT).
The fallback || data.db || provides defensive safety against edge cases, ensuring compliance with the OpenTelemetry specification so the span name is never undefined.
abhilash-sivan
left a comment
There was a problem hiding this comment.
I agree with the OTEL naming convention.
Don't remember why we kept custom naming with library names.
kirrg001
left a comment
There was a problem hiding this comment.
We agreed a few weeks ago to go with the version we use in main, because the docs on Otel were not clear and the majority of references use this notation.
Closing on favour of this. |
The current span name mapping for db is not align with otel spec.
reference: https://opentelemetry.io/docs/specs/semconv/db/database-spans/#name