Add scheduled check comparing the SDK metrics reference with the SDK sources - #5005
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
📖 Docs PR preview linksThis PR does not change any pages in /docs. If you make updates, links to the modified pages will appear here. |
Duncanma
enabled auto-merge (squash)
July 31, 2026 22:30
jsundai
approved these changes
Jul 31, 2026
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.
Follow-up to #4985 (content fixes) and #4986 (internal consistency check).
#4986 proves
docs/references/sdk-metrics.mdxdoesn't contradict itself. It can't tell you the page is wrong — a metric that never existed, or an availability list missing an SDK, passes it happily. Those were the errors the manual audit in #4985 actually found. This check closes that gap by comparing the page against the metric definitions insdk-rust,sdk-go, andsdk-java.What it reports
Validation
Run against the page as merged, it reports zero wrong names and zero availability mismatches across all 48 metrics. That independently reproduces the availability table I verified by hand for #4985, which is the main evidence the extractors are trustworthy.
Design notes
Advisory, not a merge gate. The SDK default branches run ahead of released versions, so drift here is often "the SDK changed," not "the docs are wrong." A weekly job opens (and updates, and later closes) a single tracking issue. Exit codes are 0 clean, 2 drift, 1 the comparison couldn't run.
A constant that's declared but never referenced isn't emitted.
sdk-godeclaresWorkflowActiveThreadCountand never uses it; trusting the declaration would wrongly credit Go with that metric. The check greps each repo for the identifier and drops unreferenced ones. This caught a second case:WorkflowTaskNoCompletionCounteris also dead insdk-go, soworkflow_task_no_completionis Java-only. My review packet on #4985 listed it under Go — that was wrong.Definition files are listed explicitly, not discovered. If one is renamed upstream the check fails loudly with exit 1 rather than quietly reporting that an SDK stopped emitting metrics.
The baseline is the record of what we chose not to document.
bin/metrics-baseline.jsonholds the 13 metrics the SDKs define but the page omits, so the job only alerts on new drift. Three are confirmed deprecated aliases. The nine with an emptynoteare the open questions — I didn't want to invent justifications for metrics I haven't confirmed with the SDK team:activity_task_receivedlocal_activity_errorrequest_resource_exhausted,long_request_resource_exhaustedresource_slots_cpu_pid_output,resource_slots_mem_pid_outputsticky_cache_thread_forced_evictionworkflow_task_execution_total_latencyworkflow_task_heartbeatworkflow_task_no_completionThe two
resource_slots_*_pid_outputgauges look like tuner internals, and the two*_resource_exhaustedcounters look like genuine gaps in the page. Both are worth a second opinion before I either document them or write a note.Test plan
node --test bin/check-metrics-against-sdks.test.js— 38 tests, offline, over fixture snippets in each languageyarn check:metricsstill passes and its 22 tests still passworkflow_dispatchafter merge)┆Attachments: EDU-6859 Add scheduled check comparing the SDK metrics reference with the SDK sources