tags dev
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user