Particular / NServiceBus

Build, version, and monitor better microservices with the most powerful service platform for .NET
https://particular.net/nservicebus/
Other
2.07k stars 650 forks source link

Add processing times to OpenTelemetry metrics #6868

Open timbussmann opened 9 months ago

timbussmann commented 9 months ago

Describe the suggested improvement

The NServiceBus OpenTelemetry integration currently promotes the following metrics:

The NServiceBus.Metrics package supports more metrics though, for example

These metrics are currently not available when using the OpenTelemetry integration instead of the Metrics package. When using OpenTelemetry, it does only add noise and overhead to also rely on the NServiceBus.Metrics package for these additional metrics.

Describe the suggested solution

Add additional metrics to the built-in OpenTelemetry metrics, e.g. Critical time and processing time.

Additional Context

No response

cjoergensen commented 7 months ago

Does the NServiceBus.Metrics package expose the metrics via OpenTelemetry by default, or does it require custom code?

mauroservienti commented 7 months ago

@cjoergensen, the Metrics package was designed before the advent of OTel. It requires custom code to capture and report those metrics to an OpenTelemetry collector. I'm not sure the data exposed by the Metrics package have all the needed information to plugin into the OTel activities model.

More details in our documentation.

bbrandt commented 5 months ago

FYI, stay tuned! Great things are on the way according to David Boike!

https://github.com/Particular/docs.particular.net/issues/6446#issuecomment-1934468629

bbrandt commented 2 months ago

Workaround to get these metrics in App Insights without the need for NServiceBus.Metrics: https://docs.particular.net/samples/open-telemetry/application-insights/

And Prometheus: https://docs.particular.net/samples/open-telemetry/prometheus-grafana/