Syntax
get_linking_metadata()
Returns a dictionary of contextual data for use in log messages.
Requirements
Python agent version 5.4.0 or higher
Description
A dictionary of key/value pairs providing contextual information. This API can be used to add agent metadata for manual logging.
Return values
Returns a dictionary.
Examples
import jsonimport newrelic.agentlog_message = {"message": "Hello World"}context = newrelic.agent.get_linking_metadata()log_message.update(context)print(json.dumps(log_message))
For more help
If you need more help, check out these support and learning resources:
- Browse the Explorers Hub to get help from the community and join in discussions.
- Find answers on our sites and learn how to use our support portal.
- Run New Relic Diagnostics, our troubleshooting tool for Linux, Windows, and macOS.
- Review New Relic's and and documentation.