You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
structlog logging output to the console is correct, however new relic does not receive "message" in records is unable to extract "event" in new_relic_event_consumer structlog processor
Your Environment
newrelic==10.3.1
django-structlog==8.1.0
structlog==24.4.0
Podman, linux container environment.
Additional context
Relates to and describes the issue in NR support ticket #00236985.
The text was updated successfully, but these errors were encountered:
Using structlog's "Rendering Using structlog-based Formatters Within
logging
" steps, new relic is unable to extract"event"
->"message"
Description
Log entries in New Relic are missing the
"message"
valueExpected Behavior
Log entries in New Relic have the
"message"
value populated correctlyTroubleshooting
Diagnosing the issue, I noticed:
new_relic_event_consumer
processor to the structlog processors list, and ensures it is at the tail endwrap__process_event(...)
new_relic_event_consumer
inspects the type of theevent
parameter:message
"event"
value from the dict intomessage
structlog.stdlib.ProcessorFormatter.wrap_for_formatter
wrap_for_formatter
expects to always be the last processor prior to theProcessorFormatter
handling its outputwrap_for_formatter
knows it can safely change the shape of the data it returns to be compatible withProcessorFormatter
tuple
(specifically, the(*args, **kwargs})
thatProcessorFormatter
expects to receivenew_relic_event_consumer
is always at the tail end of the processors list, it ends up:tuple
of(*args, **kwargs})
tuple
(as it should), which successfully gets passed toProcessorFormatter
Steps to Reproduce
logging
" fashiona. for us, we use django-structlog as well, but I don't think this is an influencing factor
does not receiveis unable to extract "event" in"message"
in recordsnew_relic_event_consumer
structlog processorYour Environment
Podman, linux container environment.
Additional context
Relates to and describes the issue in NR support ticket #00236985.
The text was updated successfully, but these errors were encountered: