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

Improve Kafka instrumentation interaction with custom instrumentation

Open nrcventura opened this issue 1 year ago • 1 comments

The .net agent did not always support automatic instrumentation of Kafka. Many people previously relied on custom instrumentation of services to provide visibility into their kafka consumers. After adding support for kafka instrumentation, there have been scenarios where the kafka instrumentation can end the transaction before the custom instrumentation expected the transaction to end.

This happens because the Kafka instrumentation expected to create the transaction, and when it's call is done, it will end the transaction.

There are two possible ways to handle this problem.

  1. The agent instrumentation can check to see if a transaction already exists and only end the transaction if one didn't previously exist.
  2. Try to leverage the unit of work parameter in the CreateTransaction method (this might need to be tied to a transaction existence check though).

Acceptance Criteria

  • Custom transactions created before our kafka consumption instrumented method runs do not end until the custom instrumentation says it should.

Dependencies

None

Estimates

Initial t-shirt size: M

nrcventura avatar Oct 10 '24 23:10 nrcventura

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