https://signoz.io logo
#support
Title
# support
s

Shubham Upreti

04/27/2023, 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??
n

nitya-signoz

04/27/2023, 10:59 AM
Can you share the value of otlp endpoint you are passing ?
s

Shubham Upreti

04/27/2023, 11:00 AM
n

nitya-signoz

04/27/2023, 11:06 AM
it will look something like this https://signoz-collector-qa.fcinternal.in:4317 cc @Prashant Shahi
s

Shubham Upreti

04/27/2023, 11:09 AM
tried it, same error
n

nitya-signoz

04/27/2023, 11:15 AM
Can you share the entire command that you are using to run your jar?
s

Shubham Upreti

04/27/2023, 11:19 AM
Copy code
export EXTRA_ARGS='-Dotel.exporter.otlp.endpoint="<https://signoz-collector-qa.fcinternal.in:4317>" -Dotel.resource.attributes=service.name=kafka-test -javaagent:/opentelemetry-javaagent.jar'
exec $base_dir/kafka-run-class $EXTRA_ARGS kafka.Kafka "$@"
n

nitya-signoz

04/27/2023, 11:23 AM
Interesting, can you try using env vars like this and check if the same error occurs ?
Copy code
OTEL_EXPORTER_OTLP_ENDPOINT="<http://localhost:4317>" OTEL_RESOURCE_ATTRIBUTES=service.name=petclinick java -javaagent:"~/opentelemetry-javaagent-1.jar" -jar target/*.jar
s

Shubham Upreti

04/27/2023, 11:25 AM
but that won't send metrics to signoz collector
???
n

nitya-signoz

04/27/2023, 11:26 AM
Sorry didn’t get you.
s

Shubham Upreti

04/27/2023, 11:28 AM
will this send metrics to otel-collector in eks cluster ?
n

nitya-signoz

04/27/2023, 11:28 AM
Yes it will.
We have an example application here https://github.com/SigNoz/spring-petclinic
s

Shubham Upreti

04/27/2023, 11:28 AM
ok
should i use these envs also to start the service??
n

nitya-signoz

04/27/2023, 11:32 AM
If you are running the otel agent with your service then you will need to add these env vars
s

Shubham Upreti

04/27/2023, 11:34 AM
does it matter that i am trying to export metrics of a kafka app?
n

nitya-signoz

04/27/2023, 11:38 AM
No in that case it doesn’t matter to add them to your services.
s

Shubham Upreti

04/27/2023, 11:41 AM
i mean i am adding it to the kafka start command
n

nitya-signoz

04/27/2023, 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 Chekuri any more ideas on monitoring the Kafka server?
s

Srikanth Chekuri

04/27/2023, 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?
s

Shubham Upreti

05/03/2023, 5:28 AM
we want instrumentation of the kafka server??
s

Srikanth Chekuri

05/03/2023, 6:20 AM
Is that a question or confirmation?
s

Shubham Upreti

05/03/2023, 11:37 AM
sorry,confirmation
s

Srikanth Chekuri

05/03/2023, 1: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.
4 Views