Use this guide to investigate slow requests, model timeouts, background tasks and service errors. Grafana brings metrics, traces and structured logs together so you can follow an incident to a specific request.

1. Prepare the deployment environment

Use a machine with the PowerContext CLI installed. The PowerContext environment needs the cli, server and tracing-otlp extras. Install and start Docker, then check Docker Compose:

powercontext observability --help
docker compose version

Replace /path/to/existing.env below with your existing Server configuration file. Keep the current database, model and authentication settings.

2. Start monitoring and connect the Server

Deploy the CLI-managed monitoring stack:

powercontext observability up --server-env /path/to/existing.env

The components run through Docker Compose and retain configuration and monitoring data locally. The command prints the configuration directory, access URLs, password file location and Server restart command. The first deployment downloads container images.

Stop the original Server normally, then use the printed command to restart it with the same business configuration. Retain its existing host, port and other startup arguments:

powercontext server run --env-file /path/to/existing.env --observability

--observability loads the generated telemetry settings. Running up alone does not connect an existing Server. If explicit OTLP settings conflict, use the full guide to choose one connection method.

3. Open the monitoring tools

powercontext observability status

Use the Grafana and Phoenix URLs printed by up or status. The Grafana username is admin; read the password from the indicated password file. Ports are configurable, so use the actual command output.

Default local URLs on first deployment are Grafana http://127.0.0.1:13000 and Phoenix http://127.0.0.1:6006. Local means the machine hosting the monitoring stack. See the full guide for remote access.

ToolWhat to inspect
GrafanaService health, background processing, API and model latency, with linked logs and traces.
PrometheusMetrics such as request volume, errors, latency and resources.
TempoTrace steps and their duration within a request.
LokiStructured operational logs, filtered by time, Scope, error code and trace ID.
PhoenixA local trace viewer included in the managed stack.

4. Verify delivery, then investigate

powercontext observability check
powercontext observability check --exercise

check queries the configured backends. --exercise sends a sampled read-only request to verify its trace, logs and metric correlation using the same trace ID; it does not create business Sources or Memories. Healthy containers alone do not prove data delivery.

In Grafana, select the incident time range, find the error or slow request, then use its trace ID to inspect the trace and related logs. For model timeouts, inspect the specific model call duration and error before checking the model service. Without recent traffic, an empty panel alone does not prove collection failure.

5. Check and stop monitoring

powercontext observability status
powercontext observability down

down stops only the CLI-managed monitoring stack. It retains monitoring volumes, configuration and credentials, and leaves the business Server running. Run powercontext observability up again with the same configuration directory to resume monitoring.

Existing platforms and other deployment layouts

If you already operate Prometheus, Collector, Tempo, Loki and Grafana, skip up and generate connection files with connect:

powercontext observability connect \
  --otlp-endpoint http://existing-collector:4318 \
  --server-env /path/to/existing.env \
  --metrics-target powercontext.example.internal:8000 \
  --prometheus-url https://monitoring.example/prometheus \
  --tempo-url https://monitoring.example/tempo \
  --loki-url https://monitoring.example/loki

Replace these example addresses with your platform endpoints. If a managed stack already exists, select a separate directory through POWERCONTEXT_OBSERVABILITY_HOME; managed and external configurations cannot share a directory. Follow external/README.md in the generated directory to merge scrape configuration, import Grafana dashboards and load the Server connection settings. connect does not modify the remote platform.

Use the full guide for Docker-hosted Servers, split API/background deployments, remote access and authentication. The managed stack currently uses Docker Compose; there is no one-command Kubernetes deployment.

Full deployment and connection guide →