New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eventtime vs. Processtime #205

Closed
ChristianKniep opened this Issue Mar 11, 2016 · 1 comment

Comments

Projects
None yet
1 participant
@ChristianKniep
Contributor

ChristianKniep commented Mar 11, 2016

Hey y'all,

I came across that the GraphiteHandler uses his process time (https://github.com/Yelp/fullerite/blob/master/src/fullerite/handler/graphite.go#L88).

datapoint = fmt.Sprintf("%s %f %d\n", datapoint, incomingMetric.Value, time.Now().Unix())

If the sampled metrics are not processed immediately the timestamp send to the backend will be incorrect. Moreso in backends which support fine grained resolution (influxdb supports microseconds).

To tackle this I added a field MetricTime to the metric.Metric struct

type Metric struct {
    Name       string            `json:"name"`
    MetricType string            `json:"type"`
    Value      float64           `json:"value"`
    Dimensions map[string]string `json:"dimensions"`
    MetricTime time.Time         `json:"time"`
}

And let the graphite handler use this timestamp.

datapoint = fmt.Sprintf("%s %f %s\n", datapoint, incomingMetric.Value, incomingMetric.MetricTime)
@ChristianKniep

This comment has been minimized.

Show comment
Hide comment
@ChristianKniep

ChristianKniep May 14, 2016

Contributor

I will explore this issue by messaging it into a fork of fullerite.
https://github.com/qnib/QNIBCollect/blob/master/README.md

Contributor

ChristianKniep commented May 14, 2016

I will explore this issue by messaging it into a fork of fullerite.
https://github.com/qnib/QNIBCollect/blob/master/README.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment