AspNetCore.Diagnostics.HealthChecks icon indicating copy to clipboard operation
AspNetCore.Diagnostics.HealthChecks copied to clipboard

Added overload to for StatsdConfig

Open IlSocio opened this issue 1 year ago • 1 comments
trafficstars

Was not possible to customize additional parameters of the Datadog Publisher (eg. the port)

I only added an overload to expose the StatsdConfig, so, the consumers of the package can freely set any parameter supported by Datadog.

IlSocio avatar Aug 21 '24 09:08 IlSocio

@dotnet-policy-service agree

IlSocio avatar Aug 21 '24 09:08 IlSocio

Sorry I'm not sure what you mean by "ensuring this health check is optimal"?

kevingosse avatar Dec 02 '24 15:12 kevingosse

Sorry I'm not sure what you mean by "ensuring this health check is optimal"?

@kevingosse Currently the health check registers a singleton factory which creates a DogStatsdService dedicated to the health check when its invoked for the first time:

https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/blob/f587a637a1dc9850cce87d441ba173d50679aefc/src/HealthChecks.Publisher.Datadog/DependencyInjection/DatadogHealthCheckBuilderExtensions.cs#L28-L38

I am wondering if it should keep doing that, or just resolve DogStatsdService instance from the DI (a lot of similar types are thread safe and recommended to used as a singleton). Just to make sure there is one DogStatsdService instance per app (rather than at least two).

adamsitnik avatar Dec 02 '24 15:12 adamsitnik

Oh I see. Yes, DogStatsdService is meant to be used as a singleton, so I agree using DI would help reducing the risk of creating multiple instances 👍

kevingosse avatar Dec 02 '24 16:12 kevingosse

I've sent https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/pull/2329 as a follow up

adamsitnik avatar Dec 03 '24 10:12 adamsitnik