Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@eric
Copy link
Owner

@eric eric commented Apr 17, 2013

This is a basic attempt at figuring out what it would look like to give some
intermediate mechanisms to make reporters simpler.

This is a basic attempt at figuring out what it would look like to give some
intermediate mechanisms to make reporters simpler.
@eric
Copy link
Owner Author

eric commented Apr 17, 2013

CC: @bernd, @lmarburger

@eric
Copy link
Owner Author

eric commented Apr 17, 2013

One thing that I've realized is that the CounterDerivative and FlatteningRegistryEnumerator classes could practically be combined into a single class with a conditional in the initializer.

Copy link
Owner Author

Choose a reason for hiding this comment

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

If we only report like this, it means we won't actually report the marks that happened before the reporter was run for the first time.

Because we know these things are in-process, I think it would actually make more sense to initialize @last with a default of 0 for the hash values:

  @last = Hash.new do |h,k|
    h[k] = 0
  end

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed.

@eric
Copy link
Owner Author

eric commented Apr 17, 2013

This is a completely different attempt to solve the same problems that were raised by #21 and #35.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I'm wondering if it ever makes sense to actually send count... in the cases that I can think of, I don't believe it does.

@eric
Copy link
Owner Author

eric commented Apr 17, 2013

I've just made a couple other changes to possibly make FlatteningRegistryEnumerator do everything.

Copy link
Contributor

Choose a reason for hiding this comment

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

This should be :counter_derivative.

Copy link
Contributor

Choose a reason for hiding this comment

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

The #median method only exists on the snapshot object. This doesn't work. (and #median is already called on the snapshot below)

Same for Timer and Histogram.

Copy link
Owner Author

Choose a reason for hiding this comment

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

Good catch.

@eric
Copy link
Owner Author

eric commented Jul 2, 2013

I'm convinced now that CounterDerivative should be removed and that FlatteningRegistryEnumerator should have an option to specify if it reports derivative counts or rates.

@eric
Copy link
Owner Author

eric commented Jul 4, 2013

Okay. I've made some improvements that feel good to me.

I have some outstanding issues:

1. Filtering

It seems clear we should implement some sort of filtering — it seems that it should be done in a standard way for all reporters.

2. Metric name changes

I've made some changes to some of the metrics that were returned.

For instance, before, a gauge called "special.gauge", would be reporting a value as "special.gauge.value". With this change, it now just calls it "special.gauge".

The rational was that there was no real benefit of having something appended to the metric name when there is only one value that would be returned.

Is this change going to mess people up and bother them? Should I make this optional?

3. Change from sending rates

I've changed the default that is reported to report the number of pieces of work that have been completed in the reporting interval instead of the exponentially weighted rate per second.

It does this by recording the last count and submitting the difference instead of sending the one_minute_rate.

Does it make sense to change the default here?

@myronmarston
Copy link
Contributor

I pointed our Gemfile to this branch to try this out over the weekend, and deployed it friday evening. Unfortunately, we got no data in librato at all over the weekend. I changed back to the latest metriks gem release (0.9.9.5) and now data is showing up again. So...there's something in here that completely stopped librato from receiving data from us. Not sure what yet. Digging into it now. @eric, if you have any ideas or if this is a known issue, please let me know!

@myronmarston
Copy link
Contributor

I talked with the librato guys in their campfire room, and they found this in their logs:

Response: [{"errors":{"params":{"name":["[\"qless:job-times:Packrat::BackendAdapters::Silo::EventFeedProcessor::Job.999th_percentile\", 0.694730768, Metriks::Timer] is not a valid metric name"]}}}]

Looks like the data is being submitted with name as the JSON dump of an array rather than the actual name. I'll look into this a bit more.

@eric
Copy link
Owner Author

eric commented Jul 15, 2013

I'll look into this shortly. Sorry about that.

@eric
Copy link
Owner Author

eric commented Jul 15, 2013

Okay. I've fixed the problem and added a test to make sure I don't make the mistake again.

Thanks!

@myronmarston
Copy link
Contributor

👍

Thanks, I'll give it another go.

Andrew and others added 2 commits October 4, 2013 18:08
@lmarburger
Copy link
Contributor

I noticed Librato supports count, sum, min, max, and sum_squares on a gauge. Do we want to take advantage of those as part of this PR?

@eric
Copy link
Owner Author

eric commented Nov 1, 2013

For which metric types?

@lmarburger
Copy link
Contributor

I suppose we'd have to switch to reporting count, min, max, etc. for a given duration instead of for the lifetime of the process.

@roidrage
Copy link
Contributor

Hey, can I help test this out?

I remember we also talked about adding this as a second Librato reporter to at least keep the old behaviour around.

What do you think?

@eric
Copy link
Owner Author

eric commented Mar 28, 2014

There are a couple things that are missing from the librato reporter that I would like to get fixed:

  • Send extra metadata the first time we send a metric that defines that:
    • it is a server-side aggregated metric
    • the period
    • the minimum

Then the only thing to figure out is a migration strategy for people (if that is needed). The metric names will be changing for people as it is now, which isn't great, but there are a couple issues if they don't change:

  1. Librato doesn't provide a way to easily update things like the "server side aggregation" bit on existing metrics when you send new datapoints
  2. The units of the metrics will be different (from rates per second to total work done in a period)

To test this, one simple approach would be to point your Gemfile at this branch and run it.

@roidrage
Copy link
Contributor

I can look into adding these things, I'm keen to try it out.

@eric
Copy link
Owner Author

eric commented Mar 28, 2014

My idea was to hold onto a hash of metrics we've sent before, and if the hash doesn't contain a key, send additional :attributes containing those things.

That way it won't send larger payloads more often than it may need to.

…ntation

Conflicts:
	lib/metriks/reporter/librato_metrics.rb
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.

6 participants