lib/new_relic/agent/instrumentation/mongo.rb in newrelic_rpm-3.7.1.180 vs lib/new_relic/agent/instrumentation/mongo.rb in newrelic_rpm-3.7.1.182

- old
+ new

@@ -115,15 +115,17 @@ transaction_state = NewRelic::Agent::TransactionState.get transaction_state.push_traced(false) begin - result = save_without_new_relic_trace(spec, opts, &block) + result = ensure_index_without_new_relic_trace(spec, opts, &block) ensure transaction_state.pop_traced end + spec = spec.is_a?(Array) ? Hash[spec] : spec.dup spec[:operation] = :ensureIndex + statement = NewRelic::Agent::Datastores::Mongo::StatementFormatter.format(spec) if statement NewRelic::Agent.instance.transaction_sampler.notice_nosql_statement(statement, (Time.now - t0).to_f) end