jaegertracing/jaeger · error

please provide at least one service name

Error message

please provide at least one service name

What it means

The metrics query parser builds metricstore.BaseQueryParameters from the HTTP query string. Jaeger's metrics endpoints require at least one service name; when the `service` query parameter is absent entirely, parseMetricsQueryParams returns this parse error wrapped with the offending parameter name. Empty-but-present values are accepted here — it is the missing key itself that triggers the error.

Source

Thrown at cmd/jaeger/internal/extension/jaegerquery/internal/query_parser.go:106

//
//	query ::= services , [ '&' optionalParams ]
//	optionalParams := param | param '&' optionalParams
//	param ::=  groupByOperation | endTs | lookback | step | ratePer | spanKinds
//	services ::= service | service '&' services
//	service ::= 'service=' strValue
//	groupByOperation ::= 'groupByOperation=' boolValue
//	endTs ::= 'endTs=' intValue in unix milliseconds
//	lookback ::= 'lookback=' intValue duration in milliseconds
//	step ::= 'step=' intValue duration in milliseconds
//	ratePer ::= 'ratePer=' intValue duration in milliseconds
//	spanKinds ::= spanKind | spanKind '&' spanKinds
//	spanKind ::= 'spanKind=' spanKindType
//	spanKindType ::= "unspecified" | "internal" | "server" | "client" | "producer" | "consumer"
func (p *queryParser) parseMetricsQueryParams(r *http.Request) (bqp metricstore.BaseQueryParameters, err error) {
	query := r.URL.Query()
	services, ok := query[serviceParam]
	if !ok {
		return bqp, newParseError(errors.New("please provide at least one service name"), serviceParam)
	}
	bqp.ServiceNames = services

	bqp.GroupByOperation, err = parseBool(r, groupByOperationParam)
	if err != nil {
		return bqp, err
	}
	bqp.SpanKinds, err = parseSpanKinds(r, spanKindParam, defaultMetricsSpanKinds)
	if err != nil {
		return bqp, err
	}
	endTs, err := p.parseTime(r, endTsParam, time.Millisecond)
	if err != nil {
		return bqp, err
	}
	parser := newDurationUnitsParser(time.Millisecond)
	lookback, err := parseDuration(r, lookbackParam, parser, defaultMetricsQueryLookbackDuration)
	if err != nil {

View on GitHub (pinned to 806f444784)

Solutions

  1. Add a service query parameter to the request, e.g. ?service=checkout (repeatable: service=a&service=b).
  2. If the service name comes from a UI variable, ensure it is populated/defaulted before rendering the request.
  3. Check the endpoint path — if you meant to browse traces without a service, use the trace search endpoint, not metrics.

Example fix

// before
GET /api/metrics/minqty?endTs=1700000000000&spanKind=server
// after
GET /api/metrics/minqty?service=payments&endTs=1700000000000&spanKind=server
Defensive patterns

Strategy: validation

Validate before calling

u, _ := url.Parse(req.URL)
if len(u.Query()["service"]) == 0 {
    return errors.New("metrics request must include at least one service query parameter")
}

Try / catch

resp, err := http.Get(metricsURL)
if err != nil || resp.StatusCode == http.StatusBadRequest {
    body, _ := io.ReadAll(resp.Body)
    if strings.Contains(string(body), "service name") {
        return fmt.Errorf("metrics query needs ?service=... ; got %s", body)
    }
    return err
}

Prevention

When it happens

Trigger: GET/POST to a Jaeger metrics endpoint (/api/metrics/...) without a `service` query parameter, e.g. GET /api/metrics/minsecs or /api/metrics/latency with only params like quantile/endTs.

Common situations: Hand-crafted curl calls to metrics endpoints omitting service=; dashboards whose service dropdown initializes empty; API clients copied from trace-search examples where service is optional but metrics endpoints require it.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of jaegertracing/jaeger@806f444784 (2026-09-01). Data as JSON: /api/errors/bf51ab438f7a5608. Report an issue: GitHub.