Skip to content

Add support for sending events#11

Merged
ollien merged 4 commits intomasterfrom
events-over-uds
Mar 12, 2026
Merged

Add support for sending events#11
ollien merged 4 commits intomasterfrom
events-over-uds

Conversation

@ollien
Copy link

@ollien ollien commented Mar 12, 2026

Instruments can send events to Datadog, but relied on the fact that Statix was using a UDP endpoint. This breaks down when Unix Domain Sockets are used, so this PR moves that emission into Statix itself. This code is mostly a port of the existing send_event function in Instruments.

This does add a function to the Statix behavior, but the use macro provides a default implementation, so I don't consider this a breaking change.

Quick screenshot showing the events themselves are picked up by Datadog:
image

Copy link

@sanchda sanchda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agree; pushing dogstatsd conformance into the statix layer feels correct

Comment on lines +22 to +29
"_e{",
Integer.to_string(byte_size(title_bin)),
",",
Integer.to_string(byte_size(text_bin)),
"}:",
title_bin,
"|",
text_bin
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verifying that this is correct according to the dogstatsd event specification. We could support more here, but I don't think we have much need for the additional fields at the application layer yet.

@ollien ollien merged commit 06bb011 into master Mar 12, 2026
0 of 4 checks passed
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