Skip to content
This repository has been archived by the owner on Sep 1, 2020. It is now read-only.

Do not explicitly record metrics - trace_execution_scoped will automatically do it #25

Conversation

benweint
Copy link
Contributor

Howdy! First off, thanks for this gem - it's great to see community-supported extensions to newrelic_rpm like this. I work at New Relic and have referred a number of folks looking for Moped instrumentation here. I noticed a bug in the latest version, however that's leading to double-counting of some metrics. Details below from the commit message:

The previous code was double-counting metrics for all queries through Moped,
because of the fact that trace_execution_scoped will automatically record
metrics. The net effect was that the database band on the overview graph in New
Relic was twice as large as it should have been (because the 'ActiveRecord/all'
metric was being recorded twice).

This change removes the additional explicit call to record_metrics (which is not
a public API and may change unpredicatbly) so that metrics are no longer double-counted.

… do it

The previous code was double-counting metrics for all queries through Moped,
because of the fact that trace_execution_scoped will automatically record
metrics. The net effect was that the database band on the overview graph in New
Relic was twice as large as it should have been (because the 'ActiveRecord/all'
metric was being recorded twice).

This change removes the additional explicit call to record_metrics (which is not
a public API anyhow) so that metrics are no longer double-counted.
@msaffitz
Copy link

👍 Thanks to @benweint and the great folks at New Relic for helping us with this issue. (And to @stevebartholomew for the awesome gem!)

@stevebartholomew
Copy link
Owner

@benweint awesome - great spot and thanks for sorting!

@msaffitz thanks man :)

stevebartholomew added a commit that referenced this pull request Mar 1, 2014
Do not explicitly record metrics - trace_execution_scoped will automatically do it
@stevebartholomew stevebartholomew merged commit c060b12 into stevebartholomew:master Mar 1, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants