Skip to content

feat: add datadog timing metrics#1236

Merged
sky-mart merged 1 commit into
mainfrom
vlad/ddog-timing-metrics
May 27, 2026
Merged

feat: add datadog timing metrics#1236
sky-mart merged 1 commit into
mainfrom
vlad/ddog-timing-metrics

Conversation

@sky-mart
Copy link
Copy Markdown
Contributor

It is required to use the datadog crate in orb-core

@sky-mart sky-mart requested a review from a team as a code owner May 27, 2026 13:34
@github-actions
Copy link
Copy Markdown

Found one concrete issue:

  • orb-dogd/src/dd.rs:218: timing uses self.tx.send(metric), unlike the existing metric methods which go through self.emit(metric) and use try_send. Since the channel is bounded and the worker waits for the Datadog socket before draining, the 513th timing metric can block indefinitely when the agent/socket is unavailable. This can also block async runtime threads if timing is emitted from async code. Use self.emit(metric) here so timing preserves the same nonblocking backpressure behavior as count, gauge, hist, and dist.

@sky-mart sky-mart force-pushed the vlad/ddog-timing-metrics branch from cee2d15 to 056ff22 Compare May 27, 2026 14:14
@github-actions
Copy link
Copy Markdown

Finding

  • orb-dogd/src/dd.rs:218: timing uses blocking self.tx.send(metric) while every other metric path uses self.emit(metric), which calls try_send. This can block callers when the bounded channel fills. That is especially risky because the worker does not drain the channel until it has connected to the Datadog socket, so if /run/datadog/dsd.socket is absent or slow to appear, timing calls can hang after the buffer fills. Please route this through self.emit(metric) like the other methods.

@sky-mart sky-mart enabled auto-merge (squash) May 27, 2026 14:19
@sky-mart sky-mart merged commit c3b8c1d into main May 27, 2026
26 checks passed
@sky-mart sky-mart deleted the vlad/ddog-timing-metrics branch May 27, 2026 14:21
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

Successfully merging this pull request may close these issues.

2 participants