Repository navigation
Add OpenClaw integration — zero-code OTLP ingestion - #15
Merged
Merged
Conversation
- Add standard OTLP route aliases: POST /v1/traces (forwards to ingest handler), POST /v1/metrics and /v1/logs (200 stubs to silence client warnings). OpenClaw's diagnostics-otel plugin exports to these paths. - Enrich _parse_span() attribute mapping for OpenClaw spans: - service.name fallback for agent_id when gen_ai.agent.id is absent - gen_ai.system fallback for provider when gen_ai.provider.name is absent - tool.* span names extract tool_name (e.g. tool.Read -> Read) - Add docs/openclaw.md setup guide and examples/openclaw/README.md - Add OpenClaw to README.md framework support (top of zero-code table) - 11 new tests covering route aliases and attribute mapping Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
HoomanDgtl
pushed a commit
to HoomanDigital/tokenjam
that referenced
this pull request
Jun 20, 2026
Metabuilder-Labs#5: replace the stale Metabuilder-Labs/openclawwatch#configuration URL (old project name → 404) in both the generated config header and the onboard 'Next steps' output with Metabuilder-Labs/tokenjam (Critical Rule 13). Metabuilder-Labs#15: emit all four [capture] toggles — the writer omitted tool_inputs (CLAUDE.md documents prompts/completions/tool_inputs/tool_outputs), leaving the generated config inconsistent with the documented surface. Tests: generated config carries all four capture toggles; no openclawwatch in the config or console output. Lint clean. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
anilmurty
pushed a commit
that referenced
this pull request
Jul 2, 2026
The Claude Code backfill ran one existence-check SELECT plus one INSERT per span in `_insert_session_idempotent` — ~2 DuckDB round-trips per span, so a large history (~120k spans) paid ~240k statements (~100s). #13 bounded only the quickstart first-run path; the full `tj backfill claude-code` / daemon path still paid the full per-span cost. Replace the per-span loop with a bulk path that processes a whole session in a BOUNDED number of statements regardless of span count: - Partition new-vs-existing span_ids in ONE chunked `WHERE span_id IN (...)` query (`_existing_span_ids`) instead of N existence SELECTs. - Bulk-insert the new spans in a single `executemany` (`_SPAN_INSERT_SQL` + `_span_insert_params`, kept in lock-step with `DuckDBBackend.insert_span`). - On `--reingest`, batch-load the existing rows' attributes in ONE chunked query (`_load_attrs_bulk`), compute the per-key attribute merge in Python, then apply the updates in a single `executemany`. The #10 idempotency + reingest contract is preserved exactly: new spans insert; existing spans without `--reingest` are skipped untouched; existing spans with `--reingest` get `sub_agent_id` updated and `attributes` per-key merged (overlay `{**stored, **parsed}`, parsed wins, never wipes a stored key). The no-`conn` fallback path is unchanged. Drops the now-unused single-span `_load_attrs` helper. Tests: all existing #3/#10/#13 backfill tests pass unchanged. Adds four #15 tests — bulk insert lands every new span; existing spans are skipped without `--reingest`; `--reingest` still merges attributes (overlay, no wipe) + updates sub_agent_id; and a counting-connection test asserting a 400-span session inserts in a BOUNDED number of statements (well under N execute() calls, via executemany) rather than ~2 per span. Co-Authored-By: Claude <[email protected]> (cherry picked from commit 6f94fe0)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
POST /v1/tracesforwards to the same OTLP JSON ingest handler as/api/v1/spans.POST /v1/metricsand/v1/logsare 200 stubs (OpenClaw sends all three; stubs prevent noisy warnings)._parse_span()now handles OpenClaw-specific patterns:service.nameresource attribute used asagent_idfallback (OpenClaw sets this, notgen_ai.agent.id)gen_ai.systemused as provider fallback (OpenClaw uses this instead ofgen_ai.provider.name)tool.*span names extracttool_name(e.g.tool.Read→Read,tool.exec→exec)openclaw.model.usagespans pass through token extraction normallydocs/openclaw.mdsetup guide +examples/openclaw/README.mdwith config snippets and verification commandsTest plan
test_openclaw_ingest.py: route aliases (3), attribute mapping (8 including realistic full-payload test)ruff checkcleandiagnostics-otel→http://127.0.0.1:7391, verify spans appear inocw traces🤖 Generated with Claude Code