Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ObservableGauge StartTimeStamp could be None instead of zero #3678

Closed
tammy-baylis-swi opened this issue Feb 8, 2024 · 2 comments · Fixed by #4004
Closed

ObservableGauge StartTimeStamp could be None instead of zero #3678

tammy-baylis-swi opened this issue Feb 8, 2024 · 2 comments · Fixed by #4004
Assignees
Labels
bug Something isn't working

Comments

@tammy-baylis-swi
Copy link
Contributor

Describe your environment

I'm using the ObservableGauge (like the docs example) and have my setup exporting by OTLP to an otel collector instance that exports to logging. I noticed the StartTimestamp is zeroed out in every exported metrics message:

Metric #1
Descriptor:
     -> Name: my.gauged.value
     -> Description: 
     -> Unit: 
     -> DataType: Gauge
NumberDataPoints #0
Data point attributes:
     -> status: Bool(true)
StartTimestamp: 1970-01-01 00:00:00 +0000 UTC
Timestamp: 2024-01-26 19:33:04.70007188 +0000 UTC
Value: 1

I've seen this with both unreleased SDK installed on my local (1.23.0.dev) and older release (1.20.0), on Python 3.9 in a locally-running Linux docker container.

Steps to reproduce
Describe exactly how to reproduce the error. Include a code sample if applicable.

  1. Set up a docker container to run an instrumented Python script/service like the docs example
  2. Set up a 2nd container to run image: otel/opentelemetry-collector:latest, configured with logging exporter.
  3. Point instrumented container to otelcol, e.g. OTEL_EXPORTER_OTLP_ENDPOINT="http://otel-collector:4318"
  4. Run so instrumented container exports to otelcol, which exports to logs.

What is the expected behavior?
StartTimestamp of None.

Originally I thought it should be the time of startup of the instrumented app, but it's not so appropriate for the temporality and aggregation of the ObservableGauge type (proto).

What is the actual behavior?
StartTimestamp: 1970-01-01 00:00:00 +0000 UTC, which is a little misleading

Additional context

@tammy-baylis-swi tammy-baylis-swi added the bug Something isn't working label Feb 8, 2024
@tammy-baylis-swi
Copy link
Contributor Author

cc @ocelotl

@aabmass
Copy link
Member

aabmass commented Jul 11, 2024

Discussed in SIG. This is the expected behavior for protobuf regardless of if the field is set to zero or unset. See https://protobuf.dev/programming-guides/proto3/#default

There is something called field presence but I don't think this feature is being used here (start time is not marked optional to enable explicit presence)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants