• EnglishEspañol日本語한국어Português
  • Log inStart now

get_linking_metadata (Python agent API)

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 json
import newrelic.agent
log_message = {"message": "Hello World"}
context = newrelic.agent.get_linking_metadata()
log_message.update(context)
print(json.dumps(log_message))
Copyright © 2024 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.