Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

MetricDescriptor should be created as soon as the view is registered #281

Open
yegle opened this issue Jan 20, 2021 · 3 comments
Open

MetricDescriptor should be created as soon as the view is registered #281

yegle opened this issue Jan 20, 2021 · 3 comments
Labels
bug Something isn't working

Comments

@yegle
Copy link
Contributor

yegle commented Jan 20, 2021

Please answer these questions before submitting a bug report.

What version of the Exporter are you using?

0.13.4

What version of OpenCensus are you using?

0.22.5

What version of Go are you using?

1.15.7

What did you do?

We have a metric that are only recorded rarely. (i.e. the call to stat.Record() is in an if-statement and rarely reached). The metric may not get recorded for days.

What did you expect to see?

Regardless of how frequently the data point is produced, the MetricDescriptor is created ~instantly after the views are generated.

What did you see instead?

The MetricDescriptor is not created long after the new metric is added.

Additional context

I created #277 to try to manage the MetricDescriptor by ourselves, but I think the root issue is the delayed MetricDescriptor.

@yegle yegle added the bug Something isn't working label Jan 20, 2021
@miroslavLalev
Copy link

Any update on this? We also have the same problem and would love for it to be fixed, as we try to create Stackdriver alerts for the metrics.

@yegle
Copy link
Contributor Author

yegle commented Jul 22, 2021

FWIW this is our workaround (StartExporter will be called during server startup):
https://github.com/google/exposure-notifications-server/blob/7841200f6face7b648944be241362218d6f04588/pkg/observability/stackdriver.go#L116-L127

@miroslavLalev
Copy link

Hey, thanks for the idea! I did not check what is exported from the package and what isn't. We will give this approach a shot, but sadly, it is awkward to implement because conventionally, the views are separated from the exporters.

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

No branches or pull requests

2 participants