Skip to content

Commit 120f8d9

Browse files
authored
Fix telemetry layer order (#90)
1 parent 59769af commit 120f8d9

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

crates/shine-core/src/telemetry/telemetry_service.rs

+14-10
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,14 @@ impl TelemetryService {
235235
if config.allow_reconfigure {
236236
Self::set_global_tracing_pipeline(
237237
registry()
238-
.with(self.tracing_console_log(config)?)
239-
.with(self.tracing_dyn_filter(config)?),
238+
.with(self.tracing_dyn_filter(config)?)
239+
.with(self.tracing_console_log(config)?),
240240
)?;
241241
} else {
242242
Self::set_global_tracing_pipeline(
243243
registry()
244-
.with(self.tracing_console_log(config)?)
245-
.with(self.tracing_fixed_filter(config)?),
244+
.with(self.tracing_fixed_filter(config)?)
245+
.with(self.tracing_console_log(config)?),
246246
)?;
247247
}
248248
} else {
@@ -253,27 +253,31 @@ impl TelemetryService {
253253
(true, true) => {
254254
Self::set_global_tracing_pipeline(
255255
registry()
256-
.with(self.tracing_ot(config, resource, scope)?)
256+
.with(self.tracing_dyn_filter(config)?)
257257
.with(self.tracing_console_log(config)?)
258-
.with(self.tracing_dyn_filter(config)?),
258+
.with(self.tracing_ot(config, resource, scope)?),
259259
)?;
260260
}
261261
(true, false) => {
262262
Self::set_global_tracing_pipeline(
263263
registry()
264-
.with(self.tracing_ot(config, resource, scope)?)
264+
.with(self.tracing_fixed_filter(config)?)
265265
.with(self.tracing_console_log(config)?)
266-
.with(self.tracing_fixed_filter(config)?),
266+
.with(self.tracing_ot(config, resource, scope)?),
267267
)?;
268268
}
269269
(false, true) => {
270270
Self::set_global_tracing_pipeline(
271-
registry().with(self.tracing_ot(config, resource, scope)?), //todo: ot + EnvFilter seems to be broken .with(self.tracing_dyn_filter(config)?),
271+
registry()
272+
.with(self.tracing_dyn_filter(config)?)
273+
.with(self.tracing_ot(config, resource, scope)?),
272274
)?;
273275
}
274276
(false, false) => {
275277
Self::set_global_tracing_pipeline(
276-
registry().with(self.tracing_ot(config, resource, scope)?), //todo: ot + EnvFilter seems to be broken .with(self.tracing_fixed_filter(config)?),
278+
registry()
279+
.with(self.tracing_fixed_filter(config)?)
280+
.with(self.tracing_ot(config, resource, scope)?),
277281
)?;
278282
}
279283
}

services/server_config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"telemetry": {
88
"allowReconfigure": true,
99
"enableConsoleLog": true,
10-
"defaultLevel": "INFO,shine_corer=INFO,shine_identity=DEBUG,shine_builder=DEBUG",
10+
"defaultLevel": "INFO,shine_builder=TRACE",
1111
"metrics": {
1212
"type": "prometheus"
1313
},

services/server_config_test.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"telemetry": {
1414
"allowReconfigure": true,
1515
"enableConsoleLog": true,
16-
"defaultLevel": "INFO,shine_corer=INFO,shine_identity=DEBUG,shine_builder=DEBUG",
16+
"defaultLevel": "INFO,shine_core=TRACE,shine_identity=TRACE,shine_builder=TRACE",
1717
"metrics": {
1818
"type": "prometheus"
1919
},

0 commit comments

Comments
 (0)