Skip to content

[Enhancement] Metrics: avoid exporting aggregates and labeled breakdowns under the same metric name #68504

Description

@manesioz

Search before asking

  • I had searched in the issues and found no similar issues.

Description

Problem: MetricRepo.java registers doris_fe_query_total three times under one name: an unlabeled total, a user-labeled copy (USER_COUNTER_QUERY_ALL), and, in cloud mode, a cluster_id/cluster_name-labeled copy (CloudMetrics.CLUSTER_QUERY_ALL_COUNTER). query_err and connection_total follow the same pattern.

The Prometheus exporter guidelines prohibit this shape explicitly: "my_metric{label="a"} 1, my_metric{label="b"} 6, my_metric{} 7 … Never do either of these." See here: https://prometheus.io/docs/instrumenting/writing_exporters/#labels

Proposal: Give the breakdowns their own names, for example doris_fe_query_total_by_user and doris_fe_cloud_cluster_query_total. Keep the unlabeled total as doris_fe_query_total. This is a breaking change, however.

Solution

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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