Package org.eclipse.hono.tracing
Class TenantTraceSamplingHelper
java.lang.Object
org.eclipse.hono.tracing.TenantTraceSamplingHelper
A helper class for applying the tenant specific trace sampling
configuration.
-
Method Summary
Modifier and TypeMethodDescriptionstatic OptionalInt
applyTraceSamplingPriority
(TenantObject tenantObject, String authId, io.opentracing.Span span) Applies the trace sampling priority configured for the given tenant to the given span.static OptionalInt
getTraceSamplingPriority
(TenantObject tenantObject, String authId) Gets the trace sampling priority configured for the given tenant and authentication identifier.
-
Method Details
-
getTraceSamplingPriority
Gets the trace sampling priority configured for the given tenant and authentication identifier.- Parameters:
tenantObject
- The tenant from which to get the trace sampling priority configuration.authId
- The authentication identifier to get the trace sampling priority for (may benull
).- Returns:
- An OptionalInt containing the identified sampling priority or an empty OptionalInt if no priority was identified.
- Throws:
NullPointerException
- if tenantObject isnull
.
-
applyTraceSamplingPriority
public static OptionalInt applyTraceSamplingPriority(TenantObject tenantObject, String authId, io.opentracing.Span span) Applies the trace sampling priority configured for the given tenant to the given span.- Parameters:
tenantObject
- The tenant from which to get the trace sampling priority configuration.authId
- The authentication identifier to get the trace sampling priority for (may benull
).span
- The span to apply the configuration to.- Returns:
- An OptionalInt containing the applied sampling priority or an empty OptionalInt if no priority was applied.
- Throws:
NullPointerException
- if tenantObject or span isnull
.
-