Skip to content
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

Dashboard page only shows 100 DAGs #721

Closed
jonathonc opened this issue Nov 19, 2024 · 2 comments
Closed

Dashboard page only shows 100 DAGs #721

jonathonc opened this issue Nov 19, 2024 · 2 comments
Labels
Milestone

Comments

@jonathonc
Copy link

The dashboard page only shows 100 DAGs, even if there are more than 100 DAGs in the system

It looks like there is a default limit of 100 here (which is reasonable)

limit := 100

I can see the API has support for increasing the limit api/v1/dags?limit=xxxx

Thoughts on this? I appreciate we may not want to get all the DAGs in case there are a lot in the system.

What is restricted it to only DAGs executed within the day? Or maybe this time period can be controlled?

Happy to help with a PR, but keen to see how you might want to approach a possible solution.

image

@yottahmd
Copy link
Collaborator

Thank you very much for submitting the issue and showing interest in contributing a PR! Your input is really helpful.

Currently, when a large number of DAG files are created, performance issues arise due to the need to load a significant amount of data. To address this, I plan to change the storage structure. With the upcoming release of the v2.0 alpha version, I would like to ensure that all DAG execution data for the current day is reflected on the dashboard.

As a temporary workaround, I think that allowing configuration for the page limit might be an idea. If you're interested in contributing a PR, it would be very welcome.

To add config key in the configuration, the following files would need to be modified:

  • Add a perPage key and DAGU_PER_PAGE environment variable to the config (to change the default upper limit):
    type Config struct {
    Host string // Server host
    Port int // Server port
    DAGs string // Location of DAG files
    Executable string // Executable path
    WorkDir string // Default working directory
    IsBasicAuth bool // Enable basic auth
    BasicAuthUsername string // Basic auth username
    BasicAuthPassword string // Basic auth password
    LogEncodingCharset string // Log encoding charset
    LogDir string // Log directory
    DataDir string // Data directory
    SuspendFlagsDir string // Suspend flags directory
    AdminLogsDir string // Directory for admin logs
    BaseConfig string // Common config file for all DAGs.
    NavbarColor string // Navbar color for the web UI
    NavbarTitle string // Navbar title for the web UI
    Env sync.Map // Store environment variables
    TLS *TLS // TLS configuration
    IsAuthToken bool // Enable auth token for API
    AuthToken string // Auth token for API
    LatestStatusToday bool // Show latest status today or the latest status
    BasePath string // Base path for the server
    APIBaseURL string // Base URL for API
    Debug bool // Enable debug mode (verbose logging)
    LogFormat string // Log format
    TZ string // The server time zone
    Location *time.Location // The server location
    }
  • Add configuration items to the frontend:
    func defaultFunctions(cfg funcsConfig) template.FuncMap {
    return template.FuncMap{
    "defTitle": func(ip any) string {
    v, ok := ip.(string)
    if !ok || (ok && v == "") {
    return ""
    }
    return v
    },
    "version": func() string {
    return constants.Version
    },
    "navbarColor": func() string {
    return cfg.NavbarColor
    },
    "navbarTitle": func() string {
    return cfg.NavbarTitle
    },
    "basePath": func() string {
    return cfg.BasePath
    },
    "apiURL": func() string {
    return path.Join(cfg.BasePath, cfg.APIBaseURL)
    },
    "tz": func() string {
    return cfg.TZ
    },
    }
    }
  • Modify base HTML template
    function getConfig() {
    return {
    apiURL: "{{ apiURL }}",
    basePath: "{{ basePath }}",
    title: "{{ navbarTitle }}",
    navbarColor: "{{ navbarColor }}",
    version: "{{ version }}",
    tz: "{{ tz }}",
    };
    }
  • Related frontend files

I also welcome any alternative ideas for the workaround. :)

@yottahmd
Copy link
Collaborator

Thank you for the contribution. Closing as it's completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants