Open yegle opened 3 years ago
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.
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
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.
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 https://github.com/census-ecosystem/opencensus-go-exporter-stackdriver/pull/277 to try to manage the MetricDescriptor by ourselves, but I think the root issue is the delayed MetricDescriptor.