Metric flush cannot be triggered automatically

Aperta
#1,949 1 commento 2 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
aws, nodejs

Direzione di ricerca

Start with the linked otlp-lambda-example reproduction and its docs/test-results.md automatic-flush section, using the Node.js 20 and listed layer versions. Trace the automatic flush and shutdown behavior around the HTTP exporter timeout and repeated Grafana emissions. Done means the root cause is identified and the expected metric export completes without timeout or duplicate emissions.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug javascript

Describe the bug
I noticed that automatic flushing is triggered before lambda receives shutdown signal. However, it makes the http exporter fail with http timeout.

Forcing the metric flush or triggering shutdown sequence during lambda invocation works. In this case, I've observed same metric being emitted to grafana 5 times, each 1 minute apart. This part of the bug may not be relevant to the project; but I'm unable to find the root cause.

Steps to reproduce
I've created this repo that simulates the behavior. You can find the details logs of the test results there as well.

What did you expect to see?
Basic config of otel exporter with http exproter successfully exports metrics.

What did you see instead?

ERROR	{"stack":"Error: PeriodicExportingMetricReader: metrics export failed (error Error: Request Timeout)\n    at d._doRun (/opt/773.wrapper.js:1:3565)\n    at processTicksAndRejections (node:internal/process/task_queues:95:5)\n    at runNextTicks (node:internal/process/task_queues:64:3)\n    at process.processTimers (node:internal/timers:516:9)\n    at async d._runOnce (/opt/773.wrapper.js:1:2894)\n    at async d.onForceFlush (/opt/773.wrapper.js:1:3784)\n    at async d.forceFlush (/opt/773.wrapper.js:1:2000)\n    at async ee.forceFlush (/opt/773.wrapper.js:1:21040)\n    at async Promise.all (index 0)\n    at async ne.forceFlush (/opt/773.wrapper.js:1:24412)","message":"PeriodicExportingMetricReader: metrics export failed (error Error: Request Timeout)","name":"Error"}

What version of collector/language SDK version did you use?
node20
layers:

  • opentelemetry-nodejs-0_16_0:1
  • opentelemetry-collector-amd64-0_17_0:1

What language layer did you use?
nodejs

Additional context

Reproducible version can be found in https://github.com/kaskavalci/otlp-lambda-example/tree/main

It's weird that when shutdown or forceflush is triggered, same metric appears 5 times in grafana. I appreaciate your comment on this as well.

Lingua principale
Go
Stelle
433
Fork
249
Merge medio
1g 12h
PR unite (30g)
39

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di open-telemetry/opentelemetry-lambda

Tutte le issue di open-telemetry/opentelemetry-lambda

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.