-
Notifications
You must be signed in to change notification settings - Fork 860
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Apache camel enable sqs propagation (#2102) * adding AWS SQS tests to Apache Camel instrumentation * code review changes Co-authored-by: Anuraag Agrawal <[email protected]> * SQS context propagation for Apache Camel instrumentation * code review - removed not needed dep Co-authored-by: Anuraag Agrawal <[email protected]> * Bumped testcontainers version to make smoke tests pass Co-authored-by: Jakub Wach <[email protected]> Co-authored-by: Anuraag Agrawal <[email protected]>
- Loading branch information
1 parent
94fd21e
commit 0d4f861
Showing
22 changed files
with
664 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...tation/apache-camel-2.20/javaagent-unittests/apache-camel-2.20-javaagent-unittests.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
apply from: "$rootDir/gradle/java.gradle" | ||
|
||
dependencies { | ||
testImplementation project(':instrumentation:apache-camel-2.20:javaagent') | ||
testImplementation group: 'org.apache.camel', name: 'camel-core', version: '2.20.1' | ||
testImplementation group: 'org.apache.camel', name: 'camel-aws', version: '2.20.1' | ||
|
||
testImplementation deps.opentelemetryTraceProps | ||
testImplementation group: 'org.assertj', name: 'assertj-core', version: '3.18.1' | ||
} |
43 changes: 43 additions & 0 deletions
43
...oovy/io/opentelemetry/javaagent/instrumentation/apachecamel/CamelPropagationUtilTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.javaagent.instrumentation.apachecamel; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import io.opentelemetry.api.trace.Span; | ||
import io.opentelemetry.api.trace.SpanContext; | ||
import io.opentelemetry.context.Context; | ||
import java.util.Collections; | ||
import java.util.Map; | ||
import org.apache.camel.Endpoint; | ||
import org.apache.camel.component.aws.sqs.SqsComponent; | ||
import org.apache.camel.component.aws.sqs.SqsConfiguration; | ||
import org.apache.camel.component.aws.sqs.SqsEndpoint; | ||
import org.junit.jupiter.api.Test; | ||
|
||
public class CamelPropagationUtilTest { | ||
|
||
@Test | ||
public void shouldExtractAwsParent() { | ||
|
||
// given | ||
Endpoint endpoint = new SqsEndpoint("", new SqsComponent(), new SqsConfiguration()); | ||
Map<String, Object> exchangeHeaders = | ||
Collections.singletonMap( | ||
"AWSTraceHeader", | ||
"Root=1-5759e988-bd862e3fe1be46a994272793;Parent=53995c3f42cd8ad8;Sampled=1\n"); | ||
|
||
// when | ||
Context parent = CamelPropagationUtil.extractParent(exchangeHeaders, endpoint); | ||
|
||
// then | ||
Span parentSpan = Span.fromContext(parent); | ||
SpanContext parentSpanContext = parentSpan.getSpanContext(); | ||
assertThat(parentSpanContext.getTraceIdAsHexString()) | ||
.isEqualTo("5759e988bd862e3fe1be46a994272793"); | ||
assertThat(parentSpanContext.getSpanIdAsHexString()).isEqualTo("53995c3f42cd8ad8"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.