#support

Sending Metrics of Kafka App to Signoz Otel Collector

TLDR Shubham wanted advice to send metrics to a signoz otel collector. nitya-signoz provided guidance and Srikanth confirmed using the collector for Kafka server telemetry.

Powered by Struct AI
26
7mo
Solved
Join the chat
Apr 27, 2023 (7 months ago)
Shubham
Photo of md5-ad457e7658217bb0472b256430bdb6a8
Shubham
10:58 AM
I want to send metrics of a kafka app to signoz otel collector in a different eks cluster, I have made the otel collector publically available using virtual-service & pvt-gateway ,but the otelagent jar throws error OTLP endpoint must be a valid URL
How to implement this??
nitya-signoz
Photo of md5-a52b9d6c34f193d9a1ff940024f36f77
nitya-signoz
10:59 AM
Can you share the value of otlp endpoint you are passing ?
nitya-signoz
Photo of md5-a52b9d6c34f193d9a1ff940024f36f77
nitya-signoz
11:06 AM
it will look something like this https://signoz-collector-qa.fcinternal.in:4317

cc Prashant
Shubham
Photo of md5-ad457e7658217bb0472b256430bdb6a8
Shubham
11:09 AM
tried it, same error
nitya-signoz
Photo of md5-a52b9d6c34f193d9a1ff940024f36f77
nitya-signoz
11:15 AM
Can you share the entire command that you are using to run your jar?
Shubham
Photo of md5-ad457e7658217bb0472b256430bdb6a8
Shubham
11:19 AM
export EXTRA_ARGS='-Dotel.exporter.otlp.endpoint="" -Dotel.resource.attributes=service.name=kafka-test -javaagent:/opentelemetry-javaagent.jar'

exec $base_dir/kafka-run-class $EXTRA_ARGS kafka.Kafka "$@"
nitya-signoz
Photo of md5-a52b9d6c34f193d9a1ff940024f36f77
nitya-signoz
11:23 AM
Interesting, can you try using env vars like this and check if the same error occurs ?

OTEL_EXPORTER_OTLP_ENDPOINT="" OTEL_RESOURCE_ATTRIBUTES=service.name=petclinick java -javaagent:"~/opentelemetry-javaagent-1.jar" -jar target/*.jar
Shubham
Photo of md5-ad457e7658217bb0472b256430bdb6a8
Shubham
11:25 AM
but that won't send metrics to signoz collector
11:25
Shubham
11:25 AM
???
nitya-signoz
Photo of md5-a52b9d6c34f193d9a1ff940024f36f77
nitya-signoz
11:26 AM
Sorry didn’t get you.
Shubham
Photo of md5-ad457e7658217bb0472b256430bdb6a8
Shubham
11:28 AM
will this send metrics to otel-collector in eks cluster ?
nitya-signoz
Photo of md5-a52b9d6c34f193d9a1ff940024f36f77
nitya-signoz
11:28 AM
Yes it will.
11:28
nitya-signoz
11:28 AM
We have an example application here https://github.com/SigNoz/spring-petclinic
Shubham
Photo of md5-ad457e7658217bb0472b256430bdb6a8
Shubham
11:28 AM
ok
11:31
Shubham
11:31 AM
should i use these envs also to start the service??
nitya-signoz
Photo of md5-a52b9d6c34f193d9a1ff940024f36f77
nitya-signoz
11:32 AM
If you are running the otel agent with your service then you will need to add these env vars
Shubham
Photo of md5-ad457e7658217bb0472b256430bdb6a8
Shubham
11:34 AM
does it matter that i am trying to export metrics of a kafka app?
nitya-signoz
Photo of md5-a52b9d6c34f193d9a1ff940024f36f77
nitya-signoz
11:38 AM
No in that case it doesn’t matter to add them to your services.
Shubham
Photo of md5-ad457e7658217bb0472b256430bdb6a8
Shubham
11:41 AM
i mean i am adding it to the kafka start command
nitya-signoz
Photo of md5-a52b9d6c34f193d9a1ff940024f36f77
nitya-signoz
11:52 AM
So you just want your Kafka server metrics. While I haven’t personally tried this out, you can check out this demo doc by Otel https://opentelemetry.io/docs/demo/services/kafka/


You can also check out this kafka metrics receiver https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/kafkametricsreceiver/README.md


Srikanth any more ideas on monitoring the Kafka server?
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
12:07 PM
It’s unclear if they are interested in the Kafka server or language client instrumentation; it seems they want to collect the client metrics. None of that is relevant to the original error. Can you share the full run command?
May 03, 2023 (7 months ago)
Shubham
Photo of md5-ad457e7658217bb0472b256430bdb6a8
Shubham
05:28 AM
we want instrumentation of the kafka server??
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
06:20 AM
Is that a question or confirmation?
Shubham
Photo of md5-ad457e7658217bb0472b256430bdb6a8
Shubham
11:37 AM
sorry,confirmation
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
01:09 PM
If you are interested in the telemetry of the Kafka server, you need to use the collector https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/receiver/kafkametricsreceiver. Let us know if that helps or you need more clarification.

SigNoz Community

Built with ClickHouse as datastore, SigNoz is an open-source APM to help you find issues in your deployed applications & solve them quickly | Knowledge Base powered by Struct.AI

Indexed 1023 threads (61% resolved)

Join Our Community