Giter Site home page Giter Site logo

Comments (6)

zargarpur avatar zargarpur commented on July 19, 2024

/assign @nilebox

from opencensus-go-exporter-stackdriver.

nilebox avatar nilebox commented on July 19, 2024

Looks like start and end times are the same, and Stackdriver rejects such counter?

AFAICT the start and end times are coming from the view.Data structure:

Points: []*monitoringpb.Point{newPoint(vd.View, row, vd.Start, vd.End)},

They are set in https://github.com/census-instrumentation/opencensus-go/blob/1901b56b9515b0c34f5d25a5bce982dfc543d64b/stats/view/worker.go#L352-L353

And there is a condition under which both Start and End will be set to "now":
https://github.com/census-instrumentation/opencensus-go/blob/1901b56b9515b0c34f5d25a5bce982dfc543d64b/stats/view/worker.go#L346-L349

This is likely what is causing the problem for you.

Potential ways to fix the issue:

  • In opencensus-go: prevent setting both start and end times to "now" for non-gauges
  • In opencensus-go-exporter-stackdriver: Implement some hack to add a nanosecond to make start and end times different - this may break the accuracy though
  • In opencensus-go-exporter-stackdriver: Drop views which have equal start and end times - this leads to data loss

Not sure if there is a good way to fix that.

/cc @james-bebbington @rghetia

from opencensus-go-exporter-stackdriver.

ian-mi avatar ian-mi commented on July 19, 2024

In opencensus-go, could start be set either during view registration or initial record?

from opencensus-go-exporter-stackdriver.

nilebox avatar nilebox commented on July 19, 2024

Currently, the startTimes map is initialized as empty and the initial startTime is set on the first export in https://github.com/census-instrumentation/opencensus-go/blob/1901b56b9515b0c34f5d25a5bce982dfc543d64b/stats/view/worker.go#L346-L349

We should be able to init start time when handling view registration in https://github.com/census-instrumentation/opencensus-go/blob/785d8992f1ac50097e9140accb05630e0eadfb5e/stats/view/worker.go#L295

from opencensus-go-exporter-stackdriver.

nilebox avatar nilebox commented on July 19, 2024

@zargarpur @ian-mi Feel free to send a PR with a fix to https://github.com/census-instrumentation/opencensus-go/ as described in #266 (comment), or I will get back to it myself within a few days.

from opencensus-go-exporter-stackdriver.

nilebox avatar nilebox commented on July 19, 2024

Released opencensus-go v0.22.4 with the bugfix.

from opencensus-go-exporter-stackdriver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.