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

Hangfire Search #2414

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Hangfire Search #2414

wants to merge 4 commits into from

Conversation

fairking
Copy link

@fairking fairking commented Jun 6, 2024

Introducing search in Hangfire Dashboard.

Minimal changes, but PLEASE BE AWARE there are breaking changes (see IMonitoringApi.cs) which I cannot see how we can avoid. On the other hand the search implementation could be very easy task for other projects derived from IMonitoringApi.

Search works as "Contains" and applies to the following fields:

  • Job InvocationData (class or method name),
  • Job Arguments (eg. can search userId or tenantId or any other data passed as arguments),

Search is available in:

  • Deleted Jobs,
  • Failed Jobs,
  • Processing Jobs,
  • Scheduled Jobs,
  • Succeeded Jobs.

Note:

  • Search does not work against State (exception messages or time executed). Could be improved later. But I found it less important than the search by method name or arguments.
  • Could take time to search if the number of jobs is huge. But it does not impact any performance if search is not involved.

Flexibility:
The search field which introduced in this PR could allow us to customize the search abilities in future. For example we can introduce some kind of language which would allow to search by multiple fields. Or use third party extensions which would do that. Or add such improvements in PRO version. Similar how github search field works. Eg:

  • MyJob // Search in job InvocationData only,
  • arg:9c5b94b1-35ad-49bb-b118-8e8fc24abf80 // Search in job Arguments by entity ID,
  • state:NullReferenceException // Search in state data by exception,
  • date:2024-01-01 // Search by state date,
  • param:RecurringJobId="easy_job1" // Search by job parameter
  • param:Tenant="ABC" // Another search by job parameter
  • MyJob,state:NullReferenceException,date:2024-01-01 // Search by multiple fields,
  • MyJob,param:Tenant="ABC" // Another search by multiple fields,
  • etc..

Closes #2287
Closes #2253
Closes #717

Screenshots:

image

image

@odinserj
Copy link
Member

odinserj commented Jun 7, 2024

Hello @fairking! The feature is really nice and looks awesome, but it can't be merged with Hangfire, because of breaking changes. A lot of packages, storages depend on this API, and we can't break everything. So the only viable option I see currently is to think how to make this as an extension package for Hangfire, but unfortunately I can't guide you this way, because it's not a trivial thing.

@fairking
Copy link
Author

fairking commented Jun 7, 2024

Hello @fairking! The feature is really nice and looks awesome, but it can't be merged with Hangfire, because of breaking changes. A lot of packages, storages depend on this API, and we can't break everything. So the only viable option I see currently is to think how to make this as an extension package for Hangfire, but unfortunately I can't guide you this way, because it's not a trivial thing.

Thanks @odinserj for you honest opinion. Of course I would do it as an extension if it was possible. But I don't want to waste time by creating some crazy workarounds. I would like everything to be simple and straight forward.

I see the following options:

  • Ask other packages for their opinion whether they are happy with such breaking change,
  • Include it into the next Minor version (eg. v.1.9.0),
  • Modify the JobStorageMonitor so it can be customizable by extensions,
  • Wait for the Major version v.2.0.0 :-(

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