Skip to main content
Edge OTLP is optimized for environments using OpenTelemetry. It supports the standard OTLP HTTP endpoints for logs and metrics.

Supported Endpoints

EndpointMethodDescription
/v1/logsPOSTOTLP log export
/v1/metricsPOSTOTLP metrics export
/healthGETHealth check

Configuration

config.json
{
  "listen_address": "0.0.0.0",
  "listen_port": 8080,
  "upstream_url": "https://your-otlp-endpoint.com",
  "log_level": "info",
  "policy_providers": [
    {
      "id": "local",
      "type": "file",
      "path": "policies.json"
    }
  ]
}

Vendor Endpoints

Configure upstream_url for your observability vendor:
VendorEndpoint
Datadoghttps://otlp.datadoghq.com (or regional variant)
Honeycombhttps://api.honeycomb.io
Grafana Cloudhttps://otlp-gateway-prod-us-central-0.grafana.net/otlp
New Relichttps://otlp.nr-data.net
Lightstephttps://ingest.lightstep.com

Running

docker run -d \
  --name edge-otlp \
  -p 8080:8080 \
  -v $(pwd)/config.json:/etc/edge/config.json \
  -v $(pwd)/policies.json:/etc/edge/policies.json \
  ghcr.io/usetero/edge-otlp:latest \
  /etc/edge/config.json

OpenTelemetry Collector Configuration

Configure the OpenTelemetry Collector to export through Edge.

As an Exporter

otel-collector-config.yaml
exporters:
  otlphttp:
    endpoint: "http://edge-host:8080"
    compression: gzip

service:
  pipelines:
    logs:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp]
    metrics:
      receivers: [otlp]
      processors: [batch]
      exporters: [otlphttp]

SDK Direct Export

For applications using the OpenTelemetry SDK directly:
export OTEL_EXPORTER_OTLP_ENDPOINT="http://edge-host:8080"
export OTEL_EXPORTER_OTLP_PROTOCOL="http/json"

OTLP Data Model

Edge works with the standard OTLP data model. Here’s how OTLP fields map to policy matchers.

Log Records

OTLP FieldPolicy Matcher
bodylog_field: body
severityTextlog_field: severity_text
severityNumberlog_field: severity_number
attributeslog_attribute: <key>
resource.attributesresource_attribute: <key>
scope.namescope_name
scope.versionscope_version
scope.attributesscope_attribute: <key>

Metrics

OTLP FieldPolicy Matcher
namemetric_field: name
descriptionmetric_field: description
unitmetric_field: unit
dataPoints[].attributesdatapoint_attribute: <key>
resource.attributesresource_attribute: <key>

Example Policies

Filter by Severity

{
  "id": "drop-debug-trace",
  "name": "Drop DEBUG and TRACE logs",
  "log": {
    "match": [{ "log_field": "severity_text", "regex": "^(DEBUG|TRACE)$" }],
    "keep": "none"
  }
}

Filter by Resource Attribute

{
  "id": "sample-api-gateway",
  "name": "Sample API Gateway logs",
  "log": {
    "match": [{ "resource_attribute": "service.name", "exact": "api-gateway" }],
    "keep": "25%"
  }
}

Filter by Log Attribute

{
  "id": "drop-healthcheck",
  "name": "Drop health check spans",
  "log": {
    "match": [{ "log_attribute": "http.route", "exact": "/health" }],
    "keep": "none"
  }
}

Filter by Scope

{
  "id": "drop-library-logs",
  "name": "Drop logs from noisy library",
  "log": {
    "match": [
      {"scope_name": "exact": "noisy-http-client"}
    ],
    "keep": "none"
  }
}

Redact Sensitive Attributes

{
  "id": "redact-pii",
  "name": "Redact PII from logs",
  "log": {
    "match": [{ "log_attribute": "user.email", "exists": true }],
    "transform": {
      "redact": [{ "log_attribute": "user.email" }]
    }
  }
}

Request Format

Edge expects OTLP JSON format (application/json). Example log export request:
{
  "resourceLogs": [
    {
      "resource": {
        "attributes": [
          { "key": "service.name", "value": { "stringValue": "my-service" } }
        ]
      },
      "scopeLogs": [
        {
          "scope": {
            "name": "my-library",
            "version": "1.0.0"
          },
          "logRecords": [
            {
              "timeUnixNano": "1234567890000000000",
              "severityText": "INFO",
              "body": { "stringValue": "Hello, world!" },
              "attributes": [
                { "key": "user.id", "value": { "stringValue": "12345" } }
              ]
            }
          ]
        }
      ]
    }
  ]
}

Compression

Edge supports gzip compression for both incoming requests and outgoing requests. Set the Content-Encoding: gzip header for compressed requests.

Next Steps