Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add jaeger rest endpoints for grafana tracing support #4197

Merged
merged 32 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
9ff0320
feat: add jaeger rest endpoints for grafana tracing support
etolbakov Nov 26, 2023
113e2a4
chore: minor enhancements, add a couple of tests
etolbakov Nov 27, 2023
72c6515
chore: use require helper method for optional jaeger parameter
etolbakov Nov 28, 2023
894e01f
chore: path renaming as per CR
etolbakov Nov 30, 2023
546db84
chore: apply CR suggestions, small improvements
etolbakov Dec 2, 2023
fdf1b73
feat: add jaeger structs and helper methods
etolbakov Dec 5, 2023
40400b1
chore: add process, process_id handling logic
etolbakov Dec 8, 2023
de10253
chore: add request param duration parsing logic
etolbakov Dec 8, 2023
870f389
Merge branch 'main' into etolbakov/grafana-tracing-support
etolbakov Dec 9, 2023
7e2fc6d
chore: minor style adjustments
etolbakov Dec 9, 2023
2153182
chore: extract common logic into a method for traces
etolbakov Dec 9, 2023
18b8e1f
Review.
fmassot Dec 10, 2023
b9a3380
Make tests work.
fmassot Dec 10, 2023
b759a64
Merge pull request #1 from etolbakov/fmassot-feedback
fmassot Dec 10, 2023
673a75e
chore: add tests
etolbakov Dec 12, 2023
76f85fe
Refactor.
fmassot Dec 12, 2023
11f56e0
chore: add swagger docs
etolbakov Dec 14, 2023
6ec17a0
fix: remove go_parse_duration dependency, util.rs
etolbakov Dec 17, 2023
ccd5eda
Merge branch 'main' into etolbakov/grafana-tracing-support
etolbakov Dec 17, 2023
fe6c823
Merge branch 'main' into etolbakov/grafana-tracing-support
etolbakov Dec 18, 2023
1eee76d
chore: fix linting
etolbakov Dec 18, 2023
0ba83d7
Refactor parse duration for jaeger.
fmassot Dec 19, 2023
94ed608
Clean.
fmassot Dec 19, 2023
2a8c88b
Merge pull request #2 from etolbakov/fmassot/parsing-duration
fmassot Dec 19, 2023
3642cef
Merge branch 'main' into etolbakov/grafana-tracing-support
etolbakov Dec 20, 2023
a37fa74
chore: apply clippy suggestion
etolbakov Dec 20, 2023
d28af8e
fix: add tags support
etolbakov Dec 20, 2023
62bc994
chore: apply clippy suggestions
etolbakov Dec 20, 2023
3e7e153
chore: adjust the tag logic, add assertions for tags
etolbakov Dec 21, 2023
72ef969
Last commit before merging.
fmassot Dec 21, 2023
62f6497
Remove collect_vec
fmassot Dec 21, 2023
5bae411
Use bytes in jaeger models.
fmassot Dec 21, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions quickwit/quickwit-serve/src/jaeger_api/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ pub struct TracesSearchQueryParams {
pub operation: Option<String>,
pub start: Option<i64>,
pub end: Option<i64>,
pub tags: Option<String>,
etolbakov marked this conversation as resolved.
Show resolved Hide resolved
pub min_duration: Option<String>,
pub max_duration: Option<String>,
pub lookback: Option<String>,
Expand Down
13 changes: 12 additions & 1 deletion quickwit/quickwit-serve/src/jaeger_api/rest_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.

use std::collections::HashMap;
use hyper::StatusCode;
use itertools::Itertools;
use quickwit_jaeger::JaegerService;
Expand Down Expand Up @@ -114,8 +115,13 @@ pub fn jaeger_service_operations_handler(
params(
TracesSearchQueryParams,
("service" = Option<String>, Query, description = "The service name."),
("operation" = Option<String>, Query, description = "The operation name."),
("start" = Option<i64>, Query, description = "The start time in nanoseconds."),
("end" = Option<i64>, Query, description = "The end time in nanoseconds."),
("tags" = Option<String>, Query, description = "Sets tags with values in the logfmt format, such as error=true status=200."),
etolbakov marked this conversation as resolved.
Show resolved Hide resolved
("min_duration" = Option<String>, Query, description = "Filters all traces with a duration higher than the set value. Possible values are 1.2s, 100ms, 500us."),
("max_duration" = Option<String>, Query, description = "Filters all traces with a duration lower than the set value. Possible values are 1.2s, 100ms, 500us."),
("limit" = Option<i32>, Query, description = "Limits the number of traces returned."),
)
)]
pub fn jaeger_traces_search_handler(
Expand Down Expand Up @@ -194,10 +200,14 @@ async fn jaeger_traces_search(
.max_duration
.map(parse_duration_with_units)
.transpose()?;
let tags = search_params
.tags
.map(|s| serde_json::from_str::<HashMap<String, String>>(&s).unwrap_or_default())
.unwrap_or(Default::default());
let query = TraceQueryParameters {
service_name: search_params.service.unwrap_or_default(),
operation_name: search_params.operation.unwrap_or_default(),
tags: Default::default(),
tags,
start_time_min: search_params.start.map(to_well_known_timestamp),
start_time_max: search_params.end.map(to_well_known_timestamp),
duration_min,
Expand Down Expand Up @@ -397,6 +407,7 @@ mod tests {
.path(
"/otel-traces-v0_6/jaeger/api/traces?service=quickwit&\
operation=delete_splits_marked_for_deletion&minDuration=500us&maxDuration=1.2s&\
tags=%7B%22tag.first%22%3A%22common%22%2C%22tag.second%22%3A%22true%22%7D&\
etolbakov marked this conversation as resolved.
Show resolved Hide resolved
limit=1&start=1702352106016000&end=1702373706016000&lookback=custom",
)
.reply(&jaeger_api_handler)
Expand Down
Loading