docs(api): daily audit 2026-09-10 — add Explore query + Prometheus label values, repair catalog accordions - #383
Merged
Merged
Conversation
…bel values, repair catalog accordions Rebuilds the api-review delta from PR #377 on top of current main, which the PR no longer applies to (main retired the v1 alert-rule endpoints and published the v2 contract in #379). - api-reference/monitors.openapi.{en,zh}.json + consolidated: +2 operations, +10 schemas, pure addition (0 deletions, no key reordering) - docs.json: register both paths in the zh/en Monitors pages allow-list - {en,zh}/openapi/api-catalog.mdx: add both rows, close the Monitors accordion after Monitor utilities, restore the RUM accordion (41), fix the Monitors count (40 -> 25)
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 this is
Daily
api-reviewrun (--mode generate --scope all --auto) for 2026-09-10, againstfc-pgy@63afa2fbandflashduty-docs@b1e3f8da(currentmain).This supersedes #377, which can no longer merge:
mainmoved under it (mergeStateStatus: DIRTY) when #379 retired the v1 alert-rule endpoints and published the public v2 contract (e3bc1ef), plus #380/#381/#382. #377 had no review comments or reviews; its delta is carried forward here unchanged, rebased onto today's main. #377 will be closed and its branch deleted.Registry vs spec delta
auth == "all", path not/event/push/*, module not hidden): 339Added operations
Both rows are
Auth: "all"infc-pgy/logic/api/api_test.goat63afa2fb:POST /monit/query/explore—monit-read-query-explore, tagMonitors/Diagnostics.Registry row
logic/api/api_test.go:472(query:read:explore,Qps:100 AQps:16 AQpm:100). Backend routemonit-webapi/router/router.go:39(exploreHTTPAccess("public")), handlermonit-webapi/router/router_explore.go:216(exploreQuery).Request/response shapes verified against
monit-webapi/pkg/exploreprotocol/dto.go(HTTPQuery:datasource_id/expr/args/execution;HTTPExecution:kind/from_ms/to_ms/max_data_points/min_step_seconds/step_seconds) andpkg/exploreprotocol/testdata/explore_result_contract_golden.json(format: explore_result.v1;kind∈frames/samples/logs;frames[].kind∈table/time_series;fields[].type∈string/float/time;entries[].timestamp_ns;applied_limit;has_more;execution.effective_step_seconds).Permission claim verified:
query:read:exploreis a factor of permission id 3008Datasources Read/ classDatasources, scopemonit(fc-pgy/logic/permission/permission_test.go:1652-1667).GET /monit/prometheus/api/v1/label/{label_name}/values—monit-prometheus-read-label-values, tagMonitors/Data sources.Registry row
logic/api/api_test.go:466(prometheus:read:labelValues). Backend routemonit-webapi/router/router.go:264→promProxy(router/router_prom.go:44). Not permission-gated: the factor appears only inapi_test.go, never inpermission_test.go, so "any validapp_key" is accurate.Review attention: op 2 is not envelope-shaped
promProxyreturns the data source's native Prometheus JSON (router_prom.go:40-44documents this explicitly: "这个方法是代理的时序库的返回结果,其 response 结构需要遵从时序库的返回结构"), requires anX-DSIDheader, and returns pre-flight failures as non-200text/plainbodies. It is documented truthfully (native response schema, requiredX-DSIDheader parameter,text/plain400/500/503). It is the only non-envelope operation in the Monitors specs. If the product decision is that this route should not be in the public reference, drop the second path plus its nav/catalog row — op 1 stands on its own.Registry inconsistency found (upstream, not fixed here)
The registry spells the path parameter
:label_name(api_test.go:466) but the backend gin route is:labelname(router.go:264), and the sibling Loki row uses:labelname(api_test.go:459). The public path is unaffected (the placeholder name is cosmetic mid-segment) and the docs follow the registry per scope rule, butfc-pgyshould normalise the row. Flagged, not silently "corrected".Navigation + catalog reconciliation
Adding an operation is not enough — a path absent from the
docs.jsonpagesallow-list never renders:docs.json: both paths registered in the zh (诊断分析/告警数据源) and en (Diagnostics/Data sources) Monitors groups.{en,zh}/openapi/api-catalog.mdx: both rows added; accordion structure repaired —maincarried<Accordion title="Monitors (40 endpoints)">wrapping 64 rows (23 Monitors + 41 RUM) with the RUM accordion missing entirely, and a header total of 339 against 337 real rows. Now: Monitors (25), RUM (41) restored beforeFacets/RUM 自定义字段, header 339 = 339 rows.Final counts, all self-consistent: 193 + 25 + 41 + 53 + 27 = 339.
Deliberately not re-added
Eleven rows left the registry since #377's baseline; none of them are in
main's specs, so they are already absent from the docs and this PR re-adds nothing:POST /monit/query/diagnose,POST /monit/rule/counter/status,POST /monit/store/ruleset/{create,delete,info,list,update}— retired backend-side (monit-webapi/router/router_explore_test.goTestRetiredRoutesReturnNotFound), removed from docs byf1790df.POST /monit/rule/{info,create,update},POST /monit/rule/counter/node— retired and replaced by the v2 contract, already handled onmainbye3bc1ef(docs(monit): retire v1 alert rule endpoints, document public v2 contract #379).Unresolved
POST /monit/rule/dstypes— was carried from HEAD as an unresolved row on 2026-09-07;mainhas since dropped it (e3bc1ef). Nothing to carry today.mapping.yamlgaps —/status-page/*(registry providerstatus-page, mapping saysstatuspage),/calendar/*(registrypgy, mappingevent),/route/*,/rum/data|field|resource/*,/monit/query/*have no scope entry. None produced drift today (every such path is already in the specs); the audit classified by path segment to confirm that.Monitors/Monitor utilitiestag still has 0 operations, leaving an empty "Monitor utilities" / "通用工具" section in both catalogs. Pre-existing, outside this delta, left untouched.Examples
No dev-API capture was possible in this environment (no credential access), so all new request/response examples are constructed from the Go types and the explore-protocol golden fixtures — realistic data source IDs, expressions, labels, and epoch timestamps, no
"string"placeholders. Examples are contract-checked againstexplore_result_contract_golden.json, not invented.Validation
python3 scripts/lint_openapi.py→OK: 12 spec files, no violationsHEAD: every spec section other thanpaths/components.schemasis byte-identical;pathsandschemasshow 0 removed, 0 modified — pure addition, no key reordering588 +/0 -per file (identical shape to docs(api): daily audit 2026-09-09 — add Explore query + Prometheus label values, fix catalog counts #377's)tagsand human text differ)Unix/epoch/millisecond(checked mechanically over all 10 new schemas)requestBody+responses.200examplesdocs.json, 0 missing from either catalog, 0 extra; every accordion declared count equals its actual row countmint broken-linkscould not be run — no Node/Mintlify CLI in this environmentProcess note
The team knowledge pack still lacks
runbooks/api-review-daily.mdandrunbooks/api-review-apply-patches.py, which this automation references (reported since 2026-08-14). The skill'sgenerate_openapi.pytherefore carries no baseline-fidelity/key-order patch, so this run did not perform a full regeneration: it rebuilt strictly fromgit show HEAD:, appended only the delta, and verified byte-level baseline fidelity by deep comparison instead.