New Relic not logging custom parameters on transactions

311 views Asked by At

I have a ASP.NET app that I'm trying to log custom parameters from to NewRelic. The code for logging looks like this:

this.searchResults = performanceMonitor.RecordQuery(() => searchManager.DoQuery(this.searchRequest));

The performanceMonitor is just an object that does this:

public TSearchResult RecordQuery<TSearchResult>(Func<TSearchResult> query) where TSearchResult : SearchResult
{
    var stopwatch = Stopwatch.StartNew();
    var result = query();
    stopwatch.Stop();

    var externalTime = stopwatch.ElapsedMilliseconds;
    var internalTime = ToMilliseconds(result.ExecutionTicks);

    NewRelicHelper.AddAttributeToTransaction("QueryExternalTime", externalTime);
    NewRelicHelper.AddAttributeToTransaction("QueryInternalTime", internalTime);

    return result;
}

All the line with NewRelicHelper does is call NewRelic.Api.Agent.NewRelic.AddCustomParameter with "QueryExternalTime" and externalTime.

Yet after executing this code on machines with NewRelic agents, when I run a NewRelic query, I cannot see either QueryExternalTime or QueryInternalTime with their respective values on any transactions.

0

There are 0 answers