ops: Emit opentelemetry traces via Unix Domain Socket#9078
Merged
Conversation
72636e1 to
2233d09
Compare
Member
Author
|
I had a test for this too, but |
b5b8b4d to
6e52e5f
Compare
Add a new tracing backend that sends completed spans as atomic datagrams over a Unix Domain Socket (AF_UNIX + SOCK_DGRAM), enabled via the CLN_TRACE_SOCKET envvar. Refactor trace.c so span management logic compiles unconditionally rather than being gated behind #if HAVE_USDT. DTRACE_PROBE macros are defined as no-ops when USDT is unavailable. When no backend is active (no USDT, no trace file, no socket), all tracing functions return early via disable_trace. Changelog-Added: tracing: Add a unix-domain socket sink for opentelemetry traces
Add Backend 2 section for the new CLN_TRACE_SOCKET UDS datagram transport. Restructure the existing USDT docs as Backend 1. Add an environment variable reference table and a minimal Python collector example.
6e52e5f to
64d806f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
common/trace.chas the ability to emit the traces it collects via a User-Defined Tracepoint which hands off the serialized trace into a ring buffer in the kernel if there is a listener active. This works, but is not available in some environments, specifically Kubernetes tends to not like exposing eBPF endpoints.The challenge in finding a new sink is that it must be capable of supporting concurrent writes from unsynchronized processes (main daemon, subprocesses and plugins), preventing corruption of individual writes. The solution is to use a UDS with datagram mode (UDP) enabled. This means that writes up to the MTU of the medium are guaranteed to be atomic.
The tracing is enabled by setting the
CLN_TRACE_SOCKETenvironment variable, binding a listener to the indicated path and read packets from it. The CLN processes will attach to the socket and use it to deliver its traces.