Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Replace stale metric that was being used for telemetry.
Browse files Browse the repository at this point in the history
Signed-off-by: Harkishen-Singh <harkishensingh@hotmail.com>

In the previous commit, we added a common metric
promscale_query_duration_seconds{handler, type} to track duration of all
query based executions across all functions (and APIs when we implement for metrics)
hence the previous
promscale_trace_fetch_traces_api_execution_duration_seconds_bucket now
becomes trivial. This commit removes it and replaces it with the new
convention so that telemetry collection does not get affected with this
update.
  • Loading branch information
Harkishen-Singh committed Feb 8, 2022
1 parent 53cc24e commit 767d1eb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
11 changes: 3 additions & 8 deletions pkg/jaeger/query/metrics.go
Expand Up @@ -19,13 +19,9 @@ var (
Name: "query_requests_executed_total",
Help: "Total number of query requests successfully executed by /getTrace and /fetchTraces API.",
})
traceExecutionTime = prometheus.NewHistogram(prometheus.HistogramOpts{
Namespace: util.PromNamespace,
Subsystem: "trace",
Name: "fetch_traces_api_execution_duration_seconds",
Help: "Time taken by a trace query for complete execution in /fetchTraces API.",
Buckets: []float64{0.05, 0.1, 0.25, 0.5, 1, 2.5, 5, 10, 30, 50, 100, 250, 500, 1000, 2500},
})
// Even though this is handled by promscale_query_requests_total{subsystem="trace", handler="get_dependencies", code="200"}
// yet we will have to keep this metric for telemetry as extracting the underlying series from a metric will require
// changing telemetry arch that tracks the all prometheus metrics, just for this metric, which is not worth.
dependencyRequestsExec = prometheus.NewCounter(prometheus.CounterOpts{
Namespace: util.PromNamespace,
Subsystem: "trace",
Expand All @@ -48,7 +44,6 @@ func registerMetricsForTelemetry(t telemetry.Engine) error {
func init() {
prometheus.MustRegister(
traceRequestsExec,
traceExecutionTime,
dependencyRequestsExec,
)
}
1 change: 0 additions & 1 deletion pkg/jaeger/query/query.go
Expand Up @@ -89,7 +89,6 @@ func (p *Query) FindTraces(ctx context.Context, query *spanstore.TraceQueryParam
res, err := findTraces(ctx, p.conn, query)
if err == nil {
metrics.RequestsTotal.With(prometheus.Labels{"subsystem": "trace", "handler": "find_traces", "code": "200"}).Inc()
traceExecutionTime.Observe(time.Since(start).Seconds())
traceRequestsExec.Add(1)
metrics.RequestsDuration.With(prometheus.Labels{"subsystem": "trace", "handler": "find_traces"}).Observe(time.Since(start).Seconds())
} else {
Expand Down
8 changes: 4 additions & 4 deletions pkg/telemetry/promql.go
Expand Up @@ -84,15 +84,15 @@ var promqlStats = []promqlTelemetry{
query: "histogram_quantile(0.99, sum by(le) (rate(promscale_metrics_query_remote_read_batch_duration_seconds_bucket[1h])))",
}, {
name: "trace_query_execution_time_p50",
query: "histogram_quantile(0.5, sum by(le) (rate(promscale_trace_fetch_traces_api_execution_duration_seconds_bucket[1h])))",
query: `histogram_quantile(0.5, sum by(le) (rate(promscale_query_duration_seconds_bucket{handler="find_traces"}[1h])))`,
}, {
name: "trace_query_execution_time_p90",
query: "histogram_quantile(0.9, sum by(le) (rate(promscale_trace_fetch_traces_api_execution_duration_seconds_bucket[1h])))",
query: `histogram_quantile(0.9, sum by(le) (rate(promscale_query_duration_seconds_bucket{handler="find_traces"}[1h])))`,
}, {
name: "trace_query_execution_time_p95",
query: "histogram_quantile(0.95, sum by(le) (rate(promscale_trace_fetch_traces_api_execution_duration_seconds_bucket[1h])))",
query: `histogram_quantile(0.95, sum by(le) (rate(promscale_query_duration_seconds_bucket{handler="find_traces"}[1h])))`,
}, {
name: "trace_query_execution_time_p99",
query: "histogram_quantile(0.99, sum by(le) (rate(promscale_trace_fetch_traces_api_execution_duration_seconds_bucket[1h])))",
query: `histogram_quantile(0.99, sum by(le) (rate(promscale_query_duration_seconds_bucket{handler="find_traces"}[1h])))`,
},
}

0 comments on commit 767d1eb

Please sign in to comment.