Hello team i was trying to monitor jdbc_connection...
# support
r
Hello team i was trying to monitor jdbc_connections_active metrics for my service in signoz , but not able to get data when i give PromQL in dashboard and even i tried by enabling Dotel.instrumentation.jdbc-datasource.enabled=true , is there any other equivalent metrics for jdbc
s
jdbc-datasource.enabled=true
This is not related to the metric.
jdbc-datasource
which creates spans whenever the
java.sql.DataSource#getConnection
method is called.
https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/b594b7f6f9936758294f11d172b41408a00cb7f0/docs/supported-libraries.md#d[…]s Where is the source of metrics data? like micrometer or OTEL native or something else?
OpenTeleme has
db_client_connections_usage
with state either
idle
/`used` and there are several other which can be found here https://github.com/open-telemetry/opentelemetry-specification/blob/25f513dbea2810b[…]/specification/metrics/semantic_conventions/database-metrics.md
r
Copy code
#!/bin/bash
java -Dlog-path=/logs -Dspring.config.location=file:/properties/fincluez-l2t-ms.yml,file:/properties/fincluez-t-ms-loan.yml -Dlogging.config=file:/properties/logback-spring-loan.xml -javaagent:/opentelemetry/opentelemetry-javaagent.jar -Dotel.metrics.exporter=none -Dotel.exporter.otlp.endpoint=http://${signoz_ip} -Dotel.instrumentation.jdbc-datasource.enabled=true -Dotel.resource.attributes="service.name=fincluez-l2t-loans" -jar loans-l2t-22.2.0-0.1.war
i gave those while running service , do i need to change Dotel.instrumentation.jdbc-datasource.enabled=true to Dotel.instrumentation.db.client.connections.usage=idle like this ?
s
do i need to change Dotel.instrumentation.jdbc-datasource.enabled=true to Dotel.instrumentation.db.client.connections.usage=idle like this ?
The
db_client_connections_usage
is a metric name, not a configuration option.
Copy code
Dotel.metrics.exporter=none
Remove this if you want metrics. If this is from our docs/blogs we will get it updated.
r
if i remove this Dotel.metrics.exporter=none can i monitor other metrics which mentioned in docs https://signoz.io/docs/tutorial/jvm-metrics/#available-metrics-that-you-can-monitor , or it only specific to jdbc metric
s
You can monitor all of the mentioned metrics.
r
still i am not able to monitor db_client_connections_usage , after removing the above configuration
s
Where did the “instances” come from? Did you add the label yourself? Does it even exist? When you work with any metric data, the easy and the best thing is to run as simple as query with metric name and see what data exists.
r
even if i run query only with metrics name i am not getting
s
Then there is likely high chance the data is not being received. Check your setup properly. Check the logs of the collector if it has any issues.
r
Ok i ll check
https://signoz.io/docs/tutorial/jvm-metrics/#available-metrics-that-you-can-monitor , from this list of metrics , we able to montior all except jdbc and hikari metric . as we are using hikari connection we need those metrics . is there any alternative metrics for these two . as i checked the logs i got "failed to scrape prometheus endpoint" as warning from otel-collector other than this no other info from logs . please help in monitoring these 2 metrics
s
failed to scrape prometheus endpoint
You need to fix this. Make sure the endpoint you are configuring is correct and reachable by collector.
r
i crosschecked with some query in clickhouse DB -> SELECT name FROM ( SELECT DISTINCT JSONExtractString(labels, '__name__') AS name FROM signoz_metrics.time_series) AS tmp1 WHERE name ILIKE '%jvm%' ,its giving some result as some list jvm metrics .same i tried with (jdbc) SELECT name FROM ( SELECT DISTINCT JSONExtractString(labels, '__name__') AS name FROM signoz_metrics.time_series) AS tmp1 WHERE name ILIKE '%jdbc%' the response result is 0 . any changes i need to do from clickhouse DB side ?
s
Is your failed to scrape fixed? I was requesting you to fix the failed to scrape. How does this cross checking or anything about the ClickHouse help if there is no data collected?
r
i was trying to fix those scrape i have a doubt in this prometheus: config: scrape_configs: - job_name: "otel-collector" scrape_interval: 60s static_configs: - targets: ["otel-collector:8889"] - job_name: "jvm-metrics" scrape_interval: 10s metrics_path: "/actuator/prometheus" static_configs: - targets: ["<IP of the machine:8090>"] here i should provide our service details or it should prometheus details
please help in me fixing failed to scrape , any hint like where to check
s
It should be the endpoint of your service which is emitting the metrics. For example, if your application is running on some host
10.53.34.50
and port
8090
you can verify if it emits metrics by curling with
curl <http://10.52.34.50:8090/actuator/prometheus>
. And since there is already
metric_path: "/actuator/prometheus"
covered in config, in the target you just need to provide
host:port
where port is
8090
and
host
is the host address where application service is running.
r
eventhough it is showing failing to scrape , i am able to get other metrics except jdbc and hikari
can u give me hint , that were i need to check failed to scrape
s
eventhough it is showing failing to scrape , i am able to get other metrics except jdbc and hikari
The jdbc and hikari metrics are coming from the micrometer and need to be scraped. The rest of the metrics could be coming from OTLP.
can u give me hint , that were i need to check failed to scrape
This is mostly like a network issue. Please make sure the host and port are correct and are reachable to the SigNoz collector.
r
host and port are correct i am able to reach to the service from otel collector . whether I need to any dependency regarding micrometer in my pom.xml
and we are using signoz 0.8.2 version is jdbc and hikari metrics available for that version
i tried by adding some dependency in my pom.xml
Copy code
<dependency>
   <groupId>io.opentelemetry</groupId>
   <artifactId>opentelemetry-api</artifactId>
</dependency>
<dependency>
   <groupId>io.opentelemetry</groupId>
   <artifactId>opentelemetry-api-metrics</artifactId>
   <version>1.9.1-alpha</version>
</dependency>
curl -X GET 10.53.34.50:3774/alpha-transformation-ms/actuator/prometheus and i am able to run this for checking whether service is reachable or not
s
The
metrics_path
in the configuration then should be
/alpha-transformation-ms/actuator/prometheus
r
yes same i given in config,yml also
s
If you run
curl -X GET 10.53.34.50:3774/alpha-transformation-ms/actuator/prometheus
from the collector host, does it resolve and return any data? Did you have the micrometer setup
r
yes i am able to get data from the curl , regarding micrometer we have added only dependency in out spring application based on the docs
any other things i need to configure regarding micrometer apart from this ?
is htrod and load-htrod service is mandatory one ?