newrelic-dotnet-agent icon indicating copy to clipboard operation
newrelic-dotnet-agent copied to clipboard

Add support for HangFire Jobs

Open TraGicCode opened this issue 1 year ago • 2 comments

Is your feature request related to a problem? Please describe.

It would be great if the newrelic agent had logic to automatically instrument hangfire jobs just like it does for NServiceBus. This would prevent having to always try and remember to add the Transaction Attribute along with setting the name of the transaction.

For Example, before my jobs execute, I have the following code.

       [Transaction(Web = false)] // 1. Create transaction
        public async Task MyHangfireJob()
        {
            NewRelic.Api.Agent.NewRelic.SetTransactionName("Hangfire", $"MyHangfireJob"); // 2. Change Transaction Name
            ...
        }

TraGicCode avatar May 22 '24 18:05 TraGicCode

https://new-relic.atlassian.net/browse/NR-272629

Thank your for this request. I passed on this information to our Product Manager, so that it can be reviewed and considered.

nrcventura avatar May 22 '24 21:05 nrcventura