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

Danya Lutsevich

01/22/2024, 3:35 PM
Hi im trying to get metrics for my postgresql Im using self hosted version of signoz and i've tried adding
Copy code
postgres:  
    endpoint: <POSTGRESQL_URL>:<POSTGRESQL_PORT>
    username: <POSTGRESQL_USERNAME>
    password: <POSTGRESQL_PASSWORD>
  postgresql/all:
    endpoint: <POSTGRESQL_URL>:<POSTGRESQL_PORT>
    transport: tcp
        username: <POSTGRESQL_USERNAME>
    password: <POSTGRESQL_PASSWORD>
    databases:
      - <YOUR DATABASE 1>
      - <YOUR DATABASE 2>
            # ... All databases you want to monitor
    collection_interval: 10s
    tls:
      insecure: true
      insecure_skip_verify: true
in otel-collector-config.yaml but it didn't help. Also I've set postgres in receivers section
Copy code
service:
  telemetry:
    metrics:
      address: localhost:8888
  pipelines:
    metrics:
      receivers: [postgresql, postgresql/all]
      processors: [batch]
      exporters: [otlp]
this is my current otel config https://www.otelbin.io/s/1013ce74508abb2ff15c4e44482fca5014423e0d I still have empty dashboard. I restarted docker container with the collector after i updated config. I imported postgres dashboard from here https://github.com/SigNoz/dashboards/blob/main/postgresql/postgresql.json What am i doing wrong.
r

Rajat Dabade

01/22/2024, 7:10 PM
@Srikanth Chekuri Can you please have a look to this. Thank you.
d

Danya Lutsevich

01/23/2024, 2:09 PM
any ideas?
s

Srikanth Chekuri

01/23/2024, 2:13 PM
Are you sure postgres metrics are getting collected properly? Do you see any error logs in collector container?
d

Danya Lutsevich

01/23/2024, 2:18 PM
no error logs, i saw errors when i accidentally typed unwanted space in otel-config.yaml, i got syntax error but now syntax is ok
s

Srikanth Chekuri

01/23/2024, 2:22 PM
Can you exec into clickhouse and check it there are prostgres metrics there?
Copy code
SELECT count() from signoz_metrics.distributed_samples_v2 WHERE metric_name like '%postgres%';
d

Danya Lutsevich

01/23/2024, 2:22 PM
yes one sec
Screenshot 2024-01-23 at 16.24.01.png
s

Srikanth Chekuri

01/23/2024, 2:25 PM
Copy code
SELECT toDateTime(intDiv(max(timestamp_ms), 1000)) from signoz_metrics.distributed_samples_v2 WHERE metric_name like '%postgres%';
d

Danya Lutsevich

01/23/2024, 2:26 PM
Screenshot 2024-01-23 at 16.25.49.png
s

Srikanth Chekuri

01/23/2024, 2:26 PM
Can you select the longer time range 6hrs in charts and check again?
d

Danya Lutsevich

01/23/2024, 2:27 PM
no data still
Screenshot 2024-01-23 at 16.27.41.png
even in 1 week range
s

Srikanth Chekuri

01/23/2024, 2:29 PM
Copy code
SELECT count() from signoz_metrics.distributed_time_series_v2 WHERE metric_name like '%postgres%';
d

Danya Lutsevich

01/23/2024, 2:30 PM
Screenshot 2024-01-23 at 16.29.59.png
s

Srikanth Chekuri

01/23/2024, 2:30 PM
Copy code
SELECT * from signoz_metrics.distributed_time_series_v2 WHERE metric_name like '%postgres%';
Can you share output
d

Danya Lutsevich

01/23/2024, 2:31 PM
yes, but i will remove db names
Screenshot 2024-01-23 at 16.33.43.png
s

Srikanth Chekuri

01/23/2024, 2:37 PM
Ok, you don't have any metrics in the table that are used in the dashboard. There is only a table and db count. Please check why other metrics are not getting collected.
d

Danya Lutsevich

01/23/2024, 2:53 PM
https://signoz.io/blog/opentelemetry-postgresql-metrics-monitoring/#metrics I wonder why these metrics are not enabled by default