question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow pipelines log lines to include structured data

See original GitHub issue

Use Case

It’s possible this is a bug and not a feature request. I’ve read a bunch of the Dagster code and read through the documentation and examples but am not finding an answer one way or another on whether or not this is possible today.

In the Dagit pipeline execution UI there is a panel for logging. Some rows in that panel are EVENT types. These sometimes seem to have a really nice sub-table of key/value pairs (so called “structured fields”). Here’s an example of one: Screen Shot 2021-04-22 at 7 44 19 PM

What I’m looking for is a way to get this same UI but for log lines produced by my own code in my pipeline/solid/etc. For example, I want to have a log line like this:

context.log.info("Did some really important task", task_name="foo", bar="baz")

And have a log line show up in the Dagit log panel that has a table with the task_name and bar keys and their values.

I see that in Dagit’s logger manager code there is some plumbing to pass through **kwargs quite deep but I haven’t read enough to really understand if I should expect the kwargs to make it out to a logger implementation and eventually show up in the Dagit UI.

Ideas of Implementation

Not sure yet, mostly this is more of a question issue to help understand if this is a feature that exists and what I might be doing wrong!


Message from the maintainers:

Excited about this feature? Give it a 👍. We factor engagement into prioritization.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:5
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lamiellecommented, Apr 23, 2021

If what I’m looking for IS possible, I guess this Issue can be turned into a documentation improvement request to help explain how such a behavior can be configured!

0reactions
lamiellecommented, Apr 23, 2021

Thanks @catherinewu, @yuhan, and @schrockn. I’ll review the Asset Materialization and Output functionality in more detail, but on first glance I agree with @schrockn: really what I’m looking for is just some structure logging with structured output (that appears generally possible already in the UI log stream for EVENT entries).

One more note related to this: neither dagster.loggers.json_console_logger nor dagster.loggers.colored_console_logger seem to do anything when I pass values through kwargs of a logging call. I just see the message string and nothing else. Is this expected? Is it up to the logger implementation itself to do something with those values?

Maybe the approach here is to implement a customer logger that does… <something> with those kwargs values to expose them in the log stream UI? I’m not sure what <something> needs to be though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pipelines - Datadog Docs
With pipelines, logs are parsed and enriched by chaining them sequentially through processors. This extracts meaningful information or attributes from semi- ...
Read more >
Structured logging - Google Cloud
This document discusses the concept of structured logging and the methods for adding structure to log entry payload fields. When the log payload...
Read more >
Loki's Path to GA: Adding Structure to Unstructured Logs
There are currently two stages for extracting information from the logs with JSON and regex, both of which take the extracted data and...
Read more >
Customize pipeline configuration - GitLab Docs
Change which users can view your pipelines · For Public projects, job logs, job artifacts, the pipeline security dashboard, and the CI/CD menu...
Read more >
Empower your CI/CD Delivery Pipeline with Logs & Best ...
Add Life to Log Data With JSON ... Logging in an unstructured format dramatically increases the complexity of detecting patterns in your logs....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found