-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 with Aspire integration #2408
Comments
Looks indeed interesting, but need to understand its component model first. It seems to me that it's possible to integrate Hangfire with its current capabilities, since Aspire is likely using ASP.NET Core infrastructure, so it is likely to see the logs in Aspire dashboard anyway. But more detailed integration would be useful to have. |
We should make this simpler - we should add the ability for Hangfire to simply use a DB on the container provide by aspire. Do do this it needs to be able to install the DB seamlessly: Hangfire Project: Aspire: This way the Db gets installed on the local development container and initialized with the schema. Then, this simplifies deployment to Azure. |
Let's not forget Aspire provides packages for the client too. So all the goodies like OpenTelemetry, Health Checks, and more are expected to be provided out-of-box. |
Would be very useful. Any chance on that? |
At a minimum, I am looking at adding Activity (trace/span) support, for Producer/Consumer, similar to MassTransit. (Because Hangfire doesn't integrate with activity, so has no trace ID). Once tracing is working, logs should be automatically correlated (if they go through normal .NET ILogger). Metrics can be added later. |
Addresses tracing aspects of HangfireIO#2408 for integration with Aspire, as well as all other OpenTelemetery based diagnostics. Start producer activities (spans) when jobs created, and consumer activities when jobs executed. Pass the creation context through as TraceParent and TraceState, so that distributed tracing works across job scheduling. Note that activity supports is only from netstandard2.0 onwards, and only creates activities if there is a configured listener.
I've put up a PR for the observability aspects, to start new activities for job producer and consumer. #2460 This follows .NET standards (based on OpenTelemetry), so observability can easily be added (just add the named source to OTel so it creates a listener and activates the integration). This will cover the trace and logging aspects. (Metrics will need to be done separately). |
Addresses tracing aspects of HangfireIO#2408 for integration with Aspire, as well as all other OpenTelemetery based diagnostics. Start producer activities (spans) when jobs created, and consumer activities when jobs executed. Pass the creation context through as TraceParent and TraceState, so that distributed tracing works across job scheduling. Note that activity supports is only from netstandard2.0 onwards, and only creates activities if there is a configured listener.
Addresses tracing aspects of HangfireIO#2408 for integration with Aspire, as well as all other OpenTelemetery based diagnostics. Start producer activities (spans) when jobs created, and consumer activities when jobs executed. Pass the creation context through as TraceParent and TraceState, so that distributed tracing works across job scheduling. Note that activity supports is only from netstandard2.0 onwards, and only creates activities if there is a configured listener.
Addresses tracing aspects of HangfireIO#2408 for integration with Aspire, as well as all other OpenTelemetery based diagnostics. Start producer activities (spans) when jobs created, and consumer activities when jobs executed. Pass the creation context through as TraceParent and TraceState, so that distributed tracing works across job scheduling. Note that activity supports is only from netstandard2.0 onwards, and only creates activities if there is a configured listener.
Addresses tracing aspects of HangfireIO#2408 for integration with Aspire, as well as all other OpenTelemetery based diagnostics, and addresses HangfireIO#2017. Add a default filter to start producer activities (spans) when jobs created, and consumer activities when jobs performed. Pass the creation context through as TraceParent and TraceState job parameters, so that distributed tracing works across job scheduling. Note that activity supports is only from netstandard2.0 onwards, and only creates activities if there is a configured listener.
Addresses tracing aspects of HangfireIO#2408 for integration with Aspire, as well as all other OpenTelemetery based diagnostics, and addresses HangfireIO#2017. Add a default filter to start producer activities (spans) when jobs created, and consumer activities when jobs performed. Pass the creation context through as TraceParent and TraceState job parameters, so that distributed tracing works across job scheduling. Note that activity supports is only from netstandard2.0 onwards, and only creates activities if there is a configured listener.
What I think would be a killer combo is having Hangfire integration in Aspire.
The scenario I would like to see is that you have Aspire running with multiple Hangfire workers on different projects running in Aspire.
The Hangfire dashboard as plugin part of the Aspire dashboard, which will give an overview on all the Hangfire jobs on all the Hangfire workers running in Aspire.
Also the telemetry and logging being visible from Aspire.
The text was updated successfully, but these errors were encountered: