Skip to content

Add query parameter to search API for traceQL queries#1729

Merged
yvrhdn merged 6 commits intografana:mainfrom
yvrhdn:kvrhdn/traceql-api
Sep 9, 2022
Merged

Add query parameter to search API for traceQL queries#1729
yvrhdn merged 6 commits intografana:mainfrom
yvrhdn:kvrhdn/traceql-api

Conversation

@yvrhdn
Copy link
Copy Markdown
Contributor

@yvrhdn yvrhdn commented Sep 9, 2022

What this PR does:
Extends the search API to accept a query parameter q which can optionally contain a traceQL query. Query is already validated but not yet implemented (it will return 501 Not Implemented).

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added I'll add docs once traceQL queries are implemented
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Comment thread pkg/api/http.go
const (
URLParamTraceID = "traceID"
// search
urlParamQuery = "q"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed Loki and Prometheus both use query instead. I think we opted for q since this is least likely to conflict with tag lookups using the old top-level query parameters.

Loki's API: https://grafana.com/docs/loki/latest/api/#query-loki
Prometheus' API: https://prometheus.io/docs/prometheus/latest/querying/api/#instant-queries

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good on q

Comment thread pkg/tempopb/tempo.proto Outdated
Comment thread pkg/api/http.go Outdated
@yvrhdn yvrhdn enabled auto-merge (squash) September 9, 2022 16:07
@yvrhdn yvrhdn merged commit 38d8d98 into grafana:main Sep 9, 2022
@yvrhdn yvrhdn deleted the kvrhdn/traceql-api branch September 9, 2022 16:24
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

Successfully merging this pull request may close these issues.

2 participants