fix(telemetry): one meaning for discord.channel.id across a trace #349

Merged
coilyco-ops merged 3 commits from fix/one-meaning-for-channel-id into main 2026-08-13 10:49:05 +00:00
Member

PR 342 established that a thread reported as its own channel hides the turn
from a query for the channel it hangs under, and moved the turn span to report
the parent under discord.channel.id with the thread on its own key. The two
boundary spans kept passing message.ChannelID, so for a thread turn one trace
carried that key with two different values.

Both operator queries were then quietly partial. Querying the parent matched
community.turn and neither boundary span; querying the thread matched the two
boundary spans and not community.turn. Neither result looks partial.

The split moves from a method on the turn to discordLocationFor, and
discordMessageSpanAttributes takes that location rather than loose strings.
Every span now reads one resolved location, and a caller cannot reintroduce the
disagreement by passing a channel string, because there is no longer a
parameter to pass it to.

Resolution is unchanged: cached gateway state only, no Discord API call, and an
unresolved channel still reports itself and contributes no thread.

TestDiscordMessageSpanAttributesUseStringIdentifiers compared a subset, so it
could not have failed on an identifier added to that helper that nobody meant
to export. It compares the whole map now.

closes #348

Co-authored-by: Kai Siren coilysiren@gmail.com
Co-authored-by: Claude noreply@anthropic.com

PR 342 established that a thread reported as its own channel hides the turn from a query for the channel it hangs under, and moved the turn span to report the parent under discord.channel.id with the thread on its own key. The two boundary spans kept passing message.ChannelID, so for a thread turn one trace carried that key with two different values. Both operator queries were then quietly partial. Querying the parent matched community.turn and neither boundary span; querying the thread matched the two boundary spans and not community.turn. Neither result looks partial. The split moves from a method on the turn to discordLocationFor, and discordMessageSpanAttributes takes that location rather than loose strings. Every span now reads one resolved location, and a caller cannot reintroduce the disagreement by passing a channel string, because there is no longer a parameter to pass it to. Resolution is unchanged: cached gateway state only, no Discord API call, and an unresolved channel still reports itself and contributes no thread. TestDiscordMessageSpanAttributesUseStringIdentifiers compared a subset, so it could not have failed on an identifier added to that helper that nobody meant to export. It compares the whole map now. closes #348 Co-authored-by: Kai Siren <coilysiren@gmail.com> Co-authored-by: Claude <noreply@anthropic.com>
fix(telemetry): one meaning for discord.channel.id across a trace
All checks were successful
ci / test (pull_request) Successful in 30s
ci / publish-echo-image (pull_request) Has been skipped
ci / publish-observed (pull_request) Has been skipped
ci / image-build (pull_request) Successful in 19s
fa06d56a4d
PR 342 established that a thread reported as its own channel hides the turn
from a query for the channel it hangs under, and moved the turn span to report
the parent under discord.channel.id with the thread on its own key. The two
boundary spans kept passing message.ChannelID, so for a thread turn one trace
carried that key with two different values.

Both operator queries were then quietly partial. Querying the parent matched
community.turn and neither boundary span; querying the thread matched the two
boundary spans and not community.turn. Neither result looks partial.

The split moves from a method on the turn to discordLocationFor, and
discordMessageSpanAttributes takes that location rather than loose strings.
Every span now reads one resolved location, and a caller cannot reintroduce the
disagreement by passing a channel string, because there is no longer a
parameter to pass it to.

Resolution is unchanged: cached gateway state only, no Discord API call, and an
unresolved channel still reports itself and contributes no thread.

TestDiscordMessageSpanAttributesUseStringIdentifiers compared a subset, so it
could not have failed on an identifier added to that helper that nobody meant
to export. It compares the whole map now.

closes #348

Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Merge branch 'main' into fix/one-meaning-for-channel-id
All checks were successful
ci / test (pull_request) Successful in 32s
ci / publish-echo-image (pull_request) Has been skipped
ci / publish-observed (pull_request) Has been skipped
ci / image-build (pull_request) Successful in 20s
aace6cec6a
Merge branch 'main' into fix/one-meaning-for-channel-id
All checks were successful
ci / test (pull_request) Successful in 30s
ci / publish-echo-image (pull_request) Has been skipped
ci / publish-observed (pull_request) Has been skipped
ci / image-build (pull_request) Successful in 19s
929c11666a
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-gaming/sirens-echo!349
No description provided.