Skip to content
pingwright
Docs menu Logs

Logs, metrics and errors

Logs

Send your services' own logs to Pingwright and they sit next to your checks: when a check goes down, what that service was logging is one click away. Logs come in over OpenTelemetry, so the SDK or Collector you may already run works with a few environment variables.

Logs is a beta feature preview. An owner or admin turns it on under Settings › Feature previews.

Before you start

You need an ingest key (pwi_…). Create one under Settings › Telemetry; it's shown once. The console's get-started page for Logs fills in your key and endpoint for you.

Send logs from a service

Set the standard OpenTelemetry environment variables and restart the service. Any OpenTelemetry SDK reads them.

Shell
export OTEL_EXPORTER_OTLP_ENDPOINT=https://ingest.pingwright.app
export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
export OTEL_EXPORTER_OTLP_HEADERS=authorization=Bearer%20<your-ingest-key>
export OTEL_SERVICE_NAME=checkout-api
export OTEL_RESOURCE_ATTRIBUTES=deployment.environment.name=production
# Traces are not stored yet: don’t send them.
export OTEL_TRACES_EXPORTER=none
export OTEL_LOGS_EXPORTER=otlp

Logs go over OTLP/HTTP to https://ingest.pingwright.app/v1/logs, as protobuf or JSON, optionally gzipped. The key goes in the Authorization: Bearer header.

Go

In Go, the Go client does this in one call and makes slog send to Pingwright:

Shell
go get github.com/Pingwright-Labs/pingwright-go
Go
shutdown, err := pingwright.Init(ctx, pingwright.Options{Service: "checkout-api", Environment: "production"}) // key from PINGWRIGHT_KEY
if err != nil {
	log.Fatal(err)
}
defer shutdown(ctx) // flushes on exit; without a deadline it gives up after 5 seconds

slog.Info("order placed", "order.id", id) // stderr and Pingwright

Send logs from Kubernetes

Run the OpenTelemetry Collector as a DaemonSet with the official Helm chart. It reads every pod's logs from the node, adds the namespace, pod and deployment, and accepts OTLP from apps in the cluster too.

Shell
# 1. The key, as a secret
kubectl create namespace observability
kubectl -n observability create secret generic pingwright-ingest --from-literal=key=<your-ingest-key>

# 2. The Collector
helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
helm upgrade --install otel-collector open-telemetry/opentelemetry-collector \
  -n observability -f values.yaml
values.yaml
mode: daemonset
image:
  repository: otel/opentelemetry-collector-k8s
presets:
  logsCollection:
    enabled: true          # filelog on /var/log/pods
  kubernetesAttributes:
    enabled: true          # k8sattributes: namespace, pod, deployment
extraEnvs:
  - name: PINGWRIGHT_INGEST_KEY
    valueFrom:
      secretKeyRef: { name: pingwright-ingest, key: key }
config:
  receivers:
    otlp:                  # apps in the cluster can send here too
      protocols:
        grpc: { endpoint: ${env:MY_POD_IP}:4317 }
        http: { endpoint: ${env:MY_POD_IP}:4318 }
  processors:
    memory_limiter: { check_interval: 1s, limit_percentage: 80, spike_limit_percentage: 25 }
    resourcedetection: { detectors: [env, eks], timeout: 2s, override: false }
    batch: { send_batch_max_size: 8192 }   # keeps each request well under the per-request limit
  exporters:
    otlphttp/pingwright:
      endpoint: https://ingest.pingwright.app
      headers:
        authorization: "Bearer ${env:PINGWRIGHT_INGEST_KEY}"
  service:
    pipelines:
      logs:
        receivers: [otlp]  # the logsCollection preset adds filelog
        processors: [memory_limiter, resourcedetection, batch]
        exporters: [otlphttp/pingwright]

Kubernetes events (crash loops, OOM kills, failed scheduling, evictions) come from the API server, not the nodes. Install the chart once more as a single-replica deployment for them, so each event is sent once:

cluster.yaml
mode: deployment
replicaCount: 1
image:
  repository: otel/opentelemetry-collector-k8s
presets:
  kubernetesEvents:
    enabled: true          # k8sobjects receiver, events as log records
# extraEnvs and config as in values.yaml
Shell
helm upgrade --install otel-cluster open-telemetry/opentelemetry-collector \
  -n observability -f cluster.yaml

Prefer Fluent Bit? See Send logs without code › Kubernetes.

Already running a Collector? Keep its exporters and add otlphttp/pingwright next to them: exporters: [otlphttp/pingwright, <your existing exporters>].

Send logs without code

Vercel, Heroku, Cloudflare, Fly.io, AWS CloudWatch, Google Cloud (GKE, Cloud Run), journald, rsyslog, Vector and Fluent Bit can push logs straight to Pingwright, as can plain JSON over HTTP. See Send logs without code.

Search with LogsQL

The search box takes LogsQL. A few to start with:

You wantQuery
Errors and worselevel:in(error, fatal)
A word anywhere in the message"timeout"
A 5xx status in the message_msg:~"5[0-9][0-9]"
One service, one environmentservice.name:checkout-api deployment.environment.name:production

Words next to each other must all match. Click a value in the facets beside the results to filter on it, or to leave it out.

Read what came back

  • Lines: newest first, with a histogram over the time range. Open a line to see all its fields.
  • Patterns: similar lines collapsed into one pattern with a count, so a flood of the same error is one row.
  • Group: counts grouped by up to three fields, such as service.name and level.
  • Live tail: new lines as they arrive, every 5 seconds.
  • Export: the lines you found, as CSV or NDJSON.

Lines that carry a trace id link to errors with the same trace id. Pingwright doesn't store traces yet, but the id still ties a request's logs and errors together.

Exceptions become errors

A log record at level error or fatal with exception.type or exception.stacktrace attributes also becomes an error event in Errors, grouped into an issue, when the Errors preview is on and the key may send errors. The Go client's CaptureError and Recover send exactly these.

Retention and limits

Logs are kept for 14 days. Per organization, ingest is limited to 2 000 records a second (bursts to 10 000) and 20 GB a day, reset at 00:00 UTC. Over the limit, the endpoint answers 429 with Retry-After. One request may carry at most 130 000 records at these limits (the burst plus a minute of the rate); a larger one is refused with 413, except from AWS Firehose, which is stored and then slowed with 429. See Limits.

Pingwright doesn't store where logs came from unless you ask: an ingest key with Record sender IP on (Settings › Telemetry, owners and admins) adds the sender's IP as client.address to logs from direct senders. It's off by default; an IP address is personal data.

Your agent can search logs too, with query_logs over MCP.

Open Logs in the console