Replies: 1 comment 3 replies
-
By default Jaeger pushes span data encoded using a protobuf encoding. You would need to use the protobuf definitions to generate classes to deserialize the data: Jaeger can also use a json format when sending to kafka which can be configured using |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am trying to get Jaeger span details from the Kafka plugin in Java. I'm using below code :
String bootstrapServers="127.0.0.1:9092"; String grp_id="tracing_app"; String topic="jaeger-spans"; //Creating consumer properties Properties properties=new Properties(); properties.setProperty(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,bootstrapServers); properties.setProperty(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer .class.getName()); properties.setProperty(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG,StringDeserializer.class.getName()); properties.setProperty(ConsumerConfig.GROUP_ID_CONFIG,grp_id); properties.setProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG,"earliest"); //creating consumer org.apache.kafka.clients.consumer.KafkaConsumer<String,String> consumer= new org.apache.kafka.clients.consumer.KafkaConsumer<String,String>(properties); //Subscribing consumer.subscribe(Arrays.asList(topic)); //polling while(true) { ConsumerRecords<String, String> records = consumer.poll(Duration.ofMillis(100)); for (ConsumerRecord<String, String> record : records) { System.out.println("Key: " + record.key() + ", Value:" + record.value()); System.out.println("Partition:" + record.partition() + ",Offset:" + record.offset()); } }
But due to some reason, I am getting output like this.
How can I properly de-serialize the span data?
Beta Was this translation helpful? Give feedback.
All reactions