claude-code - 💡(How to fix) Fix feat: emit custom-title and agent-name as OTLP telemetry events

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

custom-title and agent-name session metadata are currently written only to the local .jsonl session file and never emitted as OTLP telemetry. This makes them invisible to any OpenTelemetry-based observability pipeline.

Root Cause

custom-title and agent-name session metadata are currently written only to the local .jsonl session file and never emitted as OTLP telemetry. This makes them invisible to any OpenTelemetry-based observability pipeline.

Code Example

{"type":"custom-title","customTitle":"clip-research","sessionId":"3a378729-d860-4d1a-95ca-0d297d7c7f4f"}
{"type":"agent-name","agentName":"clip-research","sessionId":"3a378729-d860-4d1a-95ca-0d297d7c7f4f"}

---

event.name = "claude_code.custom_title"
session.id = <sessionId>
custom_title = <customTitle>

---

event.name = "claude_code.agent_name"
session.id = <sessionId>
agent_name = <agentName>
RAW_BUFFERClick to expand / collapse

Summary

custom-title and agent-name session metadata are currently written only to the local .jsonl session file and never emitted as OTLP telemetry. This makes them invisible to any OpenTelemetry-based observability pipeline.

Current behavior

When a session is renamed (via /rename) or a sub-agent is spawned with a name, Claude Code appends entries like these to the local session file:

{"type":"custom-title","customTitle":"clip-research","sessionId":"3a378729-d860-4d1a-95ca-0d297d7c7f4f"}
{"type":"agent-name","agentName":"clip-research","sessionId":"3a378729-d860-4d1a-95ca-0d297d7c7f4f"}

These are not forwarded to the configured OTLP exporter (OTEL_EXPORTER_OTLP_ENDPOINT). Querying a BigQuery-backed OTLP collector that receives all other claude_code.* events (user_prompt, api_request, tool_result, tool_decision, api_error, etc.) returns zero rows for these two types.

Desired behavior

Emit both values as OTLP log records (consistent with existing claude_code.* events), e.g.:

event.name = "claude_code.custom_title"
session.id = <sessionId>
custom_title = <customTitle>
event.name = "claude_code.agent_name"
session.id = <sessionId>
agent_name = <agentName>

Use case

Session titles and agent names are essential dimensions for understanding Claude Code usage in multi-agent / parallel-worktree workflows:

  • Session titles (/rename) let users label what a session was for — without them, analytics can only show opaque session IDs.
  • Agent names identify which sub-agent in a parallel workflow produced which API calls, tool decisions, and token costs.

Both are already collected client-side; the only missing piece is forwarding them through the OTLP pipeline so downstream collectors and BigQuery/Grafana dashboards can group and filter by them.

Environment

  • Claude Code version: 2.1.112
  • Platform: macOS (darwin arm64)

extent analysis

TL;DR

Modify the Claude Code configuration to emit custom-title and agent-name session metadata as OTLP log records.

Guidance

  • Review the OTLP exporter configuration (OTEL_EXPORTER_OTLP_ENDPOINT) to ensure it is correctly set up to receive custom log records.
  • Update the Claude Code session logging mechanism to forward custom-title and agent-name events to the OTLP exporter, potentially by adding a custom logging handler or modifying the existing logging pipeline.
  • Verify that the OTLP collector and BigQuery-backed dashboard are configured to receive and process the new log records.
  • Test the updated configuration by renaming a session or spawning a sub-agent and checking for the corresponding log records in the OTLP collector and BigQuery dashboard.

Example

No code snippet is provided as the issue does not contain sufficient information about the logging mechanism or OTLP exporter configuration.

Notes

The solution may require modifications to the Claude Code source code or configuration files, and may involve additional setup or configuration of the OTLP collector and BigQuery dashboard.

Recommendation

Apply a workaround by modifying the Claude Code configuration to emit the missing log records, as the issue is specific to the current version (2.1.112) and may be addressed in a future release.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING