open-telemetry / opentelemetry-php

The OpenTelemetry PHP Library
https://opentelemetry.io/docs/instrumentation/php/
Apache License 2.0
750 stars 186 forks source link

Make Clock respect a certain time zone. #449

Closed tidal closed 3 years ago

tidal commented 3 years ago

Is your feature request related to a problem? Systems, networks, etc. may span multiple time zones and tracing data should be able to be synced to a reference time zone (eg. UTC)

Describe the solution you'd like Enable the Clock class to be set to a certain time zone. Here is an example how this could be implemented: https://github.com/lcobucci/clock/tree/2.1.x/src

Describe alternatives you've considered Make UTC a standard in Clock, but that would be a similar effort and much less convenient for users.

Blacksmoke16 commented 3 years ago

Why would you need to use a different timezone? The Clock implementation is based on Unix timestamps, which is what the spec requires, and is already timezone independent.

See https://github.com/open-telemetry/opentelemetry-specification/blob/v1.7.0/specification/trace/api.md#time.

tidal commented 3 years ago

@Blacksmoke16 Yes, sorry, you are correct. I mixed somtehing up. I will close this issue.