Skip to content

Commit 64749e5

Browse files
authored
Merge pull request #20 from VibeEngineeringAI/chore/sync-upstream-1819
chore: sync upstream parseablehq/parseable (parseablehq#1819)
2 parents 14f287c + ec9c3f4 commit 64749e5

2 files changed

Lines changed: 11 additions & 44 deletions

File tree

‎src/tool_catalog.rs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -448,16 +448,16 @@ pub fn oss_read_tool_specs() -> Vec<ToolSpec> {
448448
ToolSpec::new(
449449
"get_traces",
450450
"Get traces",
451-
"List bounded traces or spans from caller-visible trace datasets.",
451+
"List bounded traces or spans from one caller-visible trace dataset.",
452452
object_schema(
453453
json!({
454-
"datasets": { "type": "array", "minItems": 1, "maxItems": 10, "items": { "type": "string" } },
454+
"dataset": string_property("One trace dataset."),
455455
"serviceName": { "type": "string" },
456456
"startTime": string_property("RFC3339 range start."),
457457
"endTime": string_property("RFC3339 range end."),
458458
"limit": { "type": "integer", "minimum": 1, "maximum": 500, "default": 100 }
459459
}),
460-
&["startTime", "endTime"],
460+
&["dataset", "startTime", "endTime"],
461461
),
462462
),
463463
ToolSpec::new(
@@ -467,11 +467,11 @@ pub fn oss_read_tool_specs() -> Vec<ToolSpec> {
467467
object_schema(
468468
json!({
469469
"traceId": string_property("Trace ID."),
470-
"datasets": { "type": "array", "minItems": 1, "maxItems": 10, "items": { "type": "string" } },
470+
"dataset": string_property("One trace dataset."),
471471
"startTime": string_property("RFC3339 range start."),
472472
"endTime": string_property("RFC3339 range end.")
473473
}),
474-
&["traceId", "startTime", "endTime"],
474+
&["traceId", "dataset", "startTime", "endTime"],
475475
),
476476
),
477477
ToolSpec::new(

‎src/tool_executor.rs‎

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,11 @@ use serde_json::{Value, json};
66
use ulid::Ulid;
77

88
use crate::{
9-
handlers::{
10-
TelemetryType,
11-
http::{
12-
alerts, cluster, health_check, logstream,
13-
modal::query::querier_logstream,
14-
query, rbac, role, targets,
15-
users::{dashboards, filters},
16-
},
9+
handlers::http::{
10+
alerts, cluster, health_check, logstream,
11+
modal::query::querier_logstream,
12+
query, rbac, role, targets,
13+
users::{dashboards, filters},
1714
},
1815
parseable::PARSEABLE,
1916
prism::logstream::get_prism_logstream_info,
@@ -558,42 +555,12 @@ async fn execute_alert_target_tool(
558555
}
559556
}
560557

561-
fn trace_datasets(arguments: &Value, context: OssToolContext<'_>) -> Vec<String> {
562-
arguments
563-
.get("datasets")
564-
.and_then(Value::as_array)
565-
.map(|datasets| {
566-
datasets
567-
.iter()
568-
.filter_map(Value::as_str)
569-
.take(10)
570-
.map(str::to_owned)
571-
.collect::<Vec<_>>()
572-
})
573-
.filter(|datasets| !datasets.is_empty())
574-
.unwrap_or_else(|| {
575-
visible_datasets(context.tenant_id, context.session_key)
576-
.into_iter()
577-
.filter(|dataset| {
578-
PARSEABLE
579-
.get_stream(dataset, context.tenant_id)
580-
.is_ok_and(|stream| {
581-
stream.metadata.read().is_ok_and(|metadata| {
582-
metadata.telemetry_type == TelemetryType::Traces
583-
})
584-
})
585-
})
586-
.take(10)
587-
.collect()
588-
})
589-
}
590-
591558
async fn execute_trace_tool(
592559
name: &str,
593560
arguments: &Value,
594561
context: OssToolContext<'_>,
595562
) -> Result<Value, String> {
596-
let datasets = trace_datasets(arguments, context);
563+
let datasets = [required_string(arguments, "dataset")?.to_owned()];
597564
let start_time = required_string(arguments, "startTime")?.to_owned();
598565
let end_time = required_string(arguments, "endTime")?.to_owned();
599566
let limit = bounded_integer(arguments, "limit", 100, 1, 500) as usize;

0 commit comments

Comments
 (0)