Skip to content

Commit 3a58394

Browse files
refactor(Common): Rename OTLP config fields to generic Pipe/Emit
The Configuration struct's `OTLPEndpoint` and `OTLPEnabled` field names were OTLP-specific, making them misleading as the telemetry system grows to support multiple output pipes (PostHog via `Report`, gRPC OTLP via `Emit`). Rename `OTLPEndpoint` → `Pipe` and `OTLPEnabled` → `Emit` across Configuration, EmitOTLPSpan, and IsAllowed, keeping the doc comment in IsAllowed aligned with the new per-pipe toggle terminology. No behavioral change — the same OTLP endpoint is routed through the generically-named fields.
1 parent 102c0e1 commit 3a58394

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

Source/Telemetry/Configuration.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ pub struct Configuration {
1515

1616
pub Capture:bool,
1717

18-
pub OTLPEndpoint:String,
18+
pub Pipe:String,
1919

20-
pub OTLPEnabled:bool,
20+
pub Emit:bool,
2121
}
2222

2323
fn ReadString(Key:&str, Fallback:&str) -> String {
@@ -47,8 +47,8 @@ pub fn Fn() -> Configuration {
4747

4848
Capture:ReadBool("Capture", false),
4949

50-
OTLPEndpoint:ReadString("OTLPEndpoint", "http://127.0.0.1:4318"),
50+
Pipe:ReadString("Pipe", "http://127.0.0.1:4318"),
5151

52-
OTLPEnabled:ReadBool("OTLPEnabled", false),
52+
Emit:ReadBool("Emit", false),
5353
}
5454
}

Source/Telemetry/EmitOTLPSpan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ pub fn Fn(Name:&str, StartNano:u64, EndNano:u64, Attributes:&[(&str, &str)]) {
124124
StatusCode,
125125
);
126126

127-
let (HostAddress, PathSegment) = ParseEndpoint(&Configuration.OTLPEndpoint);
127+
let (HostAddress, PathSegment) = ParseEndpoint(&Configuration.Pipe);
128128

129129
std::thread::spawn(move || {
130130
use std::{

Source/Telemetry/IsAllowed.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Compile-time + runtime gates. `cfg!(debug_assertions)` strips both
22
//! pipes from release builds; `Capture` is the master kill, `Report` /
3-
//! `OTLPEnabled` are per-pipe toggles. Cached after first read so the
3+
//! `Emit` are per-pipe toggles. Cached after first read so the
44
//! hot path is one atomic load.
55
66
use std::sync::OnceLock;
@@ -28,7 +28,7 @@ pub fn OTLP() -> bool {
2828

2929
let C = Get();
3030

31-
C.Capture && C.OTLPEnabled
31+
C.Capture && C.Emit
3232
}
3333

3434
pub fn Cached() -> &'static Configuration::Configuration { Get() }

0 commit comments

Comments
 (0)