1616
1717package org .hypertrace .agent ;
1818
19- import ai .traceable .agent .agentconfig .InstrumentationAgentConfig ;
20- import ai .traceable .agent .agentconfig .Reporting ;
2119import io .opentelemetry .javaagent .OpenTelemetryAgent ;
2220import java .lang .instrument .Instrumentation ;
2321
@@ -36,40 +34,6 @@ public static void premain(String agentArgs, Instrumentation inst) {
3634 }
3735
3836 public static void agentmain (String agentArgs , Instrumentation inst ) {
39- configureOTELWithTraceableConfig (agentArgs );
4037 OpenTelemetryAgent .premain (agentArgs , inst );
4138 }
42-
43- private static void configureOTELWithTraceableConfig (String agentArgs ) {
44- // The properties from traceable config file are set as default to OTEL config.
45- InstrumentationAgentConfig traceableConfig = TraceableConfig .loadConfigFile (agentArgs );
46- if (traceableConfig == null ) {
47- return ;
48- }
49-
50- if (traceableConfig .getLogging () != null && traceableConfig .getLogging ().getLevel () != null ) {
51- OpenTelemetryConfig .setDefault (
52- OTEL_DEFAULT_LOG_LEVEL , traceableConfig .getLogging ().getLevel ());
53- }
54-
55- // set reporter to Zipkin because OpenTelemetry supports only Jaeger gRPC
56- // which is not supported by OC collector in Hypertrace
57- OpenTelemetryConfig .setDefault (OTEL_EXPORTER , "zipkin" );
58-
59- // TODO retry and backoff are not in OTEL. Maybe gRPC exporter does retry automatically?
60- Reporting reporting = traceableConfig .getReporting ();
61- if (reporting != null ) {
62- if (reporting != null && reporting .getTracesAddress () != null ) {
63- OpenTelemetryConfig .setDefault (OTEL_EXPORTER_ZIPKIN_ENDPOINT , reporting .getTracesAddress ());
64- }
65- if (reporting .getQueueSize () != null ) {
66- OpenTelemetryConfig .setDefault (
67- OTEL_PROCESSOR_BATCH_MAX_QUEUE , Integer .toString (reporting .getQueueSize ()));
68- }
69- }
70- if (traceableConfig .getServiceName () != null ) {
71- OpenTelemetryConfig .setDefault (
72- OTEL_EXPORTER_ZIPKIN_SERVICE_NAME , traceableConfig .getServiceName ());
73- }
74- }
7539}
0 commit comments