Skip to content

DataDog Oracle custom_query: Only float values can be submitted as metrics

Errors in log

2021-12-30 13:07:02 UTC | CORE | WARN | (pkg/collector/python/datadog_agent.go:124 in LogMessage) | oracle:9eb61efa95cfcc8c | (base.py:580) | Metric: 'test.table_rows.rowcount' has non float value: 'ITEMS'. Only float values can be submitted as metrics.

Configuration with issue

instances:
  - custom_queries:
    - metric_prefix: test.table_rows        
      query: select table_name, regexp_replace(to_char(nvl(num_rows,-1), '99999999999.9'),'
            ', '') rowcount from all_tables where owner='TEST'
      columns:
        - name: rowcount
          nype: gauge
        - name: table_name
          type: tag

Solution:

Set first field as field with value:

select (...) rowcount, table_name from ...