Python client to use the Hectiq Console
Project description
Hectiq console collector
A python package to track your inference API using the Hectiq Console.
This service is for Hectiq's client only.
Installation
The installation is only possible from the repo for now.
pip install hectiq-console
FastAPI
Below is an example how to use the middleware for FastAPI application.
import time
import random
from fastapi import FastAPI, Request
from hectiq_console import HectiqConsoleFastAPIMiddleware, store_metrics
app = FastAPI(title="Demo application")
app.add_middleware(HectiqConsoleFastAPIMiddleware,
ressource="hectiq-e2729",
custom_metrics={
"random-number": "float"
},
include_paths=["/predict"])
@app.get("/")
async def root():
return {"message": "🚨 This route is not monitored by the hectiq console."}
@app.get("/predict")
async def root(request: Request):
# Store a random number
store_metrics(request=request, key="random-number", value=random.random())
return {"message": "✅ This route is monitored by the hectiq console."}
Send a file
🔨 To do.
Create an incident
🔨 To do.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
hectiq_console-1.0.1.tar.gz
(4.2 kB
view hashes)
Built Distribution
Close
Hashes for hectiq_console-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b1dab9a5275627177f1283f7ac84e39043ac93cc5d77dc2bf222c1e84b277df |
|
MD5 | 8ea783c742614e074629244e40716eff |
|
BLAKE2b-256 | 2ae26ff278997f14ad9084e7df5e71e86a5269a8cbbcef7348fef62fbeb99e7d |