Hi im trying to get metrics for my postgresql Im ...
# support
d
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
@Srikanth Chekuri Can you please have a look to this. Thank you.
d
any ideas?
s
Are you sure postgres metrics are getting collected properly? Do you see any error logs in collector container?
d
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
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
yes one sec
Screenshot 2024-01-23 at 16.24.01.png
s
Copy code
SELECT toDateTime(intDiv(max(timestamp_ms), 1000)) from signoz_metrics.distributed_samples_v2 WHERE metric_name like '%postgres%';
d
Screenshot 2024-01-23 at 16.25.49.png
s
Can you select the longer time range 6hrs in charts and check again?
d
no data still
Screenshot 2024-01-23 at 16.27.41.png
even in 1 week range
s
Copy code
SELECT count() from signoz_metrics.distributed_time_series_v2 WHERE metric_name like '%postgres%';
d
Screenshot 2024-01-23 at 16.29.59.png
s
Copy code
SELECT * from signoz_metrics.distributed_time_series_v2 WHERE metric_name like '%postgres%';
Can you share output
d
yes, but i will remove db names
Screenshot 2024-01-23 at 16.33.43.png
s
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
https://signoz.io/blog/opentelemetry-postgresql-metrics-monitoring/#metrics I wonder why these metrics are not enabled by default