How do I get Kubernetes events into an AI SRE?
Tares has no connector of its own for Kubernetes events today, but you can still get them in through three routes. Forward the events as JSON to the webhook connector, poll an endpoint that serves them with http_poll, or send them over OpenTelemetry to the otlp connector. Once they arrive, they are events in Tares like any other and correlate by label alongside your other sources.
How it works
Pick the route that matches what you already run in the cluster.
- Webhook connector. Anything that can send an HTTP request can POST JSON, one object, a list or NDJSON, to the source’s ingest URL. Tares stores the payload lossless. You declare labels that map payload fields into the event, and one label is marked
primary. Read more on the webhook connector page. - http_poll connector. If something in your setup already serves events as JSON over HTTP, Tares polls that URL on a schedule and turns each item into one event. You set the URL, an event type and a text template. If the endpoint needs a credential, you give it a credential and the header name to send it in.
- OpenTelemetry. If your cluster already runs an OpenTelemetry Collector, point it at Tares. The OTLP connector receives OTLP/HTTP logs, traces and metrics at
/v1/logs,/v1/tracesand/v1/metrics, and optionally OTLP/gRPC. One source ingests every service, and resource attributes become labels.
For the webhook and OTLP routes, the sender uses a Bearer Authorization header holding an ingest-scoped API key. You need it only when Tares has auth on.
Whichever route you use, labels are what tie events together. Your AI SRE works from those labels when it correlates events across sources.
Set it up
-
Start Tares locally and open the console.
tares up -
Choose a route. For the webhook route, go to Sources, Add source, webhook, declare a label for each payload field you want to correlate on, and mark one
primary. Save, then copy the ingest endpoint from the source page. This example comes from the webhook connector page. Swap in the fields your forwarder sends.- name: ci-events connector: webhook config: event_type_field: action text_template: '{action} by {sender}' labels: - { name: pipeline, field: pipeline, primary: true } -
Point your forwarder at the ingest URL. It POSTs JSON to
/ingest/followed by your ingest key. You can try the endpoint by hand first:curl -X POST http://localhost:8787/ingest/<ingest_key> \ -H 'Content-Type: application/json' \ -d '{"action": "deploy", "sender": "ci", "pipeline": "web"}' -
For the http_poll route, add a source with the
http_pollconnector, seturlto the endpoint that serves your events, and setevent_typeandtext_template. Tares then creates one event per item at each poll. The default interval is 5 minutes. -
For the OpenTelemetry route, add an
otlpsource. The service label reads fromresourceAttributes.service.name. A label withfield: servicegets no value from an OTLP event, so use the full path.- name: otel connector: otlp config: labels: - { name: service, field: resourceAttributes.service.name, primary: true }Then point the exporter or Collector at Tares:
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:8787 # OTLP/HTTP → /v1/{logs,traces,metrics} # or gRPC (otlp-grpc extra): OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4317 -
To join Kubernetes events with OTLP data, give both sources a label with the same name,
service, and mark itprimaryon both. On the webhook source, map that label from the field in your payload that names the service. On the OTLP source, useresourceAttributes.service.nameas shown above. -
Verify. Open Recent events on the source to see events as they arrive. On a webhook source, Fields shows which payload fields arrive and how often, which helps you pick a reliable label key. On an OTLP source, Explore lists services under the
servicekey.
What you get
- Kubernetes events that arrive as ordinary Tares events, stored lossless on the webhook route, with the labels you declare.
- One source for every service on the OTLP route, with no per-service setup.
- A shared
servicelabel across sources, so events from different routes line up for the same service. - Your AI SRE reads these events with everything else you have connected, instead of living in a separate tool.
When something else fits
- Use the webhook route when you already have something that can POST JSON on each event. It is the most direct path and the payload shape is yours.
- Use http_poll when the events sit behind an HTTP endpoint you can read and nothing can push them. You get a poll interval, not instant delivery.
- Use OTLP when your cluster already runs an OpenTelemetry Collector and you want logs, traces and metrics to travel together.
Related
Still stuck? Get help