Skip to content

[Proposal] Include value in metrics for unspecified value #994

@xuannam230201

Description

@xuannam230201

Currently, envoyproxy/ratelimit support detailed_metric to include all values of the descriptor trees into metrics. But this causes high cardinality in metrics in some cases.

For example:

domain: default
descriptors:
  - key: route
    descriptors:
      - key: http_method
        descriptors:
          - key: user_id
            detailed_metric: true
            rate_limit:
              unit: minute
              requests_per_unit: 60

This rate limiting rule indicates per endpoint per user id rate limits. With detailed_metric: true, metric includes route, http_method and subject_id's values which cause high cardinality (num of endpoints * num of users).

Is it possible to add a field value_to_metric: true to decide to include which values to metric? Or we need to implement this feature?

In this case, I expect that I only need to include route and key's values to metric (the number of labels would be num of endpoints), I can configure:

domain: default
descriptors:
  - key: route
    value_to_metric: true
    descriptors:
      - key: http_method
        value_to_metric: true
        descriptors:
          - key: user_id
            rate_limit:
              unit: minute
              requests_per_unit: 60

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions