Validate telemetry schema readiness and stop exporters before closing dependencies
This commit is contained in:
@@ -409,7 +409,7 @@
|
||||
"targets": [
|
||||
{
|
||||
"refId": "A",
|
||||
"expr": "rate(otelcol_exporter_send_failed_spans[1m])"
|
||||
"expr": "rate(otelcol_exporter_send_failed_spans_total[1m])"
|
||||
}
|
||||
],
|
||||
"gridPos": {
|
||||
|
||||
@@ -50,10 +50,10 @@ async def lifespan(app):
|
||||
app.state.upload_slots = BoundedSemaphore(1)
|
||||
logger.info(json.dumps({"event": "started", "storage": "postgres"}))
|
||||
yield
|
||||
app.state.storage.close()
|
||||
app.state.store.close()
|
||||
logger.info(json.dumps({"event": "stopped"}))
|
||||
app.state.telemetry.close()
|
||||
app.state.storage.close()
|
||||
app.state.store.close()
|
||||
|
||||
|
||||
app = FastAPI(lifespan=lifespan, docs_url=None, redoc_url=None, openapi_url=None)
|
||||
|
||||
@@ -106,7 +106,7 @@ class PostgresStore:
|
||||
conn.execute(
|
||||
"SELECT u.id,u.password_hash,c.id,m.chat_id,msg.id,s.token_digest,r.key,"
|
||||
"a.id,a.stage_key,a.pipeline_version,a.variants,ma.attachment_id,ui.object_key,"
|
||||
"j.id,j.source_key,j.attempt_limit,j.lease_until,o.job_id,o.published_at,"
|
||||
"j.id,j.source_key,j.attempt_limit,j.lease_until,j.traceparent,j.tracestate,j.accepted_at,o.job_id,o.published_at,"
|
||||
"audit.job_id,f.error_code FROM users u,chats c,members m,messages msg,"
|
||||
"sessions s,message_requests r,attachments a,message_attachments ma,"
|
||||
"upload_intents ui,attachment_jobs j,job_outbox o,job_audit audit,failed_jobs f "
|
||||
|
||||
Reference in New Issue
Block a user