This commit is contained in:
2026-04-27 17:54:31 +02:00
parent 18ba64eaf8
commit 650cca7337
10 changed files with 148 additions and 4 deletions

View File

@@ -1,7 +1,26 @@
from fastapi import FastAPI
from fastapi import FastAPI, Depends, HTTPException
from .auth import init_db, verify_api_key
from .models import Event, BatchEvents
from .enrichment import enrich_event
from .influx import write_event
import logging
logging.basicConfig(level=logging.INFO)
init_db()
app = FastAPI(title="Signal - Roblox Telemetry")
@app.get("/health")
async def health():
return {"status": "ok"}
return {"status": "ok"}
@app.post("/api/log")
async def ingest_event(payload: Event | BatchEvents, game: str = Depends(verify_api_key)):
if isinstance(payload, BatchEvents):
for event in payload.events:
enriched = enrich_event(event, game)
write_event(enriched)
else:
enriched = enrich_event(payload, game)
write_event(enriched)
return {"success": True}