Monit metrics with Telegraf

Telegraf provides an integration with Monit using the Monit input plugin. Telegraf collects the metrics from the HTTP endpoint that Monit exposes, processes them, and sends them to Cloud Observability using the OpenTelemetry output plugin.

To complete the integration, you will:

  • Configure Telegraf to ingest metrics from Monit
  • Configure the OpenTelemetry output plugin

Configure the Telegraf Monit input plugin

In the Telegraf configuration file, add configuration for the address where Monit serves metrics from, along with a username and password. You can find complete configuration details in the official Monit plugin documentation.

This example configuration uses the default username and password for new installations.

1
2
3
4
[[inputs.monit]]
  address = "http://localhost:2812"
  username = "admin"
  password = "monit"

Configure the OpenTelemetry output plugin

To deliver metrics to Cloud Observability you configure the Telegraf OpenTelmetry output plugin. This plugin sends metrics to Cloud Observability using gRPC.

This example shows the plugin configured without TLS:

1
2
3
4
5
6
7
8
[[outputs.opentelemetry]]
  service_address = "ingest.lightstep.com:443" # US data center
  # service_address = "ingest.eu.lightstep.com:443" # EU data center
  insecure_skip_verify = true

  # Additional gRPC request metadata
  [outputs.opentelemetry.headers]
    lightstep-access-token = "$LS_ACCESS_TOKEN"

For more details regarding configuring the OpenTelemetry output plugin see the official Telegraf documentation.

Validate metrics are reporting to Cloud Observability

You can validate that metrics are reporting to Cloud Observability on the Metrics details page in Settings.

  1. In Cloud Observability, click Settings > Metric details.

  2. Search for Monit metric names. Search for metric

See the Monit input plugin documentation for a complete list of emitted metrics.

  1. If needed, select the metric to edit the description and how the units are displayed in Cloud Observability.

View metrics in Cloud Observability

After you have Cloud Observability ingesting metrics from Monit, you can use the Cloud Observability Terraform Provider to create a dashboard for the metrics.

Additional resources

See also

Create and manage dashboards

Updated Dec 1, 2022