Run Edge locally with a file-backed policy, send two test logs, and verify Edge drops the debug log and forwards the error log.
Prefer an AI assistant to walk you through this? Run npx skills add https://docs.usetero.com to add these docs as a skill in Claude Code, Codex, or Cursor. Then ask questions like “how do I run Edge locally?” and your agent guides you using Tero’s documentation.
Before you begin
You need:
- Docker
- A Datadog intake endpoint and API key for your region
- A working directory for the quickstart files
This tutorial uses the Datadog distribution because it gives us a concrete log endpoint to test.
1. Create the Edge configuration
Create config.json:
{
"listen_address": "127.0.0.1",
"listen_port": 8080,
"upstream_url": "https://http-intake.logs.datadoghq.com",
"metrics_url": "https://api.datadoghq.com",
"log_level": "info",
"policy_providers": [
{
"id": "local",
"type": "file",
"path": "/etc/edge/policies.json"
}
]
}
If your Datadog account uses another region, replace upstream_url and metrics_url with the endpoints from Edge Datadog.
You now have a local Edge listener on port 8080 and a file policy provider.
2. Create a policy
Create policies.json:
{
"policies": [
{
"id": "drop-debug-logs",
"name": "Drop debug logs",
"log": {
"match": [
{
"log_field": "status",
"regex": "^(debug|trace|DEBUG|TRACE)$"
}
],
"keep": "none"
}
}
]
}
This policy matches Datadog log records whose status field is debug or trace. Edge drops matching logs.
3. Run Edge
Run the Datadog distribution:
docker run --name tero-edge-quickstart --rm \
-p 8080:8080 \
-e DD_API_KEY="$DD_API_KEY" \
-v "$(pwd)/config.json:/etc/edge/config.json" \
-v "$(pwd)/policies.json:/etc/edge/policies.json" \
ghcr.io/usetero/edge-datadog:latest \
/etc/edge/config.json
Leave this terminal running.
You should see Edge start and load the local policy provider.
4. Send a debug log
In another terminal, send a debug log to Edge:
curl -X POST http://localhost:8080/api/v2/logs \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
[
{
"message": "quickstart debug log",
"status": "debug",
"service": "edge-quickstart"
}
]
JSON
Edge should accept the request. Because the policy matches status: debug, Edge should drop the log before forwarding.
5. Send an error log
Send an error log to the same endpoint:
curl -X POST http://localhost:8080/api/v2/logs \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
[
{
"message": "quickstart error log",
"status": "error",
"service": "edge-quickstart"
}
]
JSON
This log should pass through because it does not match the policy.
6. Check Edge output
Return to the terminal running Edge.
You should see activity for the incoming requests. The debug request should show a policy match or dropped-log activity. The error request should show forwarding activity.
If Edge forwards both requests, confirm that policies.json is mounted at /etc/edge/policies.json and that the policy matches the status field.
What you ran
You ran Edge locally, loaded one file-backed policy, sent two logs through Edge, and verified the policy decision.
That is the basic Edge loop: receive telemetry, match policies, apply the keep decision, and forward the result.
Next steps