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

Add concurrency limits observability #3586

Merged
merged 39 commits into from May 15, 2024
Merged

Conversation

wendrul
Copy link
Contributor

@wendrul wendrul commented Apr 22, 2024

  • Add a new table custom_concurrency_key for storing concurrency keys on a
    per job basis. Add the field to the job payload to populate the table on
    creation of a new job.
  • Add a concurrency graph on the frontend to see the amount of concurrent graphs
  • Add a filter on concurrency key
  • Add a button on the flow metadata to show the concurrency key linked to the job if it exists.

image

image


🚀 This description was created by Ellipsis for commit 42aceed

Summary:

This PR adds backend and frontend support for observing and managing job concurrency limits through new data structures, visualizations, and enhanced filtering capabilities.

Key points:

  • Added backend support for concurrency keys in jobs.
  • Introduced a new frontend component ConcurrentJobsChart for visualizing job concurrency.
  • Modified existing components to integrate concurrency key visibility.
  • Added new routes and services for fetching and deleting concurrency data.
  • Enhanced job filtering capabilities in the frontend to include concurrency keys.

Generated with ❤️ by ellipsis.dev


🚀 This description was created by Ellipsis for commit a51a5b0

Summary:

This PR adds comprehensive backend and frontend support for managing job concurrency limits, including new data structures, visualizations, and enhanced filtering capabilities.

Key points:

  • Add a new table custom_concurrency_key for storing concurrency keys on a per job basis. Add the field to the job payload to populate the table on creation of a new job.
  • Add a concurrency graph on the frontend to see the amount of concurrent graphs
  • Add a filter on concurrency key
  • Add a button on the flow metadata to show the concurrency key linked to the job if it exists.
  • Introduced a new frontend component ConcurrentJobsChart for visualizing job concurrency.
  • Modified existing components to integrate concurrency key visibility.
  • Added new routes and services for fetching and deleting concurrency data.
  • Enhanced job filtering capabilities in the frontend to include concurrency keys.
  • New SQL migration scripts for creating and managing custom_concurrency_key.

Generated with ❤️ by ellipsis.dev

Copy link

cloudflare-pages bot commented Apr 22, 2024

Deploying windmill with  Cloudflare Pages  Cloudflare Pages

Latest commit: aeeab53
Status: ✅  Deploy successful!
Preview URL: https://f488e4e9.windmill.pages.dev
Branch Preview URL: https://concurrency-limits-observabi.windmill.pages.dev

View logs

@wendrul wendrul force-pushed the concurrency-limits-observability branch from baed65d to 97eb76b Compare April 22, 2024 15:23
@wendrul wendrul marked this pull request as draft April 23, 2024 13:52
@wendrul wendrul marked this pull request as ready for review April 23, 2024 15:40
@wendrul wendrul marked this pull request as draft April 24, 2024 15:11
@rubenfiszel rubenfiszel force-pushed the main branch 2 times, most recently from 44529f6 to ea4165d Compare May 4, 2024 08:59
@wendrul wendrul force-pushed the concurrency-limits-observability branch from 195380f to c922507 Compare May 6, 2024 13:23
wendrul added 20 commits May 15, 2024 02:55
Add a new table custom_concurrency_key for storing concurrency keys on a
per job basis. Add the field to the job payload to populate the table on
creation of a new job.
Be more explicit about the nature of the option variable by calling it
a more appropriate name.
FlowValue field concurrency_key must be named concurrency_key for
serialization purposes.
Whether it is a Completed job or a queued one, add a ways to get the
associated concurrency key
Add a line with a link on the FlowMetadata that goes to the
concurrency_groups page. add endpoint to get the concurrency_key of a
job
migration + change all related querrys
The limit makes more sense if we cut the older rows, so order by
started_at
Factor the arg interpolation logic into a function and finish the
processing of concurrency key before insertion
@wendrul wendrul force-pushed the concurrency-limits-observability branch from 7bc2932 to 42aceed Compare May 15, 2024 06:31
@wendrul wendrul changed the title Add custom concurrency key to job payload Add concurrency limits observability May 15, 2024
@wendrul wendrul marked this pull request as ready for review May 15, 2024 07:06
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Reviewed everything up to 42aceed in 3 minutes and 30 seconds

More details
  • Looked at 4104 lines of code in 52 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_taqIAaZRFKukeEdF


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

1 day left in your free trial, upgrade for $20/seat/month or contact us.

class="!h-[32px] py-1 !text-xs !w-64"
bind:value={displayedConcurrencyKey}
on:keydown={(e) => {
if (concurrencyKeyTimeout) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider handling input changes more reactively without using a timeout to avoid potential race conditions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is done in the same manner as the label filter. If we want to change it it would fit better in a separate PR to address this

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 6477171 in 2 minutes and 5 seconds

More details
  • Looked at 427 lines of code in 11 files
  • Skipped 0 files when reviewing.
  • Skipped posting 0 drafted comments based on config settings.

Workflow ID: wflow_bafZq7l05tKe8wdH


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

1 day left in your free trial, upgrade for $20/seat/month or contact us.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on 401166d in 2 minutes and 23 seconds

More details
  • Looked at 7 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. backend/ee-repo-ref.txt:1
  • Draft comment:
    The PR description details several changes and additions, but the diff only shows an update to a reference file. Can you confirm if the implementation of the features described (new table, frontend components, etc.) is handled in another repository or if there might be missing files in this PR?
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_dPOjSuH89kIkNJh4


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

1 day left in your free trial, upgrade for $20/seat/month or contact us.

Instead of renaming the custom_concurrency_key_ended atble, we create a
new table and we will delete custom_concurrency_key_ended in the future
when it is no longer linked to any jobs
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ Changes requested. Incremental review on 4f9b606 in 2 minutes and 25 seconds

More details
  • Looked at 61 lines of code in 4 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. backend/migrations/20240515093517_concurrency_key_observability.down.sql:2
  • Draft comment:
    The down migration script should also include a command to drop the index concurrency_key_ended_at_idx before dropping the table to ensure a clean rollback.
DROP INDEX IF EXISTS concurrency_key_ended_at_idx;
DROP TABLE IF EXISTS concurrency_key;
  • Reason this comment was not posted:
    Confidence of 50% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_1uLSFz163sV1Duo5


Want Ellipsis to fix these issues? Tag @ellipsis-dev in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

1 day left in your free trial, upgrade for $20/seat/month or contact us.

key VARCHAR(255) NOT NULL,
ended_at TIMESTAMP WITH TIME ZONE,
job_id uuid NOT NULL,
PRIMARY KEY (job_id)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider modifying the primary key to include both 'key' and 'job_id' to ensure uniqueness and data integrity across different jobs.

Suggested change
PRIMARY KEY (job_id)
PRIMARY KEY (key, job_id)

Instead of filtering jobs in the backend on a startedAfter value, limit
the query to 1000 and query all possible towards the past to get a good
context for the graph in most sane situations
Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on df7d2c7 in 2 minutes and 21 seconds

More details
  • Looked at 72 lines of code in 1 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. frontend/src/lib/components/runs/JobLoader.svelte:194
  • Draft comment:
    The fetchConcurrencyIntervals function is consistently called with undefined for the startedAfter parameter. If this is intentional to fetch records from the beginning, consider documenting this explicitly to avoid confusion.
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_0msEQkOv1s3XiqB6


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

1 day left in your free trial, upgrade for $20/seat/month or contact us.

Copy link
Contributor

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Looks good to me! Incremental review on a51a5b0 in 2 minutes and 30 seconds

More details
  • Looked at 259 lines of code in 5 files
  • Skipped 0 files when reviewing.
  • Skipped posting 1 drafted comments based on config settings.
1. frontend/src/lib/components/FlowMetadata.svelte:1
  • Draft comment:
    The PR description mentions adding a new table custom_concurrency_key for storing concurrency keys on a per job basis. However, there is no evidence in the provided code snippets of any backend changes related to the creation or management of this table. Please ensure that the backend changes are included and properly integrated with the frontend.
  • Reason this comment was not posted:
    Confidence of 0% on close inspection, compared to threshold of 50%.

Workflow ID: wflow_KFDXYa5ysOGNpXf5


You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet mode, and more.

1 day left in your free trial, upgrade for $20/seat/month or contact us.

@rubenfiszel rubenfiszel merged commit d394209 into main May 15, 2024
4 checks passed
@rubenfiszel rubenfiszel deleted the concurrency-limits-observability branch May 15, 2024 18:15
@github-actions github-actions bot locked and limited conversation to collaborators May 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants