Is it possible to reset *view.Data on each call to ExportView

17 переглядів
Перейти до першого непрочитаного повідомлення

Jack L

не прочитано,
29 лип. 2019 р., 00:02:0129.07.19
Кому: census-d...@googlegroups.com
Hi,

I'm writing an exporter in Go and am attempting to implement the function ExportView(vd *view.Data).  I'm exporting to a system that does not understand cumulative counters.  I need to send the delta of values, not the total value, each time.  I've noticed that each time ExportView is called for a view setup with view.Count() or view.Sum(), I'm getting the cumulative values.  Is it possible to just get the delta?

I could remember and send deltas easily enough, but things get much more tricky with view.Distribution. For this, I would also want the distribution of values between calls to ExportView but I appear to get the total distribution.  Is there a way to get just the distribution between calls?

Thanks!

Morgan McLean

не прочитано,
29 лип. 2019 р., 12:20:0929.07.19
Кому: Jack L, Rahul Patel, census-developers
+ Rahul

--
You received this message because you are subscribed to the Google Groups "census-developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to census-develop...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/census-developers/CAPU42pOW%3DFpXVtCOd1fRFFTj-TxyuHOsDuMUcTV3M%2B5N-DgWDA%40mail.gmail.com.

Rahul Patel

не прочитано,
29 лип. 2019 р., 13:56:0929.07.19
Кому: Morgan McLean, Jack L, census-developers
Hi Jack,

It is not possible to get delta from the library. You would need to do something like metric-adjuster used for scraping prometheus. In a nut-shell metric-adjuster caches the first value and then subtracts the first value from any subsequent value. This is slightly different from what you want. You need to delta compare to previous. With slight modification you should be able to use it.

BTW, you should use ExportMetrics api instead of ExportView.

-Rahul

Jack L

не прочитано,
29 лип. 2019 р., 14:54:0929.07.19
Кому: Rahul Patel, Morgan McLean, census-developers
Thanks!   I was following the documentation on https://opencensus.io/exporters/custom-exporter/go/metrics/ which uses     ExportView(vd *view.Data).  Why should I use ExportMetrics instead?

Rahul Patel

не прочитано,
29 лип. 2019 р., 15:14:2429.07.19
Кому: Jack L, Morgan McLean, census-developers
Metrics is new (better) representation of aggregated data. ExportMetrics API uses this new format. ExportView will be deprecated. 
Also, currently we are working on Open-Telemetry (merge of OpenCensus and OpenTracing). In OpenTelemetry export api will be aligned to ExportMetrics.

-Rahul

Eric Shen

не прочитано,
14 черв. 2021 р., 21:37:1814.06.21
Кому: census-developers
Hi Rahul, 

I am using OpenCensus Java client lib and Prometheus exporter. I noticed the same issue. This thread is almost 2 yrs old. I am wondering if OpenCensus now supports delta out of box? Or I still write my own metric-adjuster? 

Thanks, 

Eric

Відповісти всім
Відповісти автору
Переслати
0 нових повідомлень