Skip to content

Commit

Permalink
Get tags and tag values from backend if start and end are provided (#…
Browse files Browse the repository at this point in the history
…2933)

* Support fetching tags from backend

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* Rename some methods to be more consistent

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* Add more integration tests

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

Add more integration tests

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

more stable tag sharding tests

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

Add more time for block completion

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

Add integration tests for new APIs

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* fix some lint issues

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* more linting issues

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* Fix bad resolved conflicit merge

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* Fix some e2e tests

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* make some structs privated

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* Check for autocomplete filter on tag fetch backend

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* Test simplification

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* Fix autocmplete filter enabled

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* Refactor tags handler to remove parseRequest

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* Fix linting issues

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* Make tests more robust

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* Remove unnecesary opts

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* Update modules/frontend/tagsharding.go

Co-authored-by: Mario <mariorvinas@gmail.com>

* Improve testing and comments

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* rename some methods to improve redability

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* Add documentation

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* Small comments

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* Add TODO regarding to MaxBytesPerTagValuesQuery

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* typo in comment

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* Fix rebase

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>

* Update modules/frontend/tagsharding.go

Co-authored-by: Mario <mariorvinas@gmail.com>

* Update docs/sources/tempo/api_docs/_index.md

Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>

* Update docs/sources/tempo/api_docs/_index.md

Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>

* Update docs/sources/tempo/api_docs/_index.md

Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>

* Update docs/sources/tempo/api_docs/_index.md

Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>

* Update docs/sources/tempo/api_docs/_index.md

Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>

* Assert metrics in test

* Shuffle structs around

* Clean up tempodb interfaces

* Fix incomplete merge

---------

Signed-off-by: Ruben Vargas <ruben.vp8510@gmail.com>
Co-authored-by: Mario <mariorvinas@gmail.com>
Co-authored-by: Kim Nylander <104772500+knylander-grafana@users.noreply.github.com>
  • Loading branch information
3 people authored Jan 29, 2024
1 parent 870b367 commit babdaa2
Show file tree
Hide file tree
Showing 31 changed files with 5,119 additions and 682 deletions.
2 changes: 2 additions & 0 deletions cmd/tempo/app/modules.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ func (t *App) initQuerier() (services.Service, error) {
ingesterRings = append(ingesterRings, ring)
}

t.cfg.Querier.AutocompleteFilteringEnabled = t.cfg.AutocompleteFilteringEnabled

querier, err := querier.New(
t.cfg.Querier,
t.cfg.IngesterClient,
Expand Down
33 changes: 31 additions & 2 deletions docs/sources/tempo/api_docs/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,20 @@ $ curl -G -s http://localhost:3200/api/search/tags?scope=span | jq
}
```
Parameters:
- `scope = (resource|span|intrinsic)`
Optional. Specifies the scope of the tags. If not specified, it means all scopes.
Default = `all`
- `start = (unix epoch seconds)`
Optional. Along with `end`, defines a time range from which tags should be returned.
- `end = (unix epoch seconds)`
Optional. Along with `start`, defines a time range from which tags should be returned. Providing both `start` and `end` will include blocks for the specified time range only.
### Search tags V2
Ingester configuration `complete_block_timeout` affects how long tags are available for search.
Ingester configuration `complete_block_timeout` affects how long tags are available for search. If start or end are not specified, it will only
fetch blocks that wasn't flushed to backend.
This endpoint retrieves all discovered tag names that can be used in search. The endpoint is available in the query frontend service in
a microservices deployment, or the Tempo endpoint in a monolithic mode deployment. The tags endpoint takes a scope that controls the kinds
Expand All @@ -301,6 +312,15 @@ of tags or attributes returned. If nothing is provided, the endpoint will return
GET /api/v2/search/tags?scope=<resource|span|intrinsic>
```
Parameters:
- `scope = (resource|span|intrinsic)`
Specifies the scope of the tags, this is an optional parameter, if not specified it means all scopes.
Default = `all`
- `start = (unix epoch seconds)`
Optional. Along with `end` define a time range from which tags should be returned.
- `end = (unix epoch seconds)`
Optional. Along with `start` define a time range from which tags should be returned. Providing both `start` and `end` will include blocks for the specified time range only.
#### Example
Example of how to query Tempo using curl.
Expand Down Expand Up @@ -340,7 +360,8 @@ $ curl -G -s http://localhost:3200/api/v2/search/tags | jq
### Search tag values
Ingester configuration `complete_block_timeout` affects how long tags are available for search.
Ingester configuration `complete_block_timeout` affects how long tags are available for search. If start or end are not specified, it will only
fetch blocks that wasn't flushed to backend.
This endpoint retrieves all discovered values for the given tag, which can be used in search. The endpoint is available in the query frontend service in
a microservices deployment, or the Tempo endpoint in a monolithic mode deployment. The following request will return all discovered service names.
Expand Down Expand Up @@ -368,6 +389,13 @@ $ curl -G -s http://localhost:3200/api/search/tag/service.name/values | jq
}
```
Parameters:
- `start = (unix epoch seconds)`
Optional. Along with `end`, defines a time range from which tags should be returned.
- `end = (unix epoch seconds)`
Optional. Along with `start`, defines a time range from which tags should be returned. Providing both `start` and `end` will include blocks for the specified time range only.
### Search tag values V2
This endpoint retrieves all discovered values and their data types for the given TraceQL identifier.
Expand Down Expand Up @@ -405,6 +433,7 @@ $ curl http://localhost:3200/api/v2/search/tag/.service.name/values | jq .
]
}
```
This endpoint can also receive `start` and `end` optional parameters. These parameters will define the time range from which the tags will be fetched
#### Filtered tag values
Expand Down
Loading

0 comments on commit babdaa2

Please sign in to comment.