Move ObservedEvent into crates/telemetry, consolidated with self_tracing::LogRecord #1818
+436
−265
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.
The ObservedEvent has associated flume channels and a connection with the existing metrics and admin component which make it an appealing way to transport log events in the engine.
Move PipelineKey, DeployedPipelineKey, CoreId types into crates/config.
Therefore, moving ObservedEvent into crates/telemetry lets us (optionally) use the same channel already use for lifecycle events for tokio log records. The existing event structure is extended with a
EventMessageenum which supports None, String, or LogRecord messages. This way we can use a log record as the event message for all existing event types. Theevent.rsfile moves, only ObservedEventRingBuffer from that file remains in crates/state.The LogRecord has been storing a timestamp. Now, we leave that to the ObservedEvent struct. LogRecord passes through SystemTime everywhere it has been used. Callers generally compute this and pass it in. Minor cleanup in self_tracing/formatter.rs, do not pass SavedCallsite it can be calculated from record metadata as needed.
In internal_events, the raw_error! macro has been replaced with a helper to generate LogRecord values first, by level. This lets us pass
info_event!("string", key=value)to any of the event constructors and construct an OTLP bytes message instead of a String message.