New Relic Node.js agent code base. Developers are welcome to create pull requests here, please see our contributing guidelines. For New Relic technical support, please go to http://support.newrelic.com.
If application_logging.forwarding.labels.enabled is set to true, all labels MUST be attached in common attributes unless there is matching entry in application_logging.forwarding.labels.exclude.
The attribute key MUST be the prefix tags. followed by the label name.
Except for tags., the attribute MUST match the case of the original label. Example, MYLABEL;Value1 becomes "tags.MYLABEL": "Value1".
Add supportability metric for labels - Supportability/Logging/Labels/{language}/{enabled\|disabled}. MUST be generated by agents when labels on application logging is enabled. disabledSHOULD be generated if possible, although some agents' implementation may preclude it. It is expected to be sent once per agent connect (not per harvest).|
Example newrelic.config bit from .NET showing labels with no exclude configuration:
Description
We need to support adding labels (tags) to logs.
TLDR:
Dependent on this issue that adds configurations to the agents to enable this feature: https://github.com/newrelic/node-newrelic/issues/2713
Implementation details:
application_logging.forwarding.labels.enabled
is set totrue
, all labels MUST be attached incommon
attributes unless there is matching entry inapplication_logging.forwarding.labels.exclude
.tags.
followed by thelabel name
.tags.
, the attribute MUST match the case of the original label. Example,MYLABEL;Value1
becomes"tags.MYLABEL": "Value1"
.Supportability/Logging/Labels/{language}/{enabled\|disabled}
. MUST be generated by agents when labels on application logging is enabled.disabled
SHOULD be generated if possible, although some agents' implementation may preclude it. It is expected to be sent once per agent connect (not per harvest).|Example newrelic.config bit from .NET showing labels with no exclude configuration:
Example
log_event_data
payload based on above newrelic.config:Same example above, but with the following exclude configuration (.NET agent XML):
Example
log_event_data
payload based on above newrelic.config - no longer has LABEL2, but still has LABEL2-ALSO:Link to labels spec.
Discovery doc about labels.