Giter Site home page Giter Site logo

Improve error message for distribution with no buckets [was: Stackdriver export is failing] about opencensus-go-exporter-stackdriver HOT 14 CLOSED

census-ecosystem avatar census-ecosystem commented on August 19, 2024
Improve error message for distribution with no buckets [was: Stackdriver export is failing]

from opencensus-go-exporter-stackdriver.

Comments (14)

jeanbza avatar jeanbza commented on August 19, 2024

Totally possible I'm trying to record time the wrong way. Is that the case? (related: census-instrumentation/opencensus-specs#44)

from opencensus-go-exporter-stackdriver.

odeke-em avatar odeke-em commented on August 19, 2024

/cc @Ramonza @rakyll

from opencensus-go-exporter-stackdriver.

odeke-em avatar odeke-em commented on August 19, 2024

@jadekler please firstly change this line https://gist.github.com/jadekler/5636acc62eb0048cad15206ef5587650#file-dupe_oc-go-L61
to

view.SetReportingPeriod(62 * time.Second)

to firstly rule out any hasty time series recordings as per #36 and census-instrumentation/opencensus-go#909

from opencensus-go-exporter-stackdriver.

semistrict avatar semistrict commented on August 19, 2024

@jadekler the problem is likely that you have no buckets in the distribution specified in the view.

from opencensus-go-exporter-stackdriver.

jeanbza avatar jeanbza commented on August 19, 2024

@Ramonza What is a bucket? How do I get a bucket? Perhaps there's documentation that I'm lacking - if so, please feel free to link and close.

from opencensus-go-exporter-stackdriver.

songy23 avatar songy23 commented on August 19, 2024

@jadekler The documentation is here: https://godoc.org/go.opencensus.io/stats/view#Distribution. The problem is although OpenCensus allows Distribution with no bucket bounds, Stackdriver doesn't support it.

Can you try modifying your view to something like:

func distView(m *stats.Int64Measure) *view.View {
	return &view.View{
		Name:        m.Name(),
		Description: m.Description(),
		TagKeys:     []tag.Key{subscriptionKey},
		Measure:     m,
		Aggregation: view.Distribution(0), // Should have at least one bucket bound.
	}
}

from opencensus-go-exporter-stackdriver.

jeanbza avatar jeanbza commented on August 19, 2024

@songy23 Thanks for the pointers, I'll try this tomorrow or Monday. re:

The problem is although OpenCensus allows Distribution with no bucket bounds, Stackdriver doesn't support it.

Is it unreasonable to expect the stackdriver exporter to somehow raise an error, or panic, if that's the case?

from opencensus-go-exporter-stackdriver.

jeanbza avatar jeanbza commented on August 19, 2024

Actually, we ended up going with a view with Aggregation: view.Sum(). I'll leave this open while we discuss the remaining question I had above.

from opencensus-go-exporter-stackdriver.

semistrict avatar semistrict commented on August 19, 2024

@jadekler to be fair, it did log an error, although I think we could certainly improve the error message by doing some basic validation client-side.

from opencensus-go-exporter-stackdriver.

jeanbza avatar jeanbza commented on August 19, 2024

@Ramonza Actually, that's my fmt.Println heh. Is there a way to make opencensus verbosely log?

from opencensus-go-exporter-stackdriver.

semistrict avatar semistrict commented on August 19, 2024

The default if no OnError is provided should be to log the error, is this not happening? If not, could you send a PR with your changes to add the logging?

from opencensus-go-exporter-stackdriver.

jeanbza avatar jeanbza commented on August 19, 2024

Ah, I was unaware of OnError. I'll leave y'all to decide if you want this issue as a placeholder for better docs, or if you'd like to just close it that's solid for me too.

from opencensus-go-exporter-stackdriver.

semistrict avatar semistrict commented on August 19, 2024

I think this could be handled by the same mechanism contemplated here: #19

from opencensus-go-exporter-stackdriver.

jeanbza avatar jeanbza commented on August 19, 2024

SGTM

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.