Skip to content

fix(otel): client spans identify their callee (db.namespace, server.address) - #55

Merged
ETWOYA merged 1 commit into
mainfrom
fix/span-attributes-db-namespace-server-address
Oct 13, 2026
Merged

ETWOYA merged 1 commit into
mainfrom
fix/span-attributes-db-namespace-server-address

Conversation

@dankoverride

Copy link
Copy Markdown
Collaborator

Why

Some client spans did not say what they called, so a backend could only key the dependency on the bare system or peer name:

  • Three postgresql spans had no db.namespace (INSERT orders in the failed-payment flow, SELECT pending_notifications, CheckAvailability batch). They keyed as plain postgresql and drew a node beside postgresql-orders_db and the others. db.namespace is Conditionally Required "if available", and the generator always knows the database.
  • Five SendGrid and Stripe client calls had only service.peer.name, no server.address. server.address is Required on an HTTP client span. A bare single-label name such as sendgrid cannot be told apart from an internal service, so a backend that never saw it answer reported it as missing.

What

  • db.namespace (orders_db, inventory_db) on the three postgresql spans.
  • server.address and server.port (api.sendgrid.com / api.stripe.com, 443) on the five calls, matching the flows that already set them; http.request.method on the one SendEmail call that lacked it.
  • TestClientSpansIdentifyTheirCallee: fails on any postgresql client span without db.namespace, or any client span with service.peer.name but no server.address and server.port. It fails with 13 violations on main and passes here.

Not changed: consumer spans that carry service.peer.name (they consume a queue, they do not call the peer), and redis or the search and vector stores, which run as single instances and do not split.

Test

go vet ./... and go test ./... pass.

🤖 Generated with Claude Code

…ddress)

Three postgresql client spans carried no db.namespace, so a backend keyed them
as plain "postgresql" and drew a node beside postgresql-orders_db and the rest.
Five SendGrid and Stripe client calls named the peer only by service.peer.name,
with no server.address; a bare single-label name cannot be told apart from an
internal service, so a backend that never saw it answer read it as missing.

Adds db.namespace (orders_db, inventory_db) and server.address/server.port
(api.sendgrid.com, api.stripe.com, 443) to those spans, matching the flows that
already set them, and a conformance test that fails on any postgresql client
span without db.namespace or any peer-naming client span without
server.address and server.port.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dankoverride
dankoverride requested a review from ETWOYA as a code owner October 13, 2026 03:23
@ETWOYA
ETWOYA merged commit 700738f into main Oct 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants