#support

Unable to Monitor jdbc_connections_active Metrics in SigNoz

TLDR Ragulraj is unable to monitor jdbc_connections_active metrics with SigNoz despite modifying configurations and adding dependencies. Srikanth provided troubleshooting steps and info on alternatives, but the issue remains unresolved.

Powered by Struct AI
Apr 13, 2023 (5 months ago)
Ragulraj
Photo of md5-a9a351e11d64f05b41fec183816a0cda
Ragulraj
04:01 AM
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
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
06:20 AM
> 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?
06:23
Srikanth
06:23 AM
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
Ragulraj
Photo of md5-a9a351e11d64f05b41fec183816a0cda
Ragulraj
07:15 AM
#!/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 ?
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
07:18 AM
> 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.

>
Dotel.metrics.exporter=none

Remove this if you want metrics. If this is from our docs/blogs we will get it updated.
Ragulraj
Photo of md5-a9a351e11d64f05b41fec183816a0cda
Ragulraj
09:49 AM
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
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
10:01 AM
You can monitor all of the mentioned metrics.
Ragulraj
Photo of md5-a9a351e11d64f05b41fec183816a0cda
Ragulraj
11:33 AM
still i am not able to monitor db_client_connections_usage , after removing the above configuration
Image 1 for still i am not able to monitor db_client_connections_usage , after removing the above configuration
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
11:35 AM
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.
Ragulraj
Photo of md5-a9a351e11d64f05b41fec183816a0cda
Ragulraj
11:37 AM
even if i run query only with metrics name i am not getting
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
11:39 AM
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.
Ragulraj
Photo of md5-a9a351e11d64f05b41fec183816a0cda
Ragulraj
11:41 AM
Ok i ll check
01:04
Ragulraj
01:04 PM
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
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
01:06 PM
> failed to scrape prometheus endpoint
You need to fix this. Make sure the endpoint you are configuring is correct and reachable by collector.
Apr 14, 2023 (5 months ago)
Ragulraj
Photo of md5-a9a351e11d64f05b41fec183816a0cda
Ragulraj
07:24 AM
i crosschecked with some query in clickhouse DB -> SELECT name FROM ( SELECT DISTINCT JSONExtractString(labels, 'name') AS name FROM signozmetrics.timeseries) 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 ?
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
07:43 AM
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?
Ragulraj
Photo of md5-a9a351e11d64f05b41fec183816a0cda
Ragulraj
09:34 AM
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
11:37
Ragulraj
11:37 AM
please help in me fixing failed to scrape , any hint like where to check
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
11:53 AM
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.
Apr 17, 2023 (5 months ago)
Ragulraj
Photo of md5-a9a351e11d64f05b41fec183816a0cda
Ragulraj
10:04 AM
eventhough it is showing failing to scrape , i am able to get other metrics except jdbc and hikari
10:05
Ragulraj
10:05 AM
can u give me hint , that were i need to check failed to scrape
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
11:17 AM
> 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.
Apr 18, 2023 (5 months ago)
Ragulraj
Photo of md5-a9a351e11d64f05b41fec183816a0cda
Ragulraj
10:11 AM
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
10:33
Ragulraj
10:33 AM
and we are using signoz 0.8.2 version is jdbc and hikari metrics available for that version
10:50
Ragulraj
10:50 AM
i tried by adding some dependency in my pom.xml
<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>

10:56
Ragulraj
10:56 AM
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
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
12:25 PM
The metrics_path in the configuration then should be /alpha-transformation-ms/actuator/prometheus
Ragulraj
Photo of md5-a9a351e11d64f05b41fec183816a0cda
Ragulraj
12:36 PM
yes same i given in config,yml also
Srikanth
Photo of md5-ce04a9988e2fd758a659dc55be6f2543
Srikanth
12:51 PM
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
Apr 19, 2023 (5 months ago)
Ragulraj
Photo of md5-a9a351e11d64f05b41fec183816a0cda
Ragulraj
03:43 AM
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
Image 1 for 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
03:43
Ragulraj
03:43 AM
any other things i need to configure regarding micrometer apart from this ?
04:00
Ragulraj
04:00 AM
is htrod and load-htrod service is mandatory one ?