check-alerts worker: 13 error spans (mongodb.create, NamespaceExists) every minute because mongoose autoCreate is still on
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- mongodb, typescript
- Área
- backend, observability
Línea de trabajo
Empieza leyendo DefaultAlertProvider.init() y asyncDispose() en el worker check-alerts; después, inspecciona cómo connectDB pasa las opciones de Mongoose. PR #2887 es un contexto relevante para autoIndex. Confirma que autoCreate: false se aplica a la conexión de ese worker; luego ejecuta el worker o las pruebas pertinentes y comprueba que las ejecuciones repetidas ya no emitan los 13 spans de error de mongodb.create.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What happened?
Our self-hosted HyperDX sends its own telemetry to a collector, so we see what the check-alerts worker does. Every minute its trace contains 13 failed spans named mongodb.create with the status message "Collection already exists", one per model: hyperdx.alerts, alerthistories, connections, dashboards, favorites, pinnedfilters, presetdashboardfilters, savedsearches, sources, teams, teaminvites, users and webhooks. On an idle instance that adds up to roughly 19 000 error spans a day, and the Service Dashboard shows a 55 % client error rate for the hyperdx service. Nothing is actually broken, alerts still run.
The cause, as far as I can tell from the code: DefaultAlertProvider.init() opens a new connection on every run (connectDB with autoIndex false) and asyncDispose() closes it again. Mongoose still has autoCreate on, so on every fresh connection Model.init() calls createCollection for each model. The collections exist, MongoDB answers NamespaceExists (code 48), Mongoose ignores that error, but the OpenTelemetry mongodb instrumentation has already recorded a failed command.
PR #2887 turned autoIndex off in that worker for the same reason (the API service owns the schema). Passing autoCreate: false alongside it should remove the 13 commands per run. Happy to open that PR if you want it.
Steps to reproduce
- Run the hyperdx image with HYPERDX_API_KEY and OTEL_EXPORTER_OTLP_ENDPOINT pointing at a collector.
- Wait a minute for the check-alerts cron.
- Search traces for
StatusCode:Error– 13 mongodb.create spans per minute.
How are you running HyperDX?
Self-hosted, image hyperdx/hyperdx:2.40.0 with mongo:5.0.32 as rootless Podman containers; own ClickHouse 26.8 and OpenTelemetry Collector 0.162.0 on separate hosts.
Where does it show up?
In the traces of the hyperdx service itself (Search with source Traces, Service Dashboard). Not a UI bug.
Debug info
N/A (worker process, not the UI)
Logs
SpanName: mongodb.create (Client)
StatusCode: Error
StatusMessage: Collection already exists. NS: hyperdx.teams
ScopeName: @opentelemetry/instrumentation-mongodb 0.52.0
service.version: 2.40.0
- Lenguaje dominante
- TypeScript
- Estrellas
- 10k
- Forks
- 508
- Merge medio
- 2 d 9 h
- PR fusionados (30 d)
- 156
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de hyperdxio/hyperdx
-
Metric chart with aggFn increase and a multi-column group-by fails: toString() gets several argumentsPosiblemente ocupada @CG-5228 la tomó hace 9 días. Abiertoexternal
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
hyperdxio/hyperdx#3477 · 1 comentario ·
Los mantenedores suelen responder en 2 días
-
Slack notifications for inline alerts fail when the chart-explorer link passes Slack's 3000-character block limitPosiblemente ocupada @Tyagiquamar la tomó hace 11 días. Abiertoalerting bug external
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 2 días
-
systeminformation resolution still allows 5.30.7 -- command injection in networkInterfaces()Abiertoexternal
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días
-
Replace `as any` mock fixtures in three app test files with shoehornPosiblemente ocupada @k4its1t la tomó hace 74 días. Abiertogood first issue
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
hyperdxio/hyperdx#2852 · 1 reacción ·
Los mantenedores suelen responder en 2 días
Todos los issues de hyperdxio/hyperdx
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
vercel-labs/durable-harness#53 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: Redesign tab bars ignore clicks on Linux: hidden chat layers keep window drag regionsPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día
-
experiência: a doc manda subir para o Micro do Supabase, mas não diz que exige plano pago nem quanto custaPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoarea/docs area/ui enhancement
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
melgarafael/DeskcommCRM#4098 ·
Los mantenedores suelen responder en 1 día
-
bug ready-for-agent
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
kerti/balances-v2#801 ·
Los mantenedores suelen responder en 1 día
-
lesson-submission pending-review
Dificultad 1/5 Menos de una hora Aptitud para principiantes 84/100
Ikalus1988/MisakaNet#4510 ·
Los mantenedores suelen responder en 1 día