-
Notifications
You must be signed in to change notification settings - Fork 871
/
ExperimentalConfig.java
57 lines (44 loc) · 1.58 KB
/
ExperimentalConfig.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*
* Copyright The OpenTelemetry Authors
* SPDX-License-Identifier: Apache-2.0
*/
package io.opentelemetry.javaagent.bootstrap.internal;
import static java.util.Collections.emptyList;
import java.util.List;
/**
* This class is internal and is hence not for public use. Its APIs are unstable and can change at
* any time.
*/
public final class ExperimentalConfig {
private static final ExperimentalConfig instance =
new ExperimentalConfig(InstrumentationConfig.get());
private final InstrumentationConfig config;
private final List<String> messagingHeaders;
/** Returns the global agent configuration. */
public static ExperimentalConfig get() {
return instance;
}
public ExperimentalConfig(InstrumentationConfig config) {
this.config = config;
messagingHeaders =
config.getList("otel.instrumentation.messaging.experimental.capture-headers", emptyList());
}
public boolean controllerTelemetryEnabled() {
return config.getBoolean(
"otel.instrumentation.common.experimental.controller-telemetry.enabled", false);
}
public boolean viewTelemetryEnabled() {
return config.getBoolean(
"otel.instrumentation.common.experimental.view-telemetry.enabled", false);
}
public boolean messagingReceiveInstrumentationEnabled() {
return config.getBoolean(
"otel.instrumentation.messaging.experimental.receive-telemetry.enabled", false);
}
public boolean indyEnabled() {
return config.getBoolean("otel.javaagent.experimental.indy", false);
}
public List<String> getMessagingHeaders() {
return messagingHeaders;
}
}