open-telemetry / opentelemetry-collector

OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
4.46k stars 1.47k forks source link

[componentstatus] Consider removing timestamp from Event #10763

Open TylerHelmuth opened 3 months ago

TylerHelmuth commented 3 months ago
          Timestamp seem to be use-less, because it is always "now", which means consumers (watchers) can also read if they need it.

_Originally posted by @bogdandrutu in https://github.com/open-telemetry/opentelemetry-collector/pull/10730#discussion_r1697387726_

mwear commented 3 months ago

I believe that we should keep the timestamp as the observed time is not the same time as the observation. Since status watchers are dispatched in sequence, any status watcher that does a non-trivial amount of work, or something that could block (like writing to an event to a channel) could delay the observed time for subsequent watchers. This would be especially problematic if the delay was variable between invocations. Currently the timestamp is used by the health check extension for time calculations.