Skip to content

feat: add OTEL_LOG_TOOL_DETAILS and sync hook with production - #13

Merged
doneyli merged 1 commit into
mainfrom
issue-12-otel-hook-sync
Apr 2, 2026
Merged

feat: add OTEL_LOG_TOOL_DETAILS and sync hook with production#13
doneyli merged 1 commit into
mainfrom
issue-12-otel-hook-sync

Conversation

@doneyli

@doneyli doneyli commented Apr 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add OTEL_LOG_TOOL_DETAILS=1 to all 3 settings examples — enables skill_name and tool parameter details on telemetry events, needed for skill invocation tracking
  • Sync langfuse_hook.py with production: sys.path fix (prevents local langfuse/ dirs from shadowing the SDK) and permission governance tracking (Permission Events spans with flag summaries)

Context

Investigation of skill invocation tracking in Langfuse revealed that without OTEL_LOG_TOOL_DETAILS=1, skill names aren't attached to telemetry events. The hook also had production-only improvements not reflected in the template.

Skill cross-turn linkage (zero-duration spans, no parent link between trigger and execution traces) is tracked as future work — it's an upstream Claude Code limitation (anthropics/claude-code#35319).

Fixes #12

Test plan

  • Verify settings examples parse as valid JSON
  • Run hook against a session with skill invocations and confirm skill_name appears in Langfuse traces
  • Verify permission events span appears when permission-events.jsonl has entries
  • Test sys.path fix by running hook from a directory containing a langfuse/ folder

🤖 Generated with Claude Code

- Add OTEL_LOG_TOOL_DETAILS=1 to all settings examples for skill name
  attribution on telemetry events
- Sync langfuse_hook.py with production: sys.path fix to prevent local
  directories shadowing the SDK import, and permission governance tracking
  that creates Permission Events spans with flag summaries

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@doneyli

doneyli commented Apr 2, 2026

Copy link
Copy Markdown
Owner Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

@doneyli

doneyli commented Apr 2, 2026

Copy link
Copy Markdown
Owner Author

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

🤖 Generated with Claude Code

@doneyli
doneyli merged commit b80a5d3 into main Apr 2, 2026
1 check passed
@doneyli
doneyli deleted the issue-12-otel-hook-sync branch April 2, 2026 03:53
doneyli added a commit that referenced this pull request Jul 15, 2026
Turns were previously emitted as one trace each, linked only by
session_id. Now every turn attaches to a deterministic trace id seeded
from the session id (create_trace_id + trace_context on the turn span),
so all turns of a session land in a single trace:

  Trace (session)
    Turn N (span)
      Claude Response (generation)
      Tool: X (span)
      Permission Events (span, when flagged)

Preserves the sys.path import guard and Permission Events tracking from
PR #13. Also adds conservative secret redaction (sanitize_text /
sanitize_value, toggle with CC_LANGFUSE_REDACT=false) and log rotation.

Verified end-to-end against a local v3 instance: 3 turns -> 1 trace,
7 nested observations, injected secret not present in trace payload.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

feat: add OTEL_LOG_TOOL_DETAILS, sync hook improvements, and improve skill tracking

1 participant