Skip to content

Commit fc76008

Browse files
committed
added documentation
1 parent 8c35d35 commit fc76008

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/OtlpAwsSpanExporter.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@
3636
import software.amazon.awssdk.http.auth.spi.signer.SignedRequest;
3737

3838
/**
39-
* This exporter is NOT meant for generic use since the payload is prefixed with AWS X-Ray specific
40-
* information.
39+
* This exporter extends the functionality of the OtlpHttpSpanExporter to allow spans to be exported
40+
* to the XRay OTLP endpoint https://xray.[AWSRegion].amazonaws.com/v1/traces. Utilizes the AWSSDK
41+
* library to sign and directly inject SigV4 Authentication to the exported request's headers.
42+
* https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-OTLPEndpoint.html
4143
*/
4244
@Immutable
4345
public class OtlpAwsSpanExporter implements SpanExporter {
@@ -61,6 +63,11 @@ public OtlpAwsSpanExporter(String endpoint) {
6163
this.spanData = new ArrayList<>();
6264
}
6365

66+
/**
67+
* Overrides the upstream implementation of export. All behaviors are the same except if the
68+
* endpoint is an XRay OTLP endpoint, we will sign the request with SigV4 in headers before
69+
* sending it to the endpoint. Otherwise, we will skip signing.
70+
*/
6471
@Override
6572
public CompletableResultCode export(Collection<SpanData> spans) {
6673
this.spanData = spans;

0 commit comments

Comments
 (0)