File tree Expand file tree Collapse file tree 7 files changed +20
-9
lines changed
main/java/org/hypertrace/agent/otel/extensions/config
java/org/hypertrace/agent/otel/extensions/config
smoke-tests/src/test/java/org/hypertrace/agent/smoketest Expand file tree Collapse file tree 7 files changed +20
-9
lines changed Original file line number Diff line number Diff line change @@ -43,10 +43,10 @@ The final artifact is in `javaagent/build/libs/hypertrace-agent-<version>-all.ja
43
43
Download the [ latest version] ( https://github.com/hypertrace/javaagent/releases/latest/download/hypertrace-agent-all.jar ) .
44
44
45
45
``` bash
46
- HT_EXPORTING_ENDPOINT =http://localhost:9411/api/v2/spans java -javaagent:javaagent/build/libs/hypertrace-agent-< version> -all.jar -jar app.jar
46
+ HT_REPORTING_ENDPOINT =http://localhost:4317 java -javaagent:javaagent/build/libs/hypertrace-agent-< version> -all.jar -jar app.jar
47
47
```
48
48
49
- By default the agent uses Zipkin exporter.
49
+ By default the agent uses Otlp exporter.
50
50
51
51
The configuration precedence order
52
52
1 . OpenTelemetry Agent's trace config file ` OTEL_TRACE_CONFIG ` /` otel.trace.config `
Original file line number Diff line number Diff line change 1
1
service_name : service_name
2
2
reporting :
3
- endpoint : http://localhost:9411/api/v2/spans
3
+ endpoint : http://localhost:4317
Original file line number Diff line number Diff line change 38
38
import org .hypertrace .agent .config .Config .Opa .Builder ;
39
39
import org .hypertrace .agent .config .Config .PropagationFormat ;
40
40
import org .hypertrace .agent .config .Config .Reporting ;
41
+ import org .hypertrace .agent .config .Config .TraceReporterType ;
41
42
import org .slf4j .Logger ;
42
43
import org .slf4j .LoggerFactory ;
43
44
@@ -52,7 +53,7 @@ private HypertraceConfig() {}
52
53
private static volatile AgentConfig agentConfig ;
53
54
54
55
static final String DEFAULT_SERVICE_NAME = "unknown" ;
55
- static final String DEFAULT_REPORTING_ENDPOINT = "http://localhost:9411/api/v2/spans " ;
56
+ static final String DEFAULT_REPORTING_ENDPOINT = "http://localhost:4317 " ;
56
57
static final String DEFAULT_OPA_ENDPOINT = "http://opa.traceableai:8181/" ;
57
58
static final int DEFAULT_OPA_POLL_PERIOD_SECONDS = 30 ;
58
59
// 128 KiB
@@ -143,7 +144,7 @@ private static Reporting.Builder applyReportingDefaults(Reporting.Builder builde
143
144
builder .setEndpoint (StringValue .newBuilder ().setValue (DEFAULT_REPORTING_ENDPOINT ).build ());
144
145
}
145
146
if (builder .getTraceReporterType ().equals (Config .TraceReporterType .UNSPECIFIED )) {
146
- builder .setTraceReporterType (Config . TraceReporterType .ZIPKIN );
147
+ builder .setTraceReporterType (TraceReporterType .OTLP );
147
148
}
148
149
Builder opaBuilder = applyOpaDefaults (builder .getOpa ().toBuilder ());
149
150
builder .setOpa (opaBuilder );
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ public void defaultValues() throws IOException {
40
40
Assertions .assertTrue (agentConfig .getEnabled ().getValue ());
41
41
Assertions .assertEquals ("unknown" , agentConfig .getServiceName ().getValue ());
42
42
Assertions .assertEquals (
43
- TraceReporterType .ZIPKIN , agentConfig .getReporting ().getTraceReporterType ());
43
+ TraceReporterType .OTLP , agentConfig .getReporting ().getTraceReporterType ());
44
44
Assertions .assertEquals (
45
45
HypertraceConfig .DEFAULT_REPORTING_ENDPOINT ,
46
46
agentConfig .getReporting ().getEndpoint ().getValue ());
@@ -106,7 +106,7 @@ private void assertConfig(AgentConfig agentConfig) {
106
106
Assertions .assertEquals (
107
107
TraceReporterType .OTLP , agentConfig .getReporting ().getTraceReporterType ());
108
108
Assertions .assertEquals (
109
- "http://localhost:9411 " , agentConfig .getReporting ().getEndpoint ().getValue ());
109
+ "http://localhost:4317 " , agentConfig .getReporting ().getEndpoint ().getValue ());
110
110
Assertions .assertEquals (true , agentConfig .getReporting ().getSecure ().getValue ());
111
111
Assertions .assertEquals (
112
112
"http://opa.localhost:8181/" , agentConfig .getReporting ().getOpa ().getEndpoint ().getValue ());
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ enabled: false
4
4
propagationFormats :
5
5
- B3
6
6
reporting :
7
- endpoint : http://localhost:9411
7
+ endpoint : http://localhost:4317
8
8
secure : true
9
9
trace_reporter_type : OTLP
10
10
opa :
Original file line number Diff line number Diff line change 49
49
import org .testcontainers .utility .MountableFile ;
50
50
51
51
public abstract class AbstractSmokeTest {
52
+
52
53
private static final Logger log = LoggerFactory .getLogger (OpenTelemetryStorage .class );
53
54
private static final String OTEL_COLLECTOR_IMAGE = "otel/opentelemetry-collector:0.21.0" ;
54
55
private static final String MOCK_BACKEND_IMAGE =
@@ -159,6 +160,13 @@ protected static Stream<InstrumentationLibrarySpans> getInstrumentationLibSpanSt
159
160
.flatMap (resourceSpans -> resourceSpans .getInstrumentationLibrarySpansList ().stream ());
160
161
}
161
162
163
+ protected Collection <ExportTraceServiceRequest > waitForTraces (final int count ) {
164
+ return Awaitility .await ()
165
+ .until (
166
+ this ::waitForTraces ,
167
+ exportTraceServiceRequests -> exportTraceServiceRequests .size () == count );
168
+ }
169
+
162
170
protected Collection <ExportTraceServiceRequest > waitForTraces () throws IOException {
163
171
String content = waitForContent ();
164
172
Original file line number Diff line number Diff line change 20
20
import io .opentelemetry .semconv .resource .attributes .ResourceAttributes ;
21
21
import java .io .IOException ;
22
22
import java .util .ArrayList ;
23
+ import java .util .Collection ;
23
24
import java .util .List ;
24
25
import java .util .jar .Attributes ;
25
26
import java .util .jar .JarFile ;
@@ -185,7 +186,8 @@ public void postJson_payload_truncation() throws IOException {
185
186
try (Response response = client .newCall (request ).execute ()) {
186
187
Assertions .assertEquals (response .body ().string (), requestBody );
187
188
}
188
- ArrayList <ExportTraceServiceRequest > traces = new ArrayList <>(waitForTraces ());
189
+
190
+ Collection <ExportTraceServiceRequest > traces = waitForTraces (2 );
189
191
190
192
List <String > responseBodyAttributes =
191
193
getSpanStream (traces )
You can’t perform that action at this time.
0 commit comments