-
Notifications
You must be signed in to change notification settings - Fork 998
Closed
Labels
bugSomething isn't workingSomething isn't workingneeds triageNew issue that requires triageNew issue that requires triage
Description
Describe the bug
When I use batchReceive()/batchReceiveAsync() method to receive messages on pulsar-client, can't export the "receive" span.
Steps to reproduce
public static void main(String[] args) throws PulsarClientException {
String serviceUrl = "pulsar://localhost:6650";
String topic = "my-topic";
PulsarClient client = PulsarClient.builder()
.serviceUrl(serviceUrl)
.build();
Consumer<String> consumer = client.newConsumer(Schema.STRING)
.topic(topic)
.subscriptionType(SubscriptionType.Shared)
.subscriptionName("subs")
.subscribe();
Producer<String> producer = client.newProducer(Schema.STRING)
.enableBatching(false)
.topic(topic)
.create();
final int N = 1;
for (int i = 0; i < N ; i++) {
producer.newMessage().key("key-" + i).value("message-" + i).send();
}
for (int i = 0; i < N ; i++) {
Messages<String> messages = consumer.batchReceive();
for (Message<String> message : messages) {
System.out.println("Received message: " + message.getValue());
consumer.acknowledge(message);
}
}
consumer.close();
producer.close();
client.close();
}
java -javaagent:/path/opentelemetry-javaagent.jar \
-Dotel.resource.attributes=service.name=myapp \
-Dotel.traces.exporter=otlp \
-Dotel.metrics.exporter=none \
-jar myapp.jar
Expected behavior
Export the "receive" span when using batchReceive()
method to receive messages on pulsar-client.
Actual behavior
Can't export the "receive" span
This may be related to otel.instrumentation.messaging.experimental.receive-telemetry.enabled
, since when enable it, this span can be exported but traceID has changed
Javaagent or library instrumentation version
v1.32.1
Environment
JDK: JDK17
OS: macOS M1
Additional context


Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingneeds triageNew issue that requires triageNew issue that requires triage