Skip to content
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

Make sure Cloudwatch-metrics only send the *new* counter values. #591

Merged
merged 4 commits into from
Aug 7, 2017

Conversation

feliksik
Copy link
Contributor

@feliksik feliksik commented Jul 31, 2017

Testcase and fix for issue #590 .

The commits are separated and documented.

I only implemented the failing test in cloudwatch_test.go, instead of in teststat.TestCounter(), as it's not entirely clear to me if we can generalize the expected behavior for all methods. In particular, as the Send() method for e.g. Cloudwatch/Influx/Statsdogd is not implementing a generic interface, the semantics for each such method, and whether it should reset counters, may be defined differently (see #578 for an example of funkyness).

todos:

[ ] determine if this is actually a bug (I believe so)
[ ] determine whether the failing test case should be defined in the cloudwatch_test.go or in the teststat.TestCounter() method.
[ ] fix the functionality in cloudwatch.go and other affected pieces.

@feliksik feliksik force-pushed the bug/cloudwatch-reset-counter branch 3 times, most recently from 847ba2b to 9aa8e8e Compare August 1, 2017 08:57
… does.

Note there is a breaking API change, as the cloudwatch object now has optional parameters.
@feliksik feliksik force-pushed the bug/cloudwatch-reset-counter branch from 9aa8e8e to 1f238bf Compare August 1, 2017 09:12
logger log.Logger
numConcurrentRequests int
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this a separate struct embedded into the type? I'd prefer to see these things flattened into the parent.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that; I will change it accordingly.

}
o.percentiles = validated
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No other metrics package has user-modifiable percentiles. Why is it important here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rationale is that in the way it's used here, you have an extra metric for each percentile. That costs $50 cents/month. If you want only the 50th and 95th percentile, you'd pay twice as much when the 90th and 99th are logged, too.

For many metrics, this makes a difference. I hope that fact that it's configurable, makes this unobtrusive?

@feliksik
Copy link
Contributor Author

feliksik commented Aug 3, 2017

@cam-stitt do you have any comments on this PR?
Would you care if the postfix for the percentiles are renamed from "50" to "p50" (I think it's customary to use a p for percentile values, but if anybody objects, I won't care that much).

@cam-stitt
Copy link
Contributor

I'm not sure what other metric packages in go-kit use the "p" approach, but if @peterbourgon is okay with it, it doesn't bother me. It would probably cause anyone that has been using this package to adjust their dashboards/alerts accordingly though.

@feliksik
Copy link
Contributor Author

feliksik commented Aug 7, 2017

Graphite seems to use a p prefix; influx to, but created a separate tag, without the metric name.

The others I don't understand the semantics of the prepared messages :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants