You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Values [][]json.RawMessage`json:"values"`// [timestamp, value] where value can be string or number
251
252
}
252
253
253
254
// QueryRangeResponse represents the response from Loki's query_range API
@@ -341,10 +342,11 @@ type QueryLokiLogsParams struct {
341
342
Directionstring`json:"direction,omitempty" jsonschema:"description=Optionally, the direction of the query: 'forward' (oldest first) or 'backward' (newest first, default)"`
342
343
}
343
344
344
-
// LogEntry represents a single log entry with metadata
345
+
// LogEntry represents a single log entry or metric sample with metadata
345
346
typeLogEntrystruct {
346
347
Timestampstring`json:"timestamp"`
347
-
Linestring`json:"line"`
348
+
Linestring`json:"line,omitempty"`// For log queries
349
+
Value*float64`json:"value,omitempty"`// For metric queries
// QueryLokiLogs is a tool for querying logs from Loki
415
449
varQueryLokiLogs=mcpgrafana.MustTool(
416
450
"query_loki_logs",
417
-
"Query and retrieve log entries from a Loki datasource using LogQL. Returns log lines with timestamps and labels. Use query_loki_stats first to check stream size, then list_loki_label_names/values to verify labels exist. Supports full LogQL syntax including filters and expressions.",
451
+
"Query and retrieve log entries or metric values from a Loki datasource using LogQL. Returns either log lines or numeric values with timestamps and labels. Use query_loki_stats first to check stream size, then list_loki_label_names/values to verify labels exist. Supports full LogQL syntax including both log queries and metric queries (e.g., rate, count_over_time).",
0 commit comments