Repository navigation
OpenTelemetry export and a Grafana board to import - #150
Merged
Merged
Conversation
For those who already run a collector: Settings › Network › OpenTelemetry Export sends the figures of GET /metrics to it as OTLP over HTTP (JSON), under the same names, so one Grafana board reads them whichever way they came. Off until an address is given and the switch is on. Counts, speeds and sizes only: never a prompt, a reply or a client's name. - App/Metric.swift: the figures as a list both the Prometheus page and the export are written from; /metrics reads as before. - App/OTLP.swift: the body (levels as gauges, the counts since a server started as cumulative sums), the address and headers, and the sender, which runs with the alerts' check. A header's value is never given back. - Linux/OTLPRoutes.swift: GET and POST /otlp, from this machine only. - Settings › Network on KDE and the Mac. - docs/grafana/tokenmeter.json: a board for Grafana 10 and later, with a machine picker. - Linux/tests/otlp.sh with a stand-in collector, unit checks, docs. Version 0.9.11. Co-Authored-By: tokenmeter1 <358883051+tokenmeter1@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EE8zW9xXDFNPa2ueA83i2x
…ft running On GitHub the steps before it leave a stand-in llama.cpp on port 8080, which the test's services see as a server at work and tell as a quiet session. The check that the MCP Proxies' lines make no session of their own now looks only at sessions that aren't such a server's, and says what it found when it fails. Co-Authored-By: tokenmeter1 <358883051+tokenmeter1@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EE8zW9xXDFNPa2ueA83i2x
Every service of a user reads ~/.tokenmeter/reports, wherever its HOME points, so the file-agent
report the first steps write there showed up as a session in Linux/tests/wait.sh's own services,
which then failed ("the proxy's call made a session of its own").
Co-Authored-By: tokenmeter1 <358883051+tokenmeter1@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EE8zW9xXDFNPa2ueA83i2x
jacques-pr
pushed a commit
that referenced
this pull request
Dec 1, 2026
The step never ran: until now an earlier step of the job failed first (Linux/tests/wait.sh, fixed in #150), and the container the job runs in has no npm. Co-Authored-By: tokenmeter1 <358883051+tokenmeter1@users.noreply.github.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EE8zW9xXDFNPa2ueA83i2x
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.
What changes
Review 3, N4: Tokenmeter can send its figures to an OpenTelemetry collector, and there is a Grafana board to import. Version 0.9.11.
/v1/metrics: the same figures under the same names asGET /metrics, gauges as gauges and counters as cumulative sums. Only counts and measurements leave the machine, never a prompt or an answer. The settings answer names the headers that are set but never their values.GET /metricsand the export are now written from the same list (App/Metric.swift), so the two can't drift apart.GET /otlpandPOST /otlpon the Linux service, for this machine only, read and change the export and say when it last sent and what the collector answered.docs/grafana/tokenmeter.json(24 panels: speed, queue, tokens, GPU, memory, power, per model and machine). It works with Prometheus scraping/metricsand with the export through a collector. A test checks that every figure the board asks for exists.Checks
Also tried by hand against a real OpenTelemetry Collector (contrib 0.114) feeding Prometheus 3.0 and Grafana 11.3: the collector accepts the export, the figures arrive under the same names and kinds as a scrape of
/metrics, and the board imports and draws from both.Not checked: the Mac settings view (
OTLPSettingsin App/SettingsPage.swift) is not compiled here, GitHub's Mac jobs will say. Datadog, Honeycomb and other hosted services were not tried; they are reached through a collector.Generated by Claude Code