census-instrumentation / opencensus-go

A stats collection and distributed tracing framework
http://opencensus.io
Apache License 2.0
2.05k stars 327 forks source link

metric: document how to use the Registry and export metrics out #1258

Open odeke-em opened 3 years ago

odeke-em commented 3 years ago

Please answer these questions before submitting a bug report.

What version of OpenCensus are you using?

Irrelevant

What version of Go are you using?

Irrelevant

What did you do?

I am trying to use this "go.opencensus.io/metric" package to get a gauge for up metrics from the OpenTelemetry collector's prometheus receiver per https://github.com/open-telemetry/opentelemetry-collector/pull/2918, but there are no examples. The only present example is incomplete in https://pkg.go.dev/go.opencensus.io/metric#example-Registry.AddInt64Gauge

Screen Shot 2021-05-02 at 3 40 12 PM

The package is challenging to use. For context I used to work on these libraries and wrote and lead a huge chunk of OpenCensus / OpenTelemetry exporters and libraries, but I can't use this package and have digging for very many hours.

What did you expect to see?

A straightforward way to use these libraries

What did you see instead?

Impossible to use them to export out metrics, and work is stalled. I think for now I am going to keep using the straightforward go.opencensus.io/stats/view code given that the OpenTelemetry collector itself uses those.

Kindly cc-ing @bogdandrutu @rakyll @alolita @Aneurysm9

punya commented 3 years ago

Thanks for the feedback @odeke-em. Do you have any suggestions for how to proceed? We'll start looking into this as well.