mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-15 04:22:38 +00:00
feat(telemetry:major): End to End Testing, Metric Capture, SQL Alchemy Injection
This commit is contained in:
parent
e815738936
commit
7e3cf1fb20
26 changed files with 2075 additions and 1006 deletions
|
|
@ -4,46 +4,19 @@
|
|||
# This source code is licensed under the terms described in the LICENSE file in
|
||||
# the root directory of this source tree.
|
||||
from abc import abstractmethod
|
||||
|
||||
from fastapi import FastAPI
|
||||
from pydantic import BaseModel
|
||||
from typing import Any
|
||||
|
||||
|
||||
class TelemetryProvider(BaseModel):
|
||||
"""
|
||||
TelemetryProvider standardizes how telemetry is provided to the application.
|
||||
"""
|
||||
|
||||
@abstractmethod
|
||||
def fastapi_middleware(self, app: FastAPI, *args, **kwargs):
|
||||
"""
|
||||
Injects FastAPI middleware that instruments the application for telemetry.
|
||||
"""
|
||||
...
|
||||
|
||||
@abstractmethod
|
||||
def custom_trace(self, name: str, *args, **kwargs) -> Any:
|
||||
"""
|
||||
Creates a custom trace.
|
||||
"""
|
||||
...
|
||||
|
||||
@abstractmethod
|
||||
def record_count(self, name: str, *args, **kwargs):
|
||||
"""
|
||||
Increments a counter metric.
|
||||
"""
|
||||
...
|
||||
|
||||
@abstractmethod
|
||||
def record_histogram(self, name: str, *args, **kwargs):
|
||||
"""
|
||||
Records a histogram metric.
|
||||
"""
|
||||
...
|
||||
|
||||
@abstractmethod
|
||||
def record_up_down_counter(self, name: str, *args, **kwargs):
|
||||
"""
|
||||
Records an up/down counter metric.
|
||||
"""
|
||||
...
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue