Report coding tool metrics to Kimchi

When developers use Kimchi's Serverless Endpoints through AI coding tools, you can configure those tools to report usage telemetry back to Kimchi. This gives you a unified view of serverless endpoint consumption: token usage, costs, and tool activity across all your AI-assisted coding tools in a single place.

Claude Code

Claude Code supports OpenTelemetry (OTel) natively. Administrators configure telemetry export through Claude Code's managed settings file, so individual developers don't need to set anything up themselves.

This setup attributes all usage to a single API key. Because the managed settings file is shared across your team, every developer's activity is reported under the same key. You will not be able to track usage, costs, or tool activity per individual user.

If per-user tracking is a requirement, each developer should configure their own API key individually instead. See Collect Claude Code usage metrics with Kimchi for that setup path.

Before you start

Before you configure metrics reporting, ensure:

Configure the managed settings file

Add the following env block to your Claude Code managed settings file:

{
  "env": {
    "CLAUDE_CODE_ENABLE_TELEMETRY": "1",
    "OTEL_LOGS_EXPORTER": "otlp",
    "OTEL_EXPORTER_OTLP_LOGS_PROTOCOL": "http/json",
    "OTEL_EXPORTER_OTLP_LOGS_ENDPOINT": "https://api.kimchi.dev/aioptimizer/v1beta/logs:ingest",
    "OTEL_EXPORTER_OTLP_LOGS_HEADERS": "Authorization=Bearer $YOUR_KIMCHI_API_KEY",
    "OTEL_LOGS_EXPORT_INTERVAL": "5000"
  }
}

Replace $YOUR_KIMCHI_API_KEY with the API key you generated from the Kimchi console.

VariableValuePurpose
CLAUDE_CODE_ENABLE_TELEMETRY1Enables telemetry export in Claude Code
OTEL_LOGS_EXPORTERotlpExports logs using the OpenTelemetry Protocol
OTEL_EXPORTER_OTLP_LOGS_PROTOCOLhttp/jsonSets the transport to HTTP with JSON encoding
OTEL_EXPORTER_OTLP_LOGS_ENDPOINThttps://api.kimchi.dev/aioptimizer/v1beta/logs:ingestPoints the exporter at Kimchi's log ingestion endpoint
OTEL_EXPORTER_OTLP_LOGS_HEADERSAuthorization=Bearer <key>Authenticates requests using your Kimchi API key
OTEL_LOGS_EXPORT_INTERVAL5000Exports logs every 5 seconds (5000 ms)
📘

Managed settings have high precedence and cannot be overridden by individual users. For details on how Claude Code resolves settings from multiple sources, see Claude Code settings precedence.

Verify telemetry is reaching Kimchi

After developers start using Claude Code with the managed settings applied:

  1. Open Claude Code and run a few prompts to generate telemetry data.
  2. Navigate to the Kimchi console and check for incoming usage data.

If data is not appearing, check the following:

  • Confirm the managed settings file is in the correct location and contains valid JSON.
  • Verify the Kimchi API key is valid and has not expired.
  • Ensure the machine running Claude Code has network access to api.kimchi.dev.

What data does Claude Code export?

Claude Code's OpenTelemetry events include structured data for each interaction:

  • API requests — each API call Claude Code makes, including model, token counts, and cost.
  • Tool results — tool executions, including tool names and execution parameters.
  • User prompts — records when a user submits a prompt (prompt content is not exported by default).

Each event includes a prompt.id attribute that ties all activity back to the prompt that triggered it. Telemetry is opt-in and requires explicit configuration. Raw file contents and code snippets are not included in events. For full details, see Claude Code monitoring.

OpenCode

For OpenCode, install the OpenCode OTel plugin and follow the setup steps in its README. The plugin exports the same kind of telemetry — API requests, tool calls, token counts, and costs — to your Kimchi tenant.

Refer to the README at github.com/castai/opencode-otel-plugin for installation, configuration, and verification steps. When the README references an AI Enabler endpoint or API key, substitute your Kimchi endpoint (https://api.kimchi.dev/aioptimizer/v1beta/logs:ingest) and Kimchi API key.

📘

Once configured, OpenCode usage shows up alongside Claude Code activity in the Kimchi console, giving you a single view of cost and tool activity across coding tools.