Skip to content

Choice to enable or disable path labels autodiscovery in prometheus metrics #15038

@stefan-korchahin

Description

@stefan-korchahin

What problem are you trying to solve?

Summary
Currently, getting per-route metrics in Linkerd requires manually defining routes via HTTPRoute or ServiceProfile resources. For services with 50+ routes this becomes an operational burden and a maintenance overhead that scales poorly.

Problem
The current workflow requires:

Manually define every route in HTTPRoute or ServiceProfile
Keep route definitions in sync with application changes
Duplicate route definitions already present in Ingress resources

This creates friction for teams who want deeper observability without the overhead of maintaining a separate set of route definitions.

Why This Matters
High cardinality is a valid concern, but it should be the user's choice to make that trade-off. Teams with moderate route counts (under 100) would greatly benefit from automatic path visibility without any manual configuration.
Furthermore, manual route definitions already make sense for features like retries and timeouts — but requiring them just for basic observability is a high barrier to entry.

How should the problem be solved?

Proposed Solution
Provide an opt-in mechanism to enable automatic per-path metrics collection, for example via an annotation:
config.linkerd.io/proxy-path-metrics: "true"
To address the high cardinality concern, consider:

Path templating — automatically normalize /api/users/123 → /api/users/:id
Top-N paths only — collect metrics only for the N most frequent paths
Sampling — collect path metrics for a configurable percentage of requests
Opt-in per service — disabled by default, enabled explicitly where needed

Any alternatives you've considered?

Current Workarounds

Linkerd access logs → Loki (logs, not metrics)
ServiceProfile with --tap auto-generation (one-time, not dynamic)

None of these provide the seamless Prometheus metrics experience that per-route visibility deserves.

How would users interact with this feature?

No response

Would you like to work on this feature?

None

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions