Generic Exporter

Marcus Boden Publisher

Platform:

Ubuntu
26.04 24.04 22.04 20.04
Channel Revision Published Runs on
dev/edge 89 25 Aug 2026
Ubuntu 26.04 Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
dev/edge 88 25 Aug 2026
Ubuntu 26.04 Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
dev/edge 87 25 Aug 2026
Ubuntu 26.04 Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
dev/edge 86 25 Aug 2026
Ubuntu 26.04 Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
dev/edge 85 25 Aug 2026
Ubuntu 26.04 Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
dev/edge 84 25 Aug 2026
Ubuntu 26.04 Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
dev/edge 83 25 Aug 2026
Ubuntu 26.04 Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
dev/edge 82 20 Aug 2026
Ubuntu 26.04 Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
dev/edge 81 20 Aug 2026
Ubuntu 26.04 Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
dev/edge 80 20 Aug 2026
Ubuntu 26.04 Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
dev/edge 77 19 Aug 2026
Ubuntu 26.04 Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
dev/edge 76 19 Aug 2026
Ubuntu 26.04 Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
dev/edge 74 19 Aug 2026
Ubuntu 26.04 Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
dev/edge 73 19 Aug 2026
Ubuntu 26.04 Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
dev/edge 63 10 Aug 2026
Ubuntu 26.04 Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
dev/edge 55 14 Jul 2026
Ubuntu 26.04 Ubuntu 24.04 Ubuntu 22.04 Ubuntu 20.04
juju deploy generic-exporter --channel dev/edge

Attach alert rules from a resource

This guide describes how to provide custom Prometheus alert rules to the Generic Exporter operator using a Juju resource. The charm will:

  • Read the attached resource file (YAML)
  • Write it into an alerts rules directory under /run/<app>-<unit-id>/
  • Expose those rules via the cos-agent relation to Grafana Agent and COS Lite

Requirements

  • Generic Exporter operator deployed and running.
  • (Optional) Opentelemetry Collector and COS Lite are already integrated, as described in the previous how-to.

Prepare an alerts resource

Create a local file alerts.yaml containing one or more Prometheus alerting rules. For example:

groups:
  - name: generic-exporter.rules
    rules:
      - alert: ExporterDown
        expr: up{job="node-exporter"} == 0
        for: 5m
        labels:
          severity: warning
        annotations:
          summary: "Exporter is down on {{ $labels.instance }}"
          description: "The node-exporter exporter has not been scraping successfully for 5 minutes."

Ensure the file is valid YAML and follows Prometheus alert rule syntax.

Attach the resource

Attach the resource to the Generic Exporter application. Assuming the app is called node-exporter:

juju attach-resource node-exporter alerts=./alerts.yaml

The charm will:

  • Fetch the alerts resource
  • Write it to a rules directory, for example:
    /run/node-exporter-0/alerts.yaml
    
  • Notify Grafana Agent via the cos-agent relation so that alerts are reloaded.

Use the dump-alerts action

To verify which rules the charm has loaded, use the dump-alerts action (provided by the charm):

juju run node-exporter/0 dump-alerts --wait

The action prints the effective path on the machine and dumps the alert rules. This is useful for validating that the uploaded resource is being parsed and consumed correctly.

Update or remove alerts

To update alert rules, modify alerts.yaml and re-attach:

juju attach-resource node-exporter alerts=./alerts.yaml

To effectively remove alerts:

  • Attach an empty rules file, or
  • Use a minimal file that defines an empty rule group.

The charm will refresh the rules directory and inform Grafana Agent via its refresh_events configuration.


Help improve this document in the forum (guidelines). Last updated 6 months ago.