-
Notifications
You must be signed in to change notification settings - Fork 221
add invocation ids for plain text logs #1906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have a screenshot of what the logs before/after look like?
Sure, here's an example snippet of a Lambda invocation: You can see some Magnum logs when the invocation starts. The rest of the observability stack is quite simple honestly. We send logs to Loki's OTLP endpoint, and browse them through Grafana. We have a few other changes in our internal fork that we'd like to contribute back over time. For example in the screenshot you can see the Let me know if you have any questions. Great project btw |
if el.Type == string(telemetryapi.PlatformStart) { | ||
if record, ok := el.Record.(map[string]interface{}); ok { | ||
if requestId, ok := record["requestId"].(string); ok { | ||
r.currentFaasInvocationID = requestId |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not as familiar with this code, but any reason you are not logging the request ID after this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no special reason. I can add a debug level log to this, if it's helpful
In case the Lambda logs are of plain text format, they are not enriched with the
requestId
information (link to API reference).I am well aware that logging in json format is preferred, but I think manually enriching the logs with this attribute can be beneficial in at least two cases:
Tested internally on some of our Lambdas