Skip to content

Print graphql queries to logs #3561

Closed
Closed

Description

@shykes

Problem

When writing pipelines using the Go SDK, it's not always clear exactly what the resulting graphql query (or queries) will look like. This is especially needed when debugging, and learning Dagger.

Solution

Change the engine logger so that it prints raw graphql queries, rather than only buildkit-specific information.

Activity

  1. added this to the 0.3.0 milestone on Oct 26, 2022
  2. shykes commented on Oct 27, 2022

    @shykes
    ContributorAuthor

    Would this qualify as size/small @vito @sipsma ?

  3. sipsma commented on Oct 27, 2022

    @sipsma
    Contributor

    Would this qualify as size/small

    We'd have to hook into the buildkit progress logs. There's a chance that's easy for someone familiar with those, but even then it may be easier said than done. If someone's not familiar with buildkit progress logs, then no, not small probably.

    Or other option is to abstract on top of buildkit progress logs and use our own logging system (similar to Europa). Good thing to do, not small.

    tl;dr no, I don't think so. Happy to be wrong though

  4. shykes commented on Oct 27, 2022

    @shykes
    ContributorAuthor

    What if you had to choose between two completely different log streams: 1) buildkit or 2) graphql, and we made no attempt to integrate the two. You just get one bytestream or the other. Would that make it simpler?

    For example in my case I would gladly turn off buildkit logs in exchange for a clean log of graphql queries as they are being routed - more relevant to my debugging.

  5. sipsma commented on Oct 27, 2022

    @sipsma
    Contributor

    What if you had to choose between two completely different log streams: 1) buildkit or 2) graphql, and we made no attempt to integrate the two. You just get one bytestream or the other. Would that make it simpler?

    I think so. It would solve the problem of the logs otherwise being interleaved (on char-by-char basis). You could add an optional to dagger.Connect, which would then enable printing from codegen client.

    So yeah pretty small then.

    Only con left I can think of is backcompat in future if we change logging more, but I am inclined to not care, too minor relative to benefit.

  6. modified the milestones: 0.3.0, on Oct 28, 2022
  7. removed this from the milestone on Nov 22, 2022
  8. added
    area/engine
    and removed on Dec 5, 2022
  9. shykes commented on Mar 26, 2024

    @shykes
    ContributorAuthor

    This is addressed by new TUI. Yay!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/engine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions