AIToday
Large Language ModelsAI Coding AssistantsZenn AI/MLPublished: Nov 17, 2026, 16:00 JST

Claude Code logs to Cloudflare: Gemcook's OpenTelemetry setup

Send on LINE
Claude Code logs to Cloudflare: Gemcook's OpenTelemetry setup

3 Key Points

  1. What happened

    Gemcook chose Claude Code's OpenTelemetry support over the CLI tool ccusage, and Worker receives http/json payloads and saves raw data to R2 before any reshaping.

  2. Why it matters

    Each api_request event carries user.email and a precomputed cost_usd, so per-member usage can be totaled without a separate identity system or per-model price table — though cost_usd is an estimate, not the subscription bill.

Not sure about something? Ask the AI

Questions and answers are published on this page.

Summaries like this, every morning.

By signing up you agree to the Terms of Service and Privacy Policy.

Context & Analysis

Gemcook had already rolled out Claude Code across the company, which shifted the question from adoption to actual usage. The team first considered ccusage, a CLI that aggregates logs on each person's machine. That works for individuals and small groups, but organization-wide collection would depend on members running it on a weekly or similar cadence, which the team judged unsuitable for long-term operation.

OpenTelemetry was the other candidate, and its main drawback was the need for a receiving endpoint. Once the team found that endpoint could be built quickly, it chose OpenTelemetry — partly because members would no longer need to act once settings were distributed, and partly because OpenTelemetry is a standard, so the intake and raw-storage layer could serve other tools. Codex is noted as supporting OpenTelemetry log export too, and the team frames AI tool switching as a given, with formatting and aggregation still built per tool.

The Worker saves raw data to R2 before any reshaping, so a bug in the shaping step can be replayed and field changes on the Claude Code side are easier to absorb. Access control is layered: a token in the Authorization header is checked in the Worker, and Cloudflare's WAF blocks unexpected requests before they reach it. Distribution uses Claude's server-managed settings, and the team flags two points to handle first — telling members what is collected, why, and who can see it, and warning them that an approval dialog will appear, since rejecting it ends Claude Code.

FAQ
Why did Gemcook pick OpenTelemetry over ccusage?
ccusage aggregates logs on each person's own machine, so organization-wide collection would require members to run it on a schedule. With OpenTelemetry, settings are distributed once and logs are sent automatically.
What does each usage record contain?
Records include event.timestamp, user.email, session.id, model, input/output tokens, cache read/creation tokens, cost_usd, and duration_ms. cost_usd is an estimate based on API pricing, so it differs from the flat Team plan bill.
What do members have to do?
They only approve a dialog that appears when the settings are delivered. After approval, logs collect in R2 automatically, and rejecting the dialog closes Claude Code.
Send on LINE

AI news that matters for your work, delivered every morning.

Pick your industry and the AI tools you use, and get news related to your work every day.

By signing up you agree to the Terms of Service and Privacy Policy.

Free · 30 seconds with Google · unsubscribe anytimeWhat is AIToday? →

Ask AI

Ask AI anything about this article. The AI reads this article, earlier AIToday articles, and Wikipedia, and cites its sources. Q&As are published on this page for other readers too.

Questions and answers are published on this page.

Related Articles

Next articleApple narrows macOS full disk access to selected folders in macOS 27.3 update