Agent APIs Troubleshooting Framework Logs in Context

Agent APIs

General

  • If you aren’t able to use any of our existing Logs in Context solutions for your environment our APM agents have built in API calls to add the metadata to your logs
  • Check that the API call you are using is adding the following metadata:
    • “entity.name”
      • Should be the application name set in APM for the service you’ve configured Logs in Context for.
    • “entity.type”
      • Should be the string “SERVICE”
    • “entity.guid”
      • The ID of the entity.
    • “trace.id"
      • Will only be present if distributed tracing is enabled and a corresponding transaction generates a log.
    • "span.id”
      • Will only be present if distributed tracing is enabled and a corresponding span generates a log.
    • “hostname”
      • This should be the hostname gathered by the APM agent.

Troubleshooting

  • Make sure your APM language agent is installed and set up correctly.

  • Make sure that you have Distributed Tracing configured correctly for your application. If you do not you will not see a span.id and trace.id in your log metadata.

  • If you aren’t seeing logs in the Logs UI. Ensure that you have installed and configured a New Relic plugin for a compatible log forwarder:

  • Check your Logs UI in New Relic and query using the the following:

    • has: span.id has:trace.id