This commit is contained in:
Alexey
2025-09-18 18:01:06 +02:00
parent d2db261152
commit b8885d7d73
5 changed files with 45 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
# contains the router for the aggregates endpoint
from fastapi import APIRouter, Query, Request
from typing import List
from typing import List, Dict
from .aggregate_schema import AggregateSchema, MetricEnum
from .aggregate_service import get_aggregates
@@ -13,4 +13,11 @@ async def aggregates_endpoint(
request: Request,
metric: MetricEnum = Query(MetricEnum.relative, description="Metric type"),
):
return await get_aggregates(request, metric)
# Extract tag parameters from query string
tags: Dict[str, str] = {}
for param_name, param_value in request.query_params.items():
if param_name.startswith("tag."):
tag_key = param_name[4:]
tags[tag_key] = param_value
return await get_aggregates(request, metric, tags)