getsentry / sentry

Developer-first error tracking and performance monitoring
https://sentry.io
Other
39.1k stars 4.2k forks source link

User Feedback: metrics are registered but do not show up in UI #71906

Open sentry-io[bot] opened 5 months ago

sentry-io[bot] commented 5 months ago

Sentry Feedback: JAVASCRIPT-2TCF

While testing Metrics on a node.js application, I noticed that the metrics were registered - https://prithvi-0c.sentry.io/performance/trace/bb7d30ac44d736458771daf104a6bf8e/?node=txn-ae8be857d56847c4bc5ea4ee592de3df&statsPeriod=1h&timestamp=1717076023

But it did not show up on the UI - https://prithvi-0c.sentry.io/metrics/?interval=1d&project=6307748&statsPeriod=30d

contact_email prithvirajkumar.rajakumar@sentry.io
name prithvirajkumar.rajakumar@sentry.io
source new_feedback_envelope
shellmayr commented 5 months ago

Preliminary investigation showed:

  1. The metric summary is sent to the service along with the span/trace and is displayed as an emitted metric.
  2. The metric itself did not leave a trace on Relay, or storage.
  3. The metric and the metric summary on the span are sent with different requests, more specifically the metric itself may be sent in a delayed manner. If e.g. the process is shutdown using Ctrl-C, this could cause the metric to not be sent at all if there is no graceful shutdown.

The hypothesis is therefore that the NodeJS SDK is not finishing up gracefully and sending metrics when it shuts down, causing some of these missing messages.