Once you install AI monitoring, you can configure the default behavior of the agent or update your app to collect different kinds of data.
Configure the agent
Update default agent behavior for AI monitoring at these agent configuration docs:
Token count method
If you haven't disabled ai_monitoring.record_content.enabled
, you don't need to implement the token count callback API.
Disabling ai_monitoring.record_content.enabled
stops the agent from sending AI content to New Relic, but it also prevents the agent from forwarding token counts for interactions with your app. You can implement a callback in your app code to determine the token counts locally, then have that information forwarded to New Relic.
Refer to the docs below for examples to set up counting tokens locally:
User feedback methods
If end users can leave feedback on an AI response, you can forward this data into the AI monitoring response table. To do this, you'll update your app code to correlate trace IDs from AI event data using callback methods.
There are two methods you need to implement to forward this kind of information: