Skip to content

docs(server): describe matched route metrics - #585

Open
imbajin wants to merge 1 commit into
apache:masterfrom
hugegraph:codex/repair-rest-metrics-docs
Open

imbajin wants to merge 1 commit into
apache:masterfrom
hugegraph:codex/repair-rest-metrics-docs

Conversation

@imbajin

@imbajin imbajin commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Purpose

Request metrics used paths rebuilt from parameter values, which could replace fixed URL segments and create separate keys for unmatched paths. The keys now use the resource templates matched by Jersey.

Main Changes

  • Explain how template parameters and literals form metric keys.
  • Document the unmatched method buckets and dashboard migration.
  • Remove superseded unmatched series from the English and Chinese examples.

REST 请求指标的路由模板和未匹配分组

Verification

Checked the English and Chinese pages locally.

Server PR

- Explain how template parameters and literals form metric keys.
- Document the unmatched method buckets and dashboard migration.
- Remove superseded unmatched series from the English and Chinese examples.
@imbajin
imbajin marked this pull request as ready for review December 3, 2026 07:30

@imbajin imbajin left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Score: 6.5/10 · Confidence: high

Blocking: yes

Summary

The documented metric names depend on an unmerged server change, and examples retain obsolete root-route keys even with that change.

Evidence

Current Apache AccessLogFilter uses request paths; linked server PR #401 remains open. Its proposed matchedRoute removes empty segments while MetricsAPI root is mapped to metrics.

Validation notes

Source inspection only; no live server or site build was run.

`graphspaces/graphspace/graphs/graph/graph/vertices/id/GET/TOTAL_COUNTER`.
`/metrics/statistics?type=json` groups statistics by `<route>/<method>`.

Requests without a matched resource method use the `_unmatched` route. `GET`, `HEAD`, `POST`, `PUT`, `PATCH`, `DELETE`, and `OPTIONS`

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Gate this guidance on the server change

The linked server change is still open, and Apache master currently derives these keys from request paths without an _unmatched bucket. Publishing this as current behavior would lead readers to query series their server does not emit. Please coordinate publication with the implementation landing in Apache and identify the applicable version, or retain the current behavior until then.


For example, `GET /favicon.ico` and `POST /metrics` use `_unmatched/GET/TOTAL_COUNTER` and `_unmatched/POST/TOTAL_COUNTER`, respectively.
An unmatched request with another method uses `_unmatched/_other/TOTAL_COUNTER`. These examples show only the key format.
The response excerpts below retain historical sample values.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Update the root-route example keys

The retained examples include metrics//GET and metrics__GET, not just historical values. In the linked server change, matchedRoute strips slashes and skips empty segments, while the root GET handler is mapped at metrics, so the new keys use metrics/GET and metrics_GET. Please update the JSON and Prometheus examples in both languages as well.

This branch has not been deployed

No deployments
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.

1 participant