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 'paused' label to 'prefect_info_deployments' metric #47

Merged
merged 4 commits into from
Oct 17, 2024

Conversation

mitchnielsen
Copy link
Contributor

@mitchnielsen mitchnielsen commented Oct 17, 2024

Summary

  • Adds the 'paused' label to the 'prefect_info_deployments' metric
  • Also uses this value for the 'is_schedule_active' label, which is deprecated and always returns Null.
  • Updates the docker-compose testing setup to use Prefect 3

Related to PLA-224

Testing

I ran docker-compose up -d and created a deployment with a schedule:

from prefect import flow

@flow
def my_flow():
    print("Hello, Prefect!")

if __name__ == "__main__":
    my_flow.serve(name="my-first-deployment-scheduled", cron="* * * * *")

Then I checked the prometheus metrics to confirm that is_schedule_active now has a value, and that it matches the opposite of the paused value:

image

Next I paused the deployment from the UI and confirmed paused=True and is_schedule_active=False:

image

- Adds the 'paused' label to the 'prefect_info_deployments' metric
- Also uses this value for the 'is_schedule_active' label, which is
  deprecated and always returns Null.
- Updates the docker-compose testing setup to use Prefect 3

Related to PLA-224
@mitchnielsen mitchnielsen self-assigned this Oct 17, 2024
'is_schedule_active' is the opposite of 'paused', so if we're using the
'paused' value we need to negate it.
@mitchnielsen mitchnielsen marked this pull request as ready for review October 17, 2024 17:00
@mitchnielsen mitchnielsen requested a review from a team as a code owner October 17, 2024 17:00
@mitchnielsen
Copy link
Contributor Author

@ubiquitousbyte FYI in case you want/have time to take a look before we merge to see if this addresses what you were seeing.

If we get "null" back, we don't want to `not` that because we'll always
get False instead of "null". This separates the logic and only negates
the value if we don't get "null" back.
@mitchnielsen mitchnielsen merged commit 2ca2eb1 into main Oct 17, 2024
@mitchnielsen mitchnielsen deleted the paused-deployments branch October 17, 2024 18:55
@mitchnielsen mitchnielsen added bug Something isn't working feature and removed bug Something isn't working labels Oct 17, 2024
@ubiquitousbyte
Copy link

@mitchnielsen great work here. Thanks!

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

Successfully merging this pull request may close these issues.

3 participants