Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix OpenTelemetry traces operation names as they changed when OpenTelemetry was bumped to 1.23.1 #1091

Merged
merged 1 commit into from
Mar 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void verifyTelemetry() {
Assertions.assertEquals("Plato", reactive.jsonPath().getString("data.friend_r.name"));

await().atMost(1, TimeUnit.MINUTES).pollInterval(Duration.ofSeconds(10)).untilAsserted(() -> {
String operation = "/graphql";
String operation = "POST /graphql";
Response traces = given().when()
.queryParam("operation", operation)
.queryParam("lookback", "1h")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public class VertxWebClientIT {
static final String EXPECTED_VALUE = "Chuck Norris has already been to mars; that why there's no signs of life";
static final int DELAY = 3500; // must be greater than vertx.webclient.timeout-sec
private static final String TRACE_PING_PATH = "/trace/ping";
private static final String TRACE_PING_OPERATION_NAME = "GET " + TRACE_PING_PATH;

private Response resp;

Expand Down Expand Up @@ -106,13 +107,13 @@ public void endpointShouldTrace() {
final int pageLimit = 50;
await().atMost(1, TimeUnit.MINUTES).pollInterval(Duration.ofSeconds(1)).untilAsserted(() -> {
whenIMakePingRequest();
thenRetrieveTraces(pageLimit, "1h", getServiceName(), TRACE_PING_PATH);
thenRetrieveTraces(pageLimit, "1h", getServiceName(), TRACE_PING_OPERATION_NAME);
thenStatusCodeMustBe(HttpStatus.SC_OK);
thenTraceDataSizeMustBe(greaterThan(0));
thenTraceSpanSizeMustBe(greaterThan(0));
thenTraceSpanTagsSizeMustBe(greaterThan(0));
thenTraceSpansOperationNameMustBe(not(empty()));
thenCheckOperationNamesIsEqualTo(TRACE_PING_PATH);
thenCheckOperationNamesIsEqualTo(TRACE_PING_OPERATION_NAME);
});
}

Expand All @@ -121,13 +122,13 @@ public void httpClientShouldHaveHisOwnSpan() {
final int pageLimit = 50;
await().atMost(1, TimeUnit.MINUTES).pollInterval(Duration.ofSeconds(1)).untilAsserted(() -> {
whenIMakePingRequest();
thenRetrieveTraces(pageLimit, "1h", getServiceName(), TRACE_PING_PATH);
thenRetrieveTraces(pageLimit, "1h", getServiceName(), TRACE_PING_OPERATION_NAME);
thenStatusCodeMustBe(HttpStatus.SC_OK);
thenTraceDataSizeMustBe(greaterThan(0));
thenTraceSpanSizeMustBe(greaterThan(1));
thenTraceSpanTagsSizeMustBe(greaterThan(0));
thenTraceSpansOperationNameMustBe(not(empty()));
thenCheckOperationNamesIsEqualTo(TRACE_PING_PATH);
thenCheckOperationNamesIsEqualTo(TRACE_PING_OPERATION_NAME);
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public class OpentelemetryIT {
@Test
public void testContextPropagation() {
int pageLimit = 10;
String operationName = "/ping/pong";
String[] operations = new String[] { "/ping/pong", "HTTP GET", "/hello" };
String operationName = "GET /ping/pong";
String[] operations = new String[] { "GET /ping/pong", "GET", "GET /hello" };

await().atMost(1, TimeUnit.MINUTES).pollInterval(Duration.ofSeconds(1)).untilAsserted(() -> {
whenDoPingPongRequest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public void verifyRollbackForNarayanaProgrammaticApproach() {
@Tag("QUARKUS-2492")
@Test
public void smokeTestNarayanaProgrammaticTransactionTrace() {
String operationName = "/transfer/accounts/{account_id}";
String operationName = "GET /transfer/accounts/{account_id}";
given().get("/transfer/accounts/" + ACCOUNT_NUMBER_LUIS).then().statusCode(HttpStatus.SC_OK);
verifyRestRequestTraces(operationName);
}
Expand Down