Package org.eclipse.hono.tracing
Class TenantTraceSamplingHelper
- java.lang.Object
-
- org.eclipse.hono.tracing.TenantTraceSamplingHelper
-
public final class TenantTraceSamplingHelper extends Object
A helper class for applying the tenant specific trace sampling configuration.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.static OptionalInt
getTraceSamplingPriority(TenantObject tenantObject, String authId)
Gets the trace sampling priority configured for the given tenant and authentication identifier.
-
-
-
Method Detail
-
getTraceSamplingPriority
public static OptionalInt getTraceSamplingPriority(TenantObject tenantObject, String authId)
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
.
-
-