diff --git a/packages/api/src/observability/config.ts b/packages/api/src/observability/config.ts index 022dd264..72f386cb 100644 --- a/packages/api/src/observability/config.ts +++ b/packages/api/src/observability/config.ts @@ -23,14 +23,14 @@ function read(name: string): string { /** Which of Grafana's environments this server's lines and metrics are labelled with. */ export const envLabel: EnvLabel = read('NODE_ENV') === 'production' ? 'production' : 'development'; -/** Grafana Cloud Loki, where the api ships its log when set; an empty address means stdout alone. */ +/** The Loki the api ships its log to when set; an empty address means stdout alone. */ export const lokiConfig: LokiConfig = { url: read('LOKI_URL'), userId: read('LOKI_USER_ID'), token: read('GRAFANA_CLOUD_TOKEN'), }; -/** Grafana Cloud's OTLP gateway, where the api pushes its metrics when set; nothing is pushed otherwise. */ +/** Where the api pushes its metrics over OTLP when set; nothing is pushed otherwise. */ export const metricsConfig: Pick = { url: read('METRICS_OTLP_URL'), userId: read('METRICS_USER_ID'), diff --git a/packages/api/src/observability/log.ts b/packages/api/src/observability/log.ts index 4f2a4117..6dfd622b 100644 --- a/packages/api/src/observability/log.ts +++ b/packages/api/src/observability/log.ts @@ -8,7 +8,7 @@ export type {Logger}; export {serializeError} from '@proxy/observability'; /** - * The api's logger: stdout always, and Grafana Cloud Loki when LOKI_URL is set (config.ts). Every + * The api's logger: stdout always, and a Loki when LOKI_URL is set (config.ts). Every * line carries the request or job it was written in (request-context.ts). */ export const log: Logger = createServerLogger({ diff --git a/packages/api/src/observability/metrics.ts b/packages/api/src/observability/metrics.ts index afb146a2..77ba403c 100644 --- a/packages/api/src/observability/metrics.ts +++ b/packages/api/src/observability/metrics.ts @@ -6,7 +6,7 @@ import {type AgentMetrics, createAgentMetrics, createDbMetricsRecorder, createMe import {envLabel, metricsConfig} from './config'; /** - * The api's metrics, pushed to Grafana Cloud when METRICS_OTLP_URL is set (config.ts) and + * The api's metrics, pushed over OTLP when METRICS_OTLP_URL is set (config.ts) and * summed up for nothing otherwise. Each instance pushes as itself: Render names it, and a machine * elsewhere is its host and process. */ diff --git a/packages/docs/content/self-hosting/environment.mdx b/packages/docs/content/self-hosting/environment.mdx index 911988fe..5e823eae 100644 --- a/packages/docs/content/self-hosting/environment.mdx +++ b/packages/docs/content/self-hosting/environment.mdx @@ -28,7 +28,8 @@ variables turn on quick actions on the home page. ## Observability The api writes its log to stdout, one JSON object per line, which `docker compose logs api` shows. -These ship it to [Grafana Cloud](https://grafana.com/products/cloud/) as well, which hosted -Personal Agent Proxy does; a self-hosted server needs none of them. +These ship it to a [Loki](https://grafana.com/oss/loki/) as well, and its metrics to a Prometheus +or any other store taking OTLP, as hosted Personal Agent Proxy does; a self-hosted server needs +none of them. diff --git a/packages/observability/README.md b/packages/observability/README.md index c2e2eac6..495bf7a5 100644 --- a/packages/observability/README.md +++ b/packages/observability/README.md @@ -5,11 +5,11 @@ goes. A self-hosted server needs none of it: without the variables below, the ap to stdout alone, one JSON object per line, and sums its metrics up for nothing. - `src/server.ts`: the server's logger. Stdout always, as text in development and as JSON lines in - production; Grafana Cloud Loki in batches when set, labelled by service, env and level. + production; a Loki in batches when set, labelled by service, env and level. - `src/client.ts`: the web app's logger, posted to the api in batches, which writes it on as the web app's or the desktop app's (`packages/api/src/observability/client-logs.ts`). -- `src/metrics.ts`: counters, histograms and gauges, pushed to Grafana Cloud's OTLP gateway every - half minute. On it `db-metrics.ts` (every query), `tool-metrics.ts` (every request of an agent), +- `src/metrics.ts`: counters, histograms and gauges, pushed over OTLP every half minute, to a + Prometheus or Grafana Cloud's gateway. On it `db-metrics.ts` (every query), `tool-metrics.ts` (every request of an agent), `agent-metrics.ts` (the built-in agent's jobs and every request of a model), and the probes `db-pool-probe.ts` (`SELECT 1` each second) and `job-queue-probe.ts` (the AgentJob queue). - `src/slack.ts`: the Slack notifier the api posts sign-ups with, and the internal repo's admin