2 years ago

#69573

test-img

Alex Iron

How to configure DATADOG agent .../postgres.d/conf.yaml with multiple custom_queries (SELECT statements)

It works with one SELECT statement but did not with two.

   custom_queries:
    - metric_prefix: mars
      query: SELECT substring(query, 1, 50) AS query, round(total_time::numeric, 2) AS total_time, calls, round(mean_time::numeric, 2) AS mean, round((100 * total_time / sum(total_time::numeric) OVER ())::numeric, 2) AS percentage_cpu FROM pg_stat_statements ORDER BY total_time DESC LIMIT 25
      columns:
        - name: query
          type: tag
        - name: total_time
          type: gauge
        - name: calls
          type: gauge
        - name: mean
          type: gauge
        - name: percentage_cpu
          type: gauge
      tags:
        - query:cpu
    - metric_prefix: venus
      query: SELECT count(*) AS csum FROM pg_stat_statement
      columns:
        - name: csum
          type: gauge
      tags:
        - query:sum

It passed the checks, datadig-agent status output is clear, but the datadog main menu Metric --> Explore does not show the csum metric.

postgresql

amazon-web-services

amazon-rds

amazon-aurora

datadog

0 Answers

Your Answer

Accepted video resources