-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
POC / WIP testing out using logfmt for more structured logging #27787
Conversation
cae19f5
to
58af460
Compare
I suppose another thing we could consider is, keep the existing format for the first part of the line but then just always make the rest structured. i.e. keep prefix |
I think w do not have anything else to do but simply implement Open Telemetry. It's already been discussed, and approved. We just need to implement it https://cwiki.apache.org/confluence/display/AIRFLOW/AIP-49+OpenTelemetry+Support+for+Apache+Airflow In the form defined and researched by @howardyoo - this is the best way we can implement "smarts" in the telemetry of Airflow. |
I looked at the AIP, but it looks like logging was deliberately excluded from it:
|
Rather deferred until it's ready. The AIP was approved few months ago and it will take likely few months before someone starts working on it. In the meantime OpenTelemetry's logging has evolved. I guess you should see what's the status of logging there. The direction is clear. |
Right, the logging is currently experimental. That's why it was excluded
for now.
…On Mon, Nov 28, 2022 at 3:32 PM Jarek Potiuk ***@***.***> wrote:
I looked at the AIP, but it looks like logging was deliberately excluded
from it:
Rather deferred until it's ready. The AIP was approved few months ago and
it will take likely few months before someone starts working on it. In the
meantime OpenTelemetry's logging has evolved. I guess you should see what's
the status of logging there. The direction is clear.
—
Reply to this email directly, view it on GitHub
<#27787 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AHZNLLUEBPKTS66VRIGTJODWKUQIRANCNFSM6AAAAAASE7HUIU>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
Just starting the exploration process. I think structured logging could unlock a lot of value. CC @ashb @potiuk @jedcunningham @uranusjr
Here I'm solely changing the formatter class.
It's possible we could use more elaborate solution like https://structlog.org/
There's also the question of whether to use logfmt key-value style or json.
Sample after checking out this PR.
I explored a few different things...
First, this is what happens to task logs when we just enable the logfmt formatter and don't otherwise change the code:
But we can improve this a little bit by changing the log calls to be a little more structured. See commit #2 to see what changed. Here's the resulting output.
Notice that things like try_number and return_code and such are represented as key-value pairs instead of english. I think this is as-or-more readable.
Note also that we can split things out like "event" which could be short description of what happened, then additional details are presented in key-values.