
com.jashmore.sqs.brave.SendMessageTracingExecutionInterceptor Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sqs-brave-tracing Show documentation
Show all versions of sqs-brave-tracing Show documentation
Helper Util for adding Tracing information to the message attributes of outbound SQS messages
package com.jashmore.sqs.brave;
import brave.Span;
import brave.Tracing;
import brave.propagation.TraceContext;
import com.jashmore.sqs.brave.propogation.SendMessageRemoteSetter;
import software.amazon.awssdk.core.SdkRequest;
import software.amazon.awssdk.core.interceptor.Context;
import software.amazon.awssdk.core.interceptor.ExecutionAttribute;
import software.amazon.awssdk.core.interceptor.ExecutionAttributes;
import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
import software.amazon.awssdk.http.SdkHttpResponse;
import software.amazon.awssdk.services.sqs.model.MessageAttributeValue;
import software.amazon.awssdk.services.sqs.model.SendMessageRequest;
import software.amazon.awssdk.services.sqs.model.SendMessageResponse;
import java.util.HashMap;
import java.util.Map;
/**
* {@link ExecutionInterceptor} that will add tracing information to the message attributes of a SQS
* message placed onto the queue.
*
* This will allow the trace to be continued by all consuming services.
*/
public class SendMessageTracingExecutionInterceptor implements ExecutionInterceptor {
static final ExecutionAttribute SPAN_EXECUTION_ATTRIBUTE = new ExecutionAttribute<>("span");
private final Tracing tracing;
private final TraceContext.Injector
© 2015 - 2025 Weber Informatics LLC | Privacy Policy