Your data. Anywhere you go.

New Relic for iOS or Android

Download on the App Store    Android App on Google play

New Relic Insights App for iOS

Download on the App Store

Learn more

Close icon

Custom Parameter too Messy for handle and maintain



Hi Team, i am exploring new relic with custom attributes, when i used i found too messy to use them.
i have to add below parameter in each function which we have to record parameters.

“NewRelic.Api.Agent.NewRelic.SetTransactionName(“LoginTransaction”, “Login”);”
" NewRelic.Api.Agent.NewRelic.AddCustomParameter(“Login Username is {0}”, username);"

These make too messy to handle and maintain.
There is easy solution for this approach

Any help will be useful.
Thanks in advance.


Hi @gibsmca18 - As these are calls you are making from your own code, you can create a method which would allow you to set a transaction name and parameter.


Hi @gibsmca18,

To add to @stefan_garnham’s info - there isn’t a way to “configure” the collection of an attribute like “username” unless it happens to occur in a query parameter or in a WCF service request parameter. In those cases enabling the collection of request.parameters.* should do the trick.

Otherwise, as @stefan_garnham suggests you’ll have to come up with the most maintainable code level collection of parameters as possible.


Hi @Tjd, sounds good around request.parameters, can you brief this how can i achieve this, as these parameters are query parameters and i want some of these query parameters make attribute through which i can describe actions more clearly.


@stefan_garnham is this possible to do this functionality, in attribute, means i just annotate the function’s and then it will be handle by those filter(s)


@Tjd provided a link on how to allow the enabling of request.paramers in his post @gibsmca18.


@Tjd can you help me with an example, how to use request.parameters, no such documentation found, is this attribute tag configure in new relic agent or in my web.config.

It will be helpful if you provide me sample code.


Have you read the documentation for your agent?


@stefan_garnham, yes i read this but not such clear about.


@RyanVeitch - I think that some assistance from support would be beneficial here.


Thanks for the @ mention @stefan_garnham - I’ll pass this on to our .Net Experts.


@gibsmca18 -

You can try adding the following to your newrelic.config file:

<attributes enabled="true"> 

That should be a direct child of the <configuration> element. An app restart is needed for that config change to take effect.

The wildcard * will cause the collection of all parameters. If you want to be more specific you can change that to:

<attributes enabled="true"> 

or whatever the actual query parameter name is. Keep in mind this configuration only collects parameters passed in the url after ?, e.g. If the parameters are sent in the body of the request then this configuration won’t work (although WCF service request parameters should be collected as well).

Does that help?