Skip to main content
Apply Tero policies to logs passing through your OpenTelemetry Collector. Three options—pick what fits your environment.
OptionBest for
Tero DistroNew deployments or replacing your existing collector
Edge ProxyAdding to an existing collector without rebuilding
Policy ProcessorCustom collector distributions you build yourself
Run the Tero Collector—a pre-built OpenTelemetry Collector distribution with the Policy Processor included.

How it works

The Tero Collector is a standard OTel Collector with our Policy Processor baked in. Deploy it like any collector, configure policies, and it filters logs before they reach your backend.The Policy Processor supports three actions:
  • Drop — Remove logs matching patterns
  • Keep — Retain only logs matching patterns
  • Sample — Probabilistically sample at configurable rates
Policies hot-reload without restarting the collector.

Included components

The Tero Collector includes standard OTel components:
TypeComponents
ReceiversOTLP (gRPC, HTTP)
ProcessorsPolicy, Batch, Memory Limiter, Attributes, Filter, Resource
ExportersDebug, OTLP (gRPC, HTTP)
ConnectorsForward
ExtensionsHealth Check v2, zPages, PProf, Basic Auth, Bearer Token Auth

Prerequisites

  • Docker or Kubernetes cluster
  • Tero account

Deploy

1

Create an API key

Open your terminal and run:
tero
Navigate to EdgeAPI KeysCreate. Name your key (e.g., “Tero Collector”). Copy the key when shown—it’s only displayed once.
2

Deploy the collector

Create a collector config:
config.yaml
receivers:
  otlp:
    protocols:
      grpc:
        endpoint: 0.0.0.0:4317
      http:
        endpoint: 0.0.0.0:4318

processors:
  policy:
    providers:
      - type: http
        id: tero
        url: https://sync.usetero.com/v1/policy/sync
        headers:
          - name: Authorization
            value: Bearer ${TERO_API_KEY}
        poll_interval_secs: 60

exporters:
  otlphttp:
    endpoint: https://your-backend-endpoint.com

service:
  pipelines:
    logs:
      receivers: [otlp]
      processors: [policy]
      exporters: [otlphttp]
Run the collector:
docker run --rm -p 4317:4317 -p 4318:4318 \
  -e TERO_API_KEY=YOUR_API_KEY \
  -v $(pwd)/config.yaml:/etc/tero-collector/config.yaml:ro \
  ghcr.io/usetero/tero-collector-distro:latest
3

Verify

Check the container is running:
docker ps | grep tero-collector
Check logs for policy sync:
docker logs <container-id> 2>&1 | grep -i policy

Policy providers

Configure where the collector loads policies from.

File provider

Load from a local file. Good for static policies or GitOps workflows.
processors:
  policy:
    providers:
      - type: file
        id: local
        path: /etc/tero-collector/policies.json
        poll_interval_secs: 30

HTTP provider

Fetch from a remote endpoint. Good for dynamic policies managed via Tero.
processors:
  policy:
    providers:
      - type: http
        id: tero
        url: https://sync.usetero.com/v1/policy/sync
        headers:
          - name: Authorization
            value: Bearer ${TERO_API_KEY}
        poll_interval_secs: 60

Example policies

Policies use JSON format. Here are common patterns:
{
  "policies": [
    {
      "id": "drop-debug-logs",
      "name": "drop-debug-logs",
      "enabled": true,
      "log": {
        "match": [{ "log_field": "severity_text", "regex": "DEBUG" }],
        "keep": "none"
      }
    },
    {
      "id": "sample-noisy-service",
      "name": "sample-noisy-service",
      "enabled": true,
      "log": {
        "match": [
          { "resource_attribute": "service.name", "regex": "noisy-service" }
        ],
        "sample_rate": 0.1
      }
    },
    {
      "id": "keep-errors",
      "name": "keep-errors",
      "enabled": true,
      "log": {
        "match": [
          { "log_field": "severity_text", "regex": "ERROR" },
          { "log_field": "severity_text", "regex": "CRITICAL" }
        ],
        "keep": "all"
      }
    }
  ]
}
See Policy Reference for all filtering options.

Troubleshooting

Collector won’t start Check the config syntax:
./collector --config config.yaml --dry-run
Policies not loading Verify the policy file path is correct and the file is valid JSON. Check collector logs for policy-related errors. CGO build errors (Policy Processor) Ensure Hyperscan/Vectorscan is installed and CGO_ENABLED=1 is set. On macOS, you may need to set PKG_CONFIG_PATH:
export PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:$PKG_CONFIG_PATH"