35 lines
990 B
Python
35 lines
990 B
Python
from fastapi import APIRouter, HTTPException
|
|
|
|
from common.log.module_logger import ModuleLogger
|
|
from backend.services.starrocks_metrics_service import StarRocksMetricsService
|
|
|
|
router = APIRouter()
|
|
|
|
# Initialize service and logger
|
|
starrocks_service = StarRocksMetricsService()
|
|
module_logger = ModuleLogger(__file__)
|
|
|
|
|
|
@router.get("/starrocks/product/{product_id}/metric/{metric_name}/info")
|
|
async def get_metric_info(
|
|
product_id: str,
|
|
metric_name: str
|
|
):
|
|
"""
|
|
Get information about a specific StarRocks-backed metric.
|
|
|
|
Args:
|
|
product_id: Product identifier for the product's data.
|
|
metric_name: Name of the StarRocks-backed metric.
|
|
"""
|
|
await module_logger.log_info(
|
|
f"Getting StarRocks metric info for metric '{metric_name}' from product '{product_id}'"
|
|
)
|
|
|
|
metric_info = await starrocks_service.get_metric_info(product_id, metric_name)
|
|
|
|
return {
|
|
"metric_info": metric_info,
|
|
"description": f"Information about StarRocks metric '{metric_name}' in product '{product_id}'",
|
|
}
|