Skip to content

Document custom metrics on Monitor.ping - #46

Open
aflanagan wants to merge 4 commits into
masterfrom
agent/custom-metrics-30fe
Open

Document custom metrics on Monitor.ping#46
aflanagan wants to merge 4 commits into
masterfrom
agent/custom-metrics-30fe

Conversation

@aflanagan

@aflanagan aflanagan commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Shape for review (August)

Docs-only. Production code and tests are identical to master.

Documents the existing public API:

Monitor.ping(..., metrics={name: number, ...}) → repeated metric=name:value query params.

Built-ins (duration, count, error_count) and custom names (queue_depth, quality_score) share that dict. Server-side, names are lowercased, max 63 characters, and may contain letters, numbers, underscores, and hyphens.

This client does not validate metrics locally. The ping HTTP response is not a validation channel.

Changes

  • README only: short example + one-paragraph note on custom/arbitrary metrics
  • Reverted: all monitor.py and test changes from earlier revisions of this PR

Out of scope

  • Other language SDKs
  • cronitor app PR #325
  • Client-side validation
  • rejected_metrics / sync rejection feedback
  • Version bump / release

Test plan

  • Diff vs master is README-only
  • Default-branch tests still pass (28 passed; no code changes)
Open in Web Open in Cursor 

cursoragent and others added 4 commits September 11, 2026 17:49
Keep the existing metrics dict API (encoded as repeated metric=name:value
query params) for built-ins and custom names. Document server name rules,
limits, and rejected_metrics. Log a warning when a 200 JSON ping body
includes rejected_metrics without changing the return type.

Co-authored-by: August Flanagan <aflanagan@users.noreply.github.com>
Metric validation is async in the ping worker, not returned on the
ingestion response. Drop response-body inspection, warning logs, tests,
and docs that suggested clients would see rejected_metrics on ping.

Co-authored-by: August Flanagan <aflanagan@users.noreply.github.com>
Co-authored-by: August Flanagan <aflanagan@users.noreply.github.com>
Revert production code and tests to default. Document that arbitrary
metrics use the existing metrics dict and metric=name:value encoding.

Co-authored-by: August Flanagan <aflanagan@users.noreply.github.com>
@cursor cursor Bot changed the title Document and test arbitrary / custom metrics on Monitor.ping Document custom metrics on Monitor.ping Sep 11, 2026
@aflanagan
aflanagan marked this pull request as ready for review September 11, 2026 20:28
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.

2 participants