Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
dc28981
docs(agents): add Cursor hook-to-OTLP tracing recipe
nik13 Oct 14, 2026
264cab0
docs(coding-agents): shared hook-to-OTLP emitter and Cursor page (TH-…
nik13 Oct 15, 2026
6e83ef4
fix(hook-to-otlp): send the root span with child spans, skip empty se…
nik13 Oct 15, 2026
5a80d95
docs(coding-agents): OpenCode application session tracing (TH-8288)
nik13 Oct 15, 2026
5da4f63
docs(coding-agents): OpenCode plugin retry, timeout, stdin note (TH-8…
nik13 Oct 15, 2026
6ba7e39
docs(cursor): note auto model and empty chats; realistic replay spaci…
nik13 Oct 15, 2026
b88b852
feat(hook-to-otlp): keyless turns, FIFO tool pairing, one open turn p…
nik13 Oct 15, 2026
c4cdd00
feat(cursor): map real Cursor 3.24.18 payloads; tokens, thought dedup…
nik13 Oct 15, 2026
5e86368
docs(coding-agents): OpenClaw application session tracing (TH-8283)
nik13 Oct 15, 2026
2d446bc
fix(cursor): split newline-joined tool_use_id into call id + provider…
nik13 Oct 15, 2026
4c12404
docs(coding-agents): Pi application session tracing (TH-8289)
nik13 Oct 15, 2026
86fc5d7
Merge foundation feat/th-8229-cursor-hook-to-otlp (2d446bc7) into fea…
nik13 Oct 15, 2026
1f27841
docs(coding-agents): Claude Code session tracing via native OTel (TH-…
nik13 Oct 15, 2026
fc0ef0b
docs(coding-agents): Oh My Pi application session tracing (TH-8290)
nik13 Oct 15, 2026
c92e438
fix(opencode): stop exporting the local working directory by default …
nik13 Oct 15, 2026
0402049
fix(pi): stop exporting the local working directory by default (TH-8289)
nik13 Oct 15, 2026
778861a
fix(oh-my-pi): stop exporting the local working directory by default …
nik13 Oct 15, 2026
92c0402
docs(coding-agents): name Claude Code tool spans after the tool (TH-8…
nik13 Oct 15, 2026
5e8fa68
fix(coding-agents): Claude Code review fixes: MCP names, cost caveat,…
nik13 Oct 15, 2026
6513a26
fix(hook-to-otlp): review fixes: guarded hooks, path privacy, turn pa…
nik13 Oct 15, 2026
837074b
fix(coding-agents): Claude Code collector keeps only the error class …
nik13 Oct 15, 2026
757c22f
fix(openclaw): drop plugins.allow, ship resource-detector setting, do…
nik13 Oct 15, 2026
9b77d51
fix(hook-to-otlp): subshell hook guard for heredoc payloads; quiet fa…
nik13 Oct 15, 2026
23c4398
fix(pi): bounded shutdown wait, observe-only events, cancel is not an…
nik13 Oct 15, 2026
002d6f7
fix(opencode): review fixes: root on every idle, queued turns, observ…
nik13 Oct 15, 2026
39e40e7
fix(pi): a request cancelled before it is sent is a cancellation (TH-…
nik13 Oct 15, 2026
5888555
fix(oh-my-pi): review fixes: native OTLP section, fork guard, empty s…
nik13 Oct 15, 2026
27d9be4
docs(openclaw): document env.vars side effect on agent commands; fix …
nik13 Oct 15, 2026
3a12ce2
fix(opencode): linear secret redaction on a bounded prefix; ignore pr…
nik13 Oct 15, 2026
9c6acd6
fix(hook-to-otlp): scrub only the user-name component of home paths
nik13 Oct 15, 2026
2a80481
docs(oh-my-pi): say exactly what each omp OTLP off switch turns off (…
nik13 Oct 15, 2026
65e5f10
docs(providers): Z.ai tracing (TH-8315)
nik13 Oct 16, 2026
1bea457
docs(frameworks): AI SDK C++ is not a supported tracing path (TH-8251)
nik13 Oct 16, 2026
0c0d9a4
docs(integrations): Inferable tracing not supported yet (TH-8330)
nik13 Oct 16, 2026
eae5866
docs(integrations): tighten Inferable wording (TH-8330)
nik13 Oct 16, 2026
e324149
docs(no-code): Langdock tracing status page (TH-8281)
nik13 Oct 16, 2026
b21627f
docs(providers): Z.ai live vendor verification (TH-8315)
nik13 Oct 17, 2026
01883a0
docs(integrations): Gradio chat tracing recipe (TH-8333)
nik13 Oct 17, 2026
8b48626
docs(integrations): send OpenInference spans to Future AGI (TH-8336)
nik13 Oct 17, 2026
1a8ece2
docs(integrations): OpenLLMetry (Traceloop SDK) tracing (TH-8337)
nik13 Oct 17, 2026
7937834
docs(integrations): Cognee tracing (TH-8328)
nik13 Oct 17, 2026
1a2d000
fix(openclaw): require OpenClaw 2026.10.5+, pin diagnostics-otel, res…
nik13 Oct 19, 2026
76f2d3c
docs(n8n): add hosted-verified OpenTelemetry tracing setup
nik13 Oct 29, 2026
e69f5ac
docs(cursor): scope hook recipe to qualified macOS IDE path
nik13 Oct 29, 2026
fe2e0d0
Merge main into Cursor hook docs
nik13 Oct 29, 2026
6e23250
docs: correct the qualified integration scope (#947)
nik13 Oct 29, 2026
f714da7
Merge main into integration docs #947
nik13 Oct 29, 2026
7a5717b
docs: correct the qualified integration scope (#952)
nik13 Oct 29, 2026
3bb1460
Merge main into integration docs #952
nik13 Oct 29, 2026
5a60591
docs: correct the qualified integration scope (#971)
nik13 Oct 29, 2026
0f0b37f
Merge main into integration docs #971
nik13 Oct 29, 2026
85c3a02
docs: correct the qualified integration scope (#973)
nik13 Oct 29, 2026
643ef62
Merge main into integration docs #973
nik13 Oct 29, 2026
35b8af7
docs: correct the qualified integration scope (#1003)
nik13 Oct 29, 2026
1110028
docs: correct the qualified integration scope (#1009)
nik13 Oct 29, 2026
e79fd6e
Merge main into integration docs #1003
nik13 Oct 29, 2026
45388fa
Merge main into integration docs #1009
nik13 Oct 29, 2026
a02ed44
Merge latest docs main into hook foundation
nik13 Oct 29, 2026
28996ef
docs: preserve shared catalog parity for incoming guides
nik13 Oct 29, 2026
d3f2e7a
Merge hook foundation catalog repair into docs #947
nik13 Oct 29, 2026
e4e865c
docs: register incoming guide in shared discovery (#947)
nik13 Oct 29, 2026
428f02f
Merge hook foundation catalog repair into docs #952
nik13 Oct 29, 2026
679205e
docs: register incoming guide in shared discovery (#952)
nik13 Oct 29, 2026
7de96d9
Merge hook foundation catalog repair into docs #971
nik13 Oct 29, 2026
b7adcde
docs: register incoming guide in shared discovery (#971)
nik13 Oct 29, 2026
8a3f601
Merge hook foundation catalog repair into docs #973
nik13 Oct 29, 2026
73e224c
docs: register incoming guide in shared discovery (#973)
nik13 Oct 29, 2026
7b2596d
Merge hook foundation catalog repair into docs #1003
nik13 Oct 29, 2026
46d91fa
docs: register incoming guide in shared discovery (#1003)
nik13 Oct 29, 2026
9f22eb4
Merge hook foundation catalog repair into docs #1009
nik13 Oct 29, 2026
7584f39
docs: register incoming guide in shared discovery (#1009)
nik13 Oct 29, 2026
7e60bb9
Merge qualified Z.ai docs before dependent catalog entry
nik13 Oct 29, 2026
a05c7a1
Merge earlier qualified guides into Inferable docs
nik13 Oct 29, 2026
2100588
Merge qualified docs #971 before the next catalog insertion
nik13 Oct 29, 2026
0f082e5
Merge qualified docs #973 before the next catalog insertion
nik13 Oct 29, 2026
63338c3
Merge qualified docs #1003 before the next catalog insertion
nik13 Oct 29, 2026
014e306
docs: preserve complete shared catalog through merge #971
nik13 Oct 29, 2026
086ae71
docs: preserve complete shared catalog through merge #973
nik13 Oct 29, 2026
5729db1
docs: preserve complete shared catalog through merge #1003
nik13 Oct 29, 2026
37ea526
docs: preserve complete shared catalog through merge #1009
nik13 Oct 29, 2026
ccc0a5e
Merge qualified foundation and register opencode guide
nik13 Oct 29, 2026
5f8cdf6
Merge qualified foundation and register openclaw guide
nik13 Oct 29, 2026
11b0ab1
Merge qualified foundation and register pi guide
nik13 Oct 29, 2026
9ac4206
Merge qualified foundation and register claude-code guide
nik13 Oct 29, 2026
7e39861
Merge qualified foundation and register oh-my-pi guide
nik13 Oct 29, 2026
f8b7e83
docs(omp): use verified pinned prebuilt installation
nik13 Oct 29, 2026
f9dfd95
Merge earlier qualified guides before OpenInference scope correction
nik13 Oct 29, 2026
82dcf59
Merge qualified n8n guide before the next catalog insertion
nik13 Oct 29, 2026
82569fd
docs: qualify the supported integration scope (#1007)
nik13 Oct 29, 2026
0c730fa
Merge qualified OpenInference guide before Cognee correction
nik13 Oct 29, 2026
7c0806f
docs: qualify the supported integration scope (#1017)
nik13 Oct 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/coding-agents/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
__pycache__/
*.pyc
131 changes: 131 additions & 0 deletions examples/coding-agents/claude-code/collector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# OpenTelemetry Collector config: Claude Code beta traces -> Future AGI.
#
# Claude Code (CLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1) sends its
# claude_code.* spans here over OTLP/HTTP. This config tags each span with a
# Future AGI span kind, copies the token counts onto the GenAI usage keys
# Future AGI reads, names tool spans after the tool, replaces user-chosen MCP
# server and tool names, keeps only the error class of failed requests, drops
# user.email and user.groups, and forwards traces only. Claude Code's metrics
# and log events are not ingested by Future AGI; leave OTEL_METRICS_EXPORTER
# and OTEL_LOGS_EXPORTER unset.
#
# Run with otelcol-contrib (the transform processor is in contrib):
# FI_API_KEY=... FI_SECRET_KEY=... otelcol-contrib --config collector.yaml
#
# Environment:
# FI_API_KEY, FI_SECRET_KEY Future AGI keys (required)
# FI_PROJECT_NAME project for these traces (default claude-code)
# FI_OTLP_ENDPOINT traces URL (default Future AGI cloud)
# FI_COLLECTOR_LISTEN where Claude Code sends spans (default 127.0.0.1:4318)
# FI_KEEP_MCP_NAMES 1 = keep MCP server and tool names (default: replaced)
# FI_KEEP_ERROR_TEXT 1 = keep error messages (default: error class only)

receivers:
otlp:
protocols:
http:
endpoint: ${env:FI_COLLECTOR_LISTEN:-127.0.0.1:4318}

processors:
transform/claude_code:
error_mode: ignore
trace_statements:
- context: span
statements:
# Span kinds. Future AGI reads fi.span.kind; Claude Code only sets
# gen_ai.operation.name on the interaction and tool spans.
- set(attributes["fi.span.kind"], "AGENT") where name == "claude_code.interaction"
- set(attributes["fi.span.kind"], "LLM") where name == "claude_code.llm_request"
- set(attributes["fi.span.kind"], "TOOL") where name == "claude_code.tool"
- set(attributes["fi.span.kind"], "CHAIN") where name == "claude_code.tool.blocked_on_user"
- set(attributes["fi.span.kind"], "CHAIN") where name == "claude_code.tool.execution"
- set(attributes["fi.span.kind"], "CHAIN") where name == "claude_code.hook"

# Token usage. Claude Code's input_tokens excludes prompt-cache reads
# and writes; the GenAI convention counts them in the input total.
- set(attributes["gen_ai.usage.input_tokens"], Int(attributes["input_tokens"]) + Int(attributes["cache_read_tokens"]) + Int(attributes["cache_creation_tokens"])) where name == "claude_code.llm_request" and attributes["input_tokens"] != nil and attributes["cache_read_tokens"] != nil and attributes["cache_creation_tokens"] != nil
# Claude Code sets each cache count only when it is defined.
- set(attributes["gen_ai.usage.input_tokens"], Int(attributes["input_tokens"])) where name == "claude_code.llm_request" and attributes["gen_ai.usage.input_tokens"] == nil and attributes["input_tokens"] != nil
- set(attributes["gen_ai.usage.output_tokens"], Int(attributes["output_tokens"])) where name == "claude_code.llm_request" and attributes["output_tokens"] != nil
- set(attributes["gen_ai.usage.cache_read.input_tokens"], Int(attributes["cache_read_tokens"])) where name == "claude_code.llm_request" and attributes["cache_read_tokens"] != nil
- set(attributes["gen_ai.usage.cache_creation.input_tokens"], Int(attributes["cache_creation_tokens"])) where name == "claude_code.llm_request" and attributes["cache_creation_tokens"] != nil
# The cache keys Future AGI shows on the span.
- set(attributes["gen_ai.usage.cache_read_tokens"], Int(attributes["cache_read_tokens"])) where name == "claude_code.llm_request" and attributes["cache_read_tokens"] != nil
- set(attributes["gen_ai.usage.cache_write_tokens"], Int(attributes["cache_creation_tokens"])) where name == "claude_code.llm_request" and attributes["cache_creation_tokens"] != nil

# Content, only when Claude Code was told to export it
# (OTEL_LOG_USER_PROMPTS=1 / OTEL_LOG_TOOL_DETAILS=1). Otherwise
# Claude Code sends "<REDACTED>" or omits the attribute.
- set(attributes["input.value"], attributes["user_prompt"]) where name == "claude_code.interaction" and attributes["user_prompt"] != nil and attributes["user_prompt"] != "<REDACTED>"
- set(attributes["input.value"], attributes["full_command"]) where name == "claude_code.tool" and attributes["full_command"] != nil
- set(attributes["input.value"], attributes["file_path"]) where name == "claude_code.tool" and attributes["input.value"] == nil and attributes["file_path"] != nil

# Signed-in users carry their email on every span; gateway (OIDC)
# sign-in adds group membership.
- delete_key(attributes, "user.email")
- delete_key(attributes, "user.groups")

# Error text. A failed model request carries the provider's or
# gateway's error message in the `error` attribute and in the span
# status message, with every content flag off. Keep only Claude
# Code's error_class (an identifier such as api_error or ShellError)
# unless FI_KEEP_ERROR_TEXT=1. The `error` attribute is deleted after
# the status, because the conditions read it.
- set(status.message, attributes["error_class"]) where status.code == STATUS_CODE_ERROR and attributes["error"] != nil and attributes["error_class"] != nil and "${env:FI_KEEP_ERROR_TEXT:-0}" != "1"
- set(status.message, "error") where status.code == STATUS_CODE_ERROR and attributes["error"] != nil and attributes["error_class"] == nil and "${env:FI_KEEP_ERROR_TEXT:-0}" != "1"
- delete_key(attributes, "error") where "${env:FI_KEEP_ERROR_TEXT:-0}" != "1"

# MCP tools: Claude Code exports the user-chosen server and tool names
# (tool_name mcp__<server>__<tool>, gen_ai.tool.name,
# anthropic.mcp.server.name) with every content flag off. Replace
# them with tool_name_safe ("mcp_other", or the tool name for a few
# fixed shapes) unless FI_KEEP_MCP_NAMES=1. tool_name is overwritten
# last because the conditions read it.
- set(attributes["tool_name_safe"], "mcp_other") where name == "claude_code.tool" and attributes["tool_name"] != nil and IsMatch(attributes["tool_name"], "^mcp__") and attributes["tool_name_safe"] == nil
- set(attributes["gen_ai.tool.name"], attributes["tool_name_safe"]) where name == "claude_code.tool" and attributes["tool_name"] != nil and IsMatch(attributes["tool_name"], "^mcp__") and "${env:FI_KEEP_MCP_NAMES:-0}" != "1"
- delete_key(attributes, "anthropic.mcp.server.name") where name == "claude_code.tool" and attributes["tool_name"] != nil and IsMatch(attributes["tool_name"], "^mcp__") and "${env:FI_KEEP_MCP_NAMES:-0}" != "1"
- set(attributes["tool_name"], attributes["tool_name_safe"]) where name == "claude_code.tool" and attributes["tool_name"] != nil and IsMatch(attributes["tool_name"], "^mcp__") and "${env:FI_KEEP_MCP_NAMES:-0}" != "1"

# Name tool spans after the tool (Bash, Read, mcp_other). Keep this
# last: the statements above match on the original span name.
- set(name, attributes["tool_name"]) where name == "claude_code.tool" and attributes["tool_name"] != nil

- context: spanevent
statements:
# OTEL_LOG_TOOL_CONTENT=1 puts tool output on a tool.output event.
- set(span.attributes["output.value"], attributes["output"]) where name == "tool.output" and attributes["output"] != nil
- set(span.attributes["output.value"], attributes["content"]) where name == "tool.output" and attributes["content"] != nil

- context: resource
statements:
- delete_key(attributes, "user.email")
- delete_key(attributes, "user.groups")

resource/futureagi:
attributes:
- key: project_name
value: ${env:FI_PROJECT_NAME:-claude-code}
action: insert

batch:
timeout: 2s

exporters:
otlp_http/futureagi:
traces_endpoint: ${env:FI_OTLP_ENDPOINT:-https://api.futureagi.com/tracer/v1/traces}
# The Future AGI collector reads uncompressed OTLP; the exporter's
# default gzip is rejected with HTTP 400.
compression: none
headers:
X-Api-Key: ${env:FI_API_KEY}
X-Secret-Key: ${env:FI_SECRET_KEY}

service:
telemetry:
metrics:
level: none
pipelines:
traces:
receivers: [otlp]
processors: [transform/claude_code, resource/futureagi, batch]
exporters: [otlp_http/futureagi]
62 changes: 62 additions & 0 deletions examples/coding-agents/claude-code/run_e2e.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#!/usr/bin/env bash
# Real end-to-end check: collector.yaml in otelcol-contrib, then one
# non-interactive Claude Code session that uses tools, exported to Future AGI.
#
# FI_API_KEY=... FI_SECRET_KEY=... FI_PROJECT_NAME=claude-code-e2e ./run_e2e.sh
#
# Needs otelcol-contrib (OTELCOL_BIN or PATH), claude (CLAUDE_BIN or PATH) and
# a working Claude Code login or ANTHROPIC_API_KEY; it makes one real (billed)
# model request. For a self-hosted Future AGI set FI_OTLP_ENDPOINT (e.g.
# http://localhost:4318/v1/traces) and FI_COLLECTOR_PORT=4319, so this
# collector does not try to bind the port Future AGI's collector uses.
# CONTENT=1 also sets the OTEL_LOG_* content flags (prompt, tool input/output).
# The Claude Code variables are passed on the command line only; a
# ~/.claude/settings.json "env" block with OTEL_* keys takes precedence over them.
set -euo pipefail

HERE="$(cd "$(dirname "$0")" && pwd)"
: "${FI_API_KEY:?set FI_API_KEY}" "${FI_SECRET_KEY:?set FI_SECRET_KEY}"
OTELCOL="${OTELCOL_BIN:-$(command -v otelcol-contrib || true)}"
CLAUDE="${CLAUDE_BIN:-$(command -v claude || true)}"
[ -x "$OTELCOL" ] || { echo "otelcol-contrib not found (set OTELCOL_BIN)" >&2; exit 2; }
[ -x "$CLAUDE" ] || { echo "claude not found (set CLAUDE_BIN)" >&2; exit 2; }
PORT="${FI_COLLECTOR_PORT:-4318}"
export FI_COLLECTOR_LISTEN="127.0.0.1:$PORT"

WORK="$(mktemp -d)"
LOG="$WORK/otelcol.log"
"$OTELCOL" --config "$HERE/collector.yaml" >"$LOG" 2>&1 &
COLLECTOR=$!
trap 'kill "$COLLECTOR" 2>/dev/null || true' EXIT
for _ in $(seq 1 50); do
grep -q "Everything is ready" "$LOG" && break
kill -0 "$COLLECTOR" 2>/dev/null || { cat "$LOG" >&2; exit 1; }
sleep 0.2
done

mkdir -p "$WORK/project"
printf '# demo-project\nA throwaway folder used to test Claude Code session tracing.\n' >"$WORK/project/README.md"
CONTENT_FLAGS=()
if [ "${CONTENT:-0}" = "1" ]; then
CONTENT_FLAGS=(OTEL_LOG_USER_PROMPTS=1 OTEL_LOG_TOOL_DETAILS=1 OTEL_LOG_TOOL_CONTENT=1)
fi

(cd "$WORK/project" && env \
CLAUDE_CODE_ENABLE_TELEMETRY=1 \
CLAUDE_CODE_ENHANCED_TELEMETRY_BETA=1 \
OTEL_TRACES_EXPORTER=otlp \
OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf \
OTEL_EXPORTER_OTLP_ENDPOINT="http://127.0.0.1:$PORT" \
${CONTENT_FLAGS[@]+"${CONTENT_FLAGS[@]}"} \
"$CLAUDE" -p "List the files in this folder and read README.md, then tell me its first line." \
--allowedTools "Read,Glob,Bash(ls:*)" --output-format json </dev/null) >"$WORK/result.json"

sleep 4 # collector batch timeout is 2s
SESSION_ID="$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1]))["session_id"])' "$WORK/result.json")"
echo "claude_version=$("$CLAUDE" --version | head -1)"
echo "session_id=$SESSION_ID"
if grep -q "Exporting failed" "$LOG"; then
grep "Exporting failed" "$LOG" >&2
exit 1
fi
echo "exported: open Observe > ${FI_PROJECT_NAME:-claude-code} and filter on session.id=$SESSION_ID"
9 changes: 9 additions & 0 deletions examples/coding-agents/claude-code/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"env": {
"CLAUDE_CODE_ENABLE_TELEMETRY": "1",
"CLAUDE_CODE_ENHANCED_TELEMETRY_BETA": "1",
"OTEL_TRACES_EXPORTER": "otlp",
"OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf",
"OTEL_EXPORTER_OTLP_ENDPOINT": "http://127.0.0.1:4318"
}
}
Loading
Loading