Skip to content

Crons doesn't work #3262

Closed
Closed

Description

@bruno-garcia

I added 2 monitors in this PR a few weeks ago:

I was hoping it would just work, since hangfire has the information about how often the job should run etc and docs have no reference about upserting not being supported.

Since there is not instruction for .NET (plain .NET nor Hangfire, my use case), I commented about it here:

So because of that I created a type CLI:
I used the same monitor name as I added to code: NuGetCatalogImporter.Import. I was hoping the name would also be automatic given we know that in the code, but that's a separate feature request filed here:

After creating it manually I saw:
image

But it created one telling me the slug is nugetcatalogimporterimport. Does that mean the id I added to code won't work?

What's more concerning is that I don't see any dropped crons:
image

Is the SDK sending pings but it's not showing because I didn't create the monitor correctly? If so, should it at least show as dropped crons checkins in the Stats page?

I'm not sure how to proceed to get Crons working with .NET

Activity

  1. digital88 commented on Apr 5, 2024

    @digital88

    I think Hangfire explicitly wants monitor slug, not monitor name. So try changing "NuGetCatalogImporter.Import" to "nugetcatalogimporterimport". You dont see dropped crons because of this, to be considered "dropped" monitor should checkin first with status: CheckinStatus.InProgress.

  2. moved this to Waiting for: Product Owner in GitHub Issues with 👀 2on Apr 5, 2024
  3. bitsandfoxes commented on Apr 8, 2024

    @bitsandfoxes
    Contributor

    I was hoping it would just work

    This is something the ability to upsert those monitors will greatly improve on.

  4. moved this from Waiting for: Product Owner to No status in GitHub Issues with 👀 2on Apr 8, 2024
  5. bruno-garcia commented on Apr 9, 2024

    @bruno-garcia
    MemberAuthor

    I think Hangfire explicitly wants monitor slug, not monitor name. So try changing "NuGetCatalogImporter.Import" to "nugetcatalogimporterimport". You dont see dropped crons because of this, to be considered "dropped" monitor should checkin first with status: CheckinStatus.InProgress.

    I went through onboarding, added the Monitor attribute and expected it to work. Then nothing happened, I found out that upsert doesn't work and I have to create by hand. After doing that, I couldn't control to slug. So I need to make another code change and deploy it live.

    In summary this was a pretty bad UX and I'm not very motivated to fix this now. And also I don't even know if it's sending data and being rejected since stats show 0 crons. So is the SDK sending crons with the wrong slug? If so shouldn't I see that somewhere?

  6. added
    BugSomething isn't working
    and removed on May 30, 2025
  7. jamescrosswell commented on Jul 14, 2025

    @jamescrosswell
    Collaborator

    I just followed the docs here and it all seemed to work fine. I did run into the same issue as @bruno-garcia though:

    • I didn't realise I needed to create a monitor in Sentry first (to be fair, that was documented clearly in the requirements, I just read too quickly).
    • When I did realise I needed to create a Monitor, there was never an option to configure a slug (it just inferred one from the monitor name I chose).

    I tested with a checkin that started but didn't finish, to make sure I got a timeout error, and that seemed to work as expected.

    I also tried configuring a monitor that expected a checkin every minute, and after I missed a checking, I got an alert event... so also working as expected.

    From what I can tell then, Crons are working... we could just improve the guidance/docs a bit.

    I've created a new issue to ensure we improve the guidance:

    Otherwise, closing this issue. If you can provide a concrete sequence of steps that leads to unexpected behaviour then feel free to reopen. Additionally, I'll dogfood crons in a side project I'm working on and raise any issues here if I bump into any.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions