Skip to content

Conversation

@jdbohrman
Copy link

Context

Adds optional OTLP (OpenTelemetry Protocol) telemetry export so users can send Kilo Code telemetry data to any OpenTelemetry-compatible backend (Datadog, Honeycomb, Grafana Cloud, Jaeger, etc.). This runs alongside PostHog and does not replace it — it gives power users and teams the ability to observe extension behavior in their own observability stack.

Implementation

The feature spans three layers: a new telemetry client, extension-host wiring, and a settings UI.

New OtlpTelemetryClient (packages/telemetry/src/OtlpTelemetryClient.ts):

  • Extends BaseTelemetryClient and is registered alongside PostHog/Debug clients via TelemetryService.register().
  • Task lifecycle events (TASK_CREATED, TASK_COMPLETED, TASK_RESTARTED) are modeled as OpenTelemetry trace spans, giving a parent span per task that contains child events.
  • All telemetry events are additionally emitted as OTLP log records.
  • Uses BatchSpanProcessor and BatchLogRecordProcessor for efficient batched export over OTLP/HTTP (protobuf).
  • Supports reconfiguration at runtime — calling configure() tears down old providers before creating new ones.
  • Attribute values are sanitized to OTLP-compatible types (string, number, boolean).

Extension-host wiring (src/extension.ts, src/services/telemetry/otlpClientHolder.ts, src/core/webview/webviewMessageHandler.ts):

  • The OTLP client is instantiated at activation and registered with the telemetry service.
  • A simple module-scoped holder (otlpClientHolder.ts) allows the webview message handler to access the client for live reconfiguration when settings change.
  • Persisted settings are read from global state on activation and applied if enabled.

Settings UI (webview-ui/src/components/settings/OtelExportSettings.tsx, SettingsView.tsx):

  • New "OTLP Export" tab in Settings with fields for: enable toggle, traces endpoint, logs endpoint, service name, and custom headers (key-value pairs with masked values).
  • Settings are persisted via the existing globalSettings pipeline and validated with a Zod schema (otlpExportSettingsSchema).

Types (packages/types/src/global-settings.ts, vscode-extension-host.ts):

  • Added OtlpExportSettings type and Zod schema.
  • Threaded through ExtensionState and WebviewMessage for state sync.

No changes to existing telemetry behavior — OTLP export is opt-in and disabled by default.

How to Test

  1. Open Kilo Code settings and navigate to the new OTLP Export tab
  2. Enable OTLP export and enter a traces endpoint (e.g. http://localhost:4318/v1/traces) and/or logs endpoint (http://localhost:4318/v1/logs)
  3. Optionally set a custom service name and add authentication headers
  4. Save settings — the OTLP client should configure itself immediately
  5. Run a task — you should see trace spans and log records arrive at your OTLP backend
  6. Disable the toggle and verify no further data is exported
  7. Verify that existing PostHog telemetry continues to function normally regardless of OTLP settings

For local testing, you can run a Jaeger all-in-one container:

docker run -d --name jaeger \
  -p 4318:4318 \
  -p 16686:16686 \
  jaegertracing/all-in-one:latest

Then use http://localhost:4318/v1/traces as the traces endpoint and view results at http://localhost:16686.

Get in Touch

Discord: @comradenalaxone

@changeset-bot
Copy link

changeset-bot bot commented Feb 9, 2026

⚠️ No Changeset found

Latest commit: eb7051f

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant