from typing import Callable
from prometheus_fastapi_instrumentator.metrics import Info
from prometheus_client import Counter

def total_animal_prediction() -> Callable[[Info], None]:
    METRIC = Counter(
        "total_animal_prediction", 
        "Number of times a certain animal has been reported.", 
        labelnames=("animals",)
    )

    def instrumentation(info: Info) -> None:
        if info.modified_handler == "/predict":
            animal = info.response.headers.get("predicted_class")
            if animal:
                METRIC.labels(animal).inc()

    return instrumentation
e30177d38ed4373845382f3fa6c18475556753ae
<mask token>

<mask token>


def total_animal_prediction() ->Callable[[Info], None]:
    METRIC = Counter('total_animal_prediction',
        'Number of times a certain animal has been reported.', labelnames=(
        'animals',))

    def instrumentation(info: Info) ->None:
        if info.modified_handler == '/predict':
            animal = info.response.headers.get('predicted_class')
            if animal:
                METRIC.labels(animal).inc()
    return instrumentation

from typing import Callable
from prometheus_fastapi_instrumentator.metrics import Info
from prometheus_client import Counter


def total_animal_prediction() ->Callable[[Info], None]:
    METRIC = Counter('total_animal_prediction',
        'Number of times a certain animal has been reported.', labelnames=(
        'animals',))

    def instrumentation(info: Info) ->None:
        if info.modified_handler == '/predict':
            animal = info.response.headers.get('predicted_class')
            if animal:
                METRIC.labels(animal).inc()
    return instrumentation

from typing import Callable
from prometheus_fastapi_instrumentator.metrics import Info
from prometheus_client import Counter

def total_animal_prediction() -> Callable[[Info], None]:
    METRIC = Counter(
        "total_animal_prediction", 
        "Number of times a certain animal has been reported.", 
        labelnames=("animals",)
    )

    def instrumentation(info: Info) -> None:
        if info.modified_handler == "/predict":
            animal = info.response.headers.get("predicted_class")
            if animal:
                METRIC.labels(animal).inc()

    return instrumentation