IAgent

public interface IAgent
Provides access to Agent artifacts and methods, such as the currently executing transaction.

Requirements

Agent version 8.9 or higher.

Compatible with all app types.

Description

Provides access to agent artifacts and methods, such as the currently executing transaction. To obtain a reference to IAgent, use getAgent.

Properties

Name Description
CurrentTransaction Property providing access to the currently executing transaction via the ITransaction interface. Must be called inside a transaction.

Example(s)

IAgent agent = NewRelic.Api.Agent.NewRelic.GetAgent();
ITransaction transaction = agent.CurrentTransaction;

For more help

Recommendations for learning more: