File tree Expand file tree Collapse file tree 3 files changed +10
-1
lines changed
src/main/java/org/hypertrace/agent/core Expand file tree Collapse file tree 3 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 23
23
24
24
dependencies {
25
25
api("io.opentelemetry:opentelemetry-api:0.10.0")
26
+ implementation("org.slf4j:slf4j-api:1.7.30")
26
27
27
28
api("com.google.protobuf:protobuf-java:3.11.4")
28
29
api("com.google.protobuf:protobuf-java-util:3.11.4")
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ private EnvironmentConfig() {}
36
36
public static final String CONFIG_FILE_PROPERTY = HT_PREFIX + "config.file";
37
37
static final String SERVICE_NAME = HT_PREFIX + "service.name";
38
38
39
- static final String PROPAGATION_FORMATS = HT_PREFIX + "propagation_formats ";
39
+ static final String PROPAGATION_FORMATS = HT_PREFIX + "propagation.formats ";
40
40
41
41
private static final String REPORTING_PREFIX = HT_PREFIX + "reporting.";
42
42
static final String REPORTING_ADDRESS = REPORTING_PREFIX + "address";
Original file line number Diff line number Diff line change 37
37
import org.hypertrace.agent.config.Config.Opa.Builder;
38
38
import org.hypertrace.agent.config.Config.PropagationFormat;
39
39
import org.hypertrace.agent.config.Config.Reporting;
40
+ import org.slf4j.Logger;
41
+ import org.slf4j.LoggerFactory;
40
42
41
43
/** {@link HypertraceConfig} loads a yaml config from file. */
42
44
public class HypertraceConfig {
43
45
44
46
private HypertraceConfig() {}
45
47
48
+ private static final Logger log = LoggerFactory.getLogger(HypertraceConfig.class);
49
+
46
50
private static AgentConfig agentConfig;
47
51
48
52
static final String DEFAULT_SERVICE_NAME = "unknown";
@@ -56,6 +60,9 @@ public static AgentConfig get() {
56
60
if (agentConfig == null) {
57
61
try {
58
62
agentConfig = load();
63
+ log.info(
64
+ "Config loaded: {}",
65
+ JsonFormat.printer().omittingInsignificantWhitespace().print(agentConfig));
59
66
} catch (IOException e) {
60
67
throw new RuntimeException("Could not load config", e);
61
68
}
@@ -82,6 +89,7 @@ public static boolean isInstrumentationEnabled(String[] instrumentationNames) {
82
89
}
83
90
84
91
/** Reset the config, use only in tests. */
92
+ @VisibleForTesting
85
93
public static void reset() {
86
94
agentConfig = null;
87
95
}
You can’t perform that action at this time.
0 commit comments