tsiam
GitHub

Observability

tsiam emits structured logs and metrics via OpenTelemetry, making it straightforward to integrate with any modern observability stack.

Logs#

Logs include contextual fields such as trace IDs and span IDs for correlation with distributed traces.

Configure the log level in config.yaml:

logs:
  # debug, info, warn, error
  level: info
  # Suppress /healthz log lines (default: true)
  omitHealthChecks: true
  # Force JSON output (auto-detected based on TTY when not set)
  json: true

To ship logs to an OpenTelemetry collector, set OTEL_EXPORTER_OTLP_ENDPOINT. No additional config is needed.

Metrics#

To export metrics to an OpenTelemetry collector:

export OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
export OTEL_SERVICE_NAME=tsiam
export OTEL_RESOURCE_ATTRIBUTES=environment=production,region=us-east-1

To expose a Prometheus-compatible scrape endpoint instead:

export OTEL_METRICS_EXPORTER=prometheus
export OTEL_EXPORTER_PROMETHEUS_PORT=9464

This starts a /metrics endpoint on the configured port that Prometheus can scrape.

OpenTelemetry environment variables#

VariableDescriptionDefault
OTEL_SDK_DISABLEDDisable OpenTelemetry entirelyfalse
OTEL_EXPORTER_OTLP_ENDPOINTOTLP collector endpoint
OTEL_EXPORTER_OTLP_PROTOCOLProtocol: grpc or http/protobufhttp/protobuf
OTEL_LOGS_EXPORTERLogs exporter: otlp, console, noneotlp
OTEL_METRICS_EXPORTERMetrics exporter: otlp, prometheus, console, noneotlp
OTEL_EXPORTER_PROMETHEUS_HOSTHost for Prometheus endpointlocalhost
OTEL_EXPORTER_PROMETHEUS_PORTPort for Prometheus endpoint9464
OTEL_SERVICE_NAMEService name in telemetrytsiam
OTEL_RESOURCE_ATTRIBUTESAdditional resource attributes

For a complete list, see the OpenTelemetry SDK configuration docs .

Example: Docker with OpenTelemetry Collector#

docker run -d \
  --name tsiam \
  -v /path/to/config.yaml:/etc/tsiam/config.yaml:ro \
  -v /path/to/tsnet-state:/etc/tsiam/tsnet \
  -v /path/to/tsiam-state:/var/lib/tsiam \
  -e OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318 \
  -e OTEL_SERVICE_NAME=tsiam \
  -e OTEL_RESOURCE_ATTRIBUTES=environment=production \
  ghcr.io/italypaleale/tsiam:v0

tsiam works with any OpenTelemetry-compatible backend, including Grafana Cloud, Datadog, Honeycomb, and self-hosted collectors.

Edit this page on GitHub