statusas docs
Guides

How to Export Metrics to an OTLP Endpoint

A step-by-step guide to sending statusas metrics to your observability platform via OTLP.

Problem

You want to analyze your statusas monitoring data alongside other telemetry data in your existing observability platform (like Grafana, New Relic, or Honeycomb). You need a standardized way to export these metrics without building a custom integration.

Solution

statusas can export monitoring metrics to any OTLP (OpenTelemetry Protocol) compatible endpoint. Add an open_telemetry block to a monitor in your Terraform configuration and metrics from every check that monitor runs are sent straight to your monitoring stack.

Prerequisites

  • An observability platform that supports OTLP metric ingestion over HTTP.
  • A workspace on a plan that includes OTLP export (Pro and Scale).
  • Terraform and the statusas provider configured — see Manage statusas with Terraform if you have not set it up yet.

Step-by-step guide

1. Locate your OTLP endpoint URL and headers

First, you need to find the specific URL and any required authentication headers from your observability platform. This is usually found in the documentation under "OTLP", "OpenTelemetry", or "Metrics Export".

  • Endpoint URL — look for an HTTP endpoint for OTLP metrics. It typically ends in /v1/metrics. For example: https://otlp.your-provider.com/v1/metrics.
  • Headers — you will likely need an authentication header, such as Authorization: Bearer YOUR_API_KEY or X-API-Key: YOUR_API_KEY.

2. Add an open_telemetry block to your monitor

open_telemetry is a block on the monitor resource, so each monitor declares its own export target. It is available on every monitor type — openstatus_http_monitor, openstatus_tcp_monitor, openstatus_dns_monitor, and openstatus_icmp_monitor.

variable "otlp_token" {
  type      = string
  sensitive = true
}

resource "openstatus_http_monitor" "api" {
  name        = "API Health Check"
  url         = "https://api.example.com/health"
  periodicity = "1m"
  active      = true
  regions     = ["fly-iad", "fly-ams"]

  open_telemetry {
    endpoint = "https://otlp.your-provider.com/v1/metrics"

    headers {
      key   = "Authorization"
      value = "Bearer ${var.otlp_token}"
    }
  }
}

Mark the token sensitive and pass it in with TF_VAR_otlp_token or from a secrets manager rather than committing it.

Note: Currently, we only support OTLP over HTTP.

3. Share one endpoint across many monitors

Because the block lives on each resource, put the endpoint and headers in a locals block and use dynamic so a change to the destination is a one-line edit rather than a sweep across every monitor:

locals {
  otlp_endpoint = "https://otlp.your-provider.com/v1/metrics"
  otlp_headers = {
    Authorization = "Bearer ${var.otlp_token}"
  }
}

resource "openstatus_http_monitor" "api" {
  name        = "API Health Check"
  url         = "https://api.example.com/health"
  periodicity = "1m"
  active      = true
  regions     = ["fly-iad", "fly-ams"]

  open_telemetry {
    endpoint = local.otlp_endpoint

    dynamic "headers" {
      for_each = local.otlp_headers
      content {
        key   = headers.key
        value = headers.value
      }
    }
  }
}

4. Apply the configuration

terraform plan    # confirm only the open_telemetry block is changing
terraform apply

Once applied, statusas sends metrics to your endpoint after every check completes.

5. Verify in your observability platform

Go to your observability platform and look for the new metrics coming from statusas. You should be able to build dashboards and alerts based on this data.

Here are some examples of what it can look like:

Grafana

statusas metrics in grafana

Honeycomb

statusas metrics in honeycomb

New Relic

statusas metrics in new-relic

SigNoz

statusas metrics in signoz

On this page