Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use a fixed metric name for sentinel prometheus exporter #3320

Open
flea1lt opened this issue Jan 30, 2024 · 1 comment
Open

Use a fixed metric name for sentinel prometheus exporter #3320

flea1lt opened this issue Jan 30, 2024 · 1 comment

Comments

@flea1lt
Copy link

flea1lt commented Jan 30, 2024

Issue Description

Type: Enhancement

I have followed this README to set up sentinel prometheus exporter. However, I've observed that the metric name is currently tied to the appName, which is typically the JAR's name or specified by the VM option csp.sentinel.prometheus.app. The logic can be found at SentinelCollector.java#L83.

Querying metrics using appName in PromQL seems unconventional and inconvenient. In scenarios where multiple services enable the Prometheus exporter feature, prometheus will receive numerous distinct metrics that essentially convey the same information.

I propose using a fixed metric name and introducing an additional label (app_name) representing the appName.

Desired Feature

I would like the Prometheus exporter to provide a fixed metric name and an extra label (app_name). This would enable querying with a consistent PromQL expression like sentinel_metric_log{app_name="xx", resource="xxx", type="xxx"}. With this enhancement, every service can be queried using the same PromQL, requiring only the label's value to be adjusted.

@flea1lt
Copy link
Author

flea1lt commented Feb 5, 2024

PTAL @sczyh30

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

No branches or pull requests

1 participant