Class OtlpCollectorChecker
Used to check for the presence of a DNS host specified by a URI. This is used by services to determine whether an OTEL Collector relay service exists in the Kubernetes namespace where the service is running.
The idea is for the service call Start(NeonService, Uri, TimeSpan) to start the checker and then set the trace sampler to Sampler so that tracing will be enabled when the collector relay service exists and disable tracing when it doesn't.
Namespace: Neon.Service
Assembly: Neon.Service.dll
Syntax
public static class OtlpCollectorChecker
Properties
Ready
Returns true
when a collector service appears to be present in the same
namespace where the NeonService is running.
Declaration
public static bool Ready { get; }
Property Value
Type | Description |
---|---|
bool |
Sampler
Returns an OpenTelemetry sampler that allows all traces when Ready is
true
and ignores all traces when that is false
.
Declaration
public static Sampler Sampler { get; }
Property Value
Type | Description |
---|---|
Sampler |
Methods
Start(NeonService, Uri, TimeSpan)
Starts the loop that checks for the presence of a OpenTelemetry Collector service
in the current Kubernetes namespace. The Ready property will be set
to true
and the Sampler will be configured to record all traces
when the collector service appears to be available.
Declaration
public static void Start(NeonService service, Uri collectorUri = null, TimeSpan checkInterval = default)
Parameters
Type | Name | Description |
---|---|---|
NeonService | service | Passed as the NeonService instance. |
Uri | collectorUri | Optionally specifies the target collector URI. When this is passed as |
TimeSpan | checkInterval | Optionally specifies the the interval at which the presence of the collector service service. This defaults to 60 seconds but may be customized. |