Skip to content

Telemetry

omfp can show you what your agents did and what it cost in any OpenTelemetry backend: every prompt becomes one trace running through the daemon, the agent’s process, its subagents and your plugins, with each model request (model, tokens, cost) and each tool call (with its approval) as a span. It is off by default: nothing leaves your machine until your init file turns it on.

Telemetry is a setting of your user init file (~/.config/omfp/init.ts), the only file that may declare it. The @omfp/otel package has presets:

import flavor from "@omfp/flavor";
import { langfuse } from "@omfp/otel";
export default (ctx) => {
ctx.plugin(flavor);
// Langfuse Cloud; pass `host` for another region or a self-hosted Langfuse.
ctx.plugin(langfuse({ publicKey: "pk-lf-…", secretKey: "sk-lf-…" }));
};

For any OTLP/HTTP collector (the OpenTelemetry Collector, Jaeger, Grafana Alloy, Honeycomb, …):

import { otlp } from "@omfp/otel";
export default (ctx) => {
ctx.plugin(otlp({ endpoint: "http://localhost:4318", headers: { "x-api-key": "…" } }));
};

Run :reload-init after editing the file. Keep keys out of a file you share: read them from the environment (process.env.LANGFUSE_SECRET_KEY) instead.

Both presets, and ctx.settings({ telemetry: { … } }) itself, take:

Option What it does
endpoint The collector’s OTLP base URL (/v1/traces, /v1/metrics, /v1/logs are added).
protocol http/protobuf (default) or http/json.
headers Sent with every export, e.g. an API key.
serviceName The service name your backend shows (default omfp).
sampling The share of traces kept, from 0 to 1 (default 1).
includeContent Also record prompts, replies, tool arguments and results (default false: only names, sizes, tokens, costs and timings).
metricsIntervalMs How often metrics are sent (default every minute).
resourceAttributes Extra labels, e.g. { "deployment.environment": "laptop" }.
signals Which of traces, metrics and logs to send (default all; the Langfuse preset sends traces only).
  • Traces: each request a window or an agent makes, each agent turn (invoke_agent), model request (chat <model>, following the OpenTelemetry GenAI conventions), tool call (execute_tool <name>) and its approval, background job, and the start, stop and crashes of omfp’s processes.
  • Metrics: running processes and busy threads, model requests, tokens and cost, tool call durations, errors and job runs.
  • Logs: omfp’s own log lines and your plugins’ console output, each linked to the trace it happened in.