Grafana agent refuses to scrape metrics

I am trying to configure a docker grafana-agent to scrape logs from a custom service. No matter what I do grafana-agent seems to ignore the scrape job and never actually requests the metrics page.

Here’s my configuration

server:
  log_level: info
metrics:
  global:
    scrape_interval: 1m
  configs:
    - name: pvdbmetrics
      scrape_configs:
        - job_name: pvdbmetrics
          static_configs:
            - targets: ['pvdb-metrics:2112']
      remote_write:
        - url: https://prometheus-us-central1.grafana.net/api/prom/push
          basic_auth:
            password: <redacted>
            username: <redacted>
integrations:
  node_exporter:
    enabled: true
  prometheus_remote_write:
  - basic_auth:
      password: <redacted>
      username: <redacted>
    url: https://prometheus-us-central1.grafana.net/api/prom/push
  postgres_exporter:
    enabled: true
    data_source_names:
      - <redacted>

the pvdb-metrics:2112/metrics route never gets hit. What am I doing wrong?

Hello! I don’t see any immediate issues based on the Agent configuration file. Some other things to check for more insight are:

  • Are the metrics exposed at the target ‘pvdb-metrics:2112’ in a Prometheus-compatible format? As in, are you using some Prometheus exporter for this? See Agent metrics config docs.

  • Is the pvdbmetrics job the only job missing metrics? Is the node exporter integration working fine? That integration should create some pre-configured dashboards to quickly confirm.

  • Any issues with the Grafana Agent service itself? Is the service active/running?

  • Are there any messages in your system logs to give further details about the issue? See common errors in Troubleshooting Grafana Agent docs.