Skip to content

Commit 93a9da2

Browse files
committed
rename request count metric
from azure_resourcegraph_query_request_count to azure_resourcegraph_query_requests Signed-off-by: Markus Blaschke <[email protected]>
1 parent 3a5acb6 commit 93a9da2

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@ HTTP Endpoints
4848
Global metrics
4949
--------------
5050

51-
| Metric | Description |
52-
|-------------------------------------|--------------------------------------------------------------------------------|
53-
| `azure_resourcegraph_querytime` | Summary metric about query execution time |
54-
| `azure_resourcegraph_ratelimit` | Current ratelimit value from the Azure API |
51+
| Metric | Description |
52+
|--------------------------------------|--------------------------------------------------------------------------------|
53+
| `azure_resourcegraph_query_time` | Summary metric about query execution time (incl. all subqueries) |
54+
| `azure_resourcegraph_query_results` | Number of results from query |
55+
| `azure_resourcegraph_query_requests` | Count of requests (eg paged subqueries) per query |
56+
| `azure_resourcegraph_ratelimit` | Current rate limit value from the Azure API |
5557

5658

5759
Example

global-metrics.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ package main
33
import "github.com/prometheus/client_golang/prometheus"
44

55
var (
6-
prometheusQueryTime *prometheus.SummaryVec
7-
prometheusQueryResults *prometheus.GaugeVec
8-
prometheusQueryRequestCount *prometheus.CounterVec
9-
prometheusRatelimit *prometheus.GaugeVec
6+
prometheusQueryTime *prometheus.SummaryVec
7+
prometheusQueryResults *prometheus.GaugeVec
8+
prometheusQueryRequests *prometheus.CounterVec
9+
prometheusRatelimit *prometheus.GaugeVec
1010
)
1111

1212
func initGlobalMetrics() {
@@ -34,17 +34,17 @@ func initGlobalMetrics() {
3434
)
3535
prometheus.MustRegister(prometheusQueryResults)
3636

37-
prometheusQueryRequestCount = prometheus.NewCounterVec(
37+
prometheusQueryRequests = prometheus.NewCounterVec(
3838
prometheus.CounterOpts{
39-
Name: "azure_resourcegraph_query_request_count",
39+
Name: "azure_resourcegraph_query_requests",
4040
Help: "Azure ResourceGraph query request count",
4141
},
4242
[]string{
4343
"module",
4444
"metric",
4545
},
4646
)
47-
prometheus.MustRegister(prometheusQueryRequestCount)
47+
prometheus.MustRegister(prometheusQueryRequests)
4848

4949
prometheusRatelimit = prometheus.NewGaugeVec(
5050
prometheus.GaugeOpts{

probe.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ func handleProbeRequest(w http.ResponseWriter, r *http.Request) {
108108
Options: &RequestOptions,
109109
}
110110

111-
prometheusQueryRequestCount.With(prometheus.Labels{"module": moduleName, "metric": queryConfig.Metric}).Inc()
111+
prometheusQueryRequests.With(prometheus.Labels{"module": moduleName, "metric": queryConfig.Metric}).Inc()
112112

113113
var results, queryErr = resourcegraphClient.Resources(ctx, Request)
114114
if results.TotalRecords != nil {

0 commit comments

Comments
 (0)