Package org.eclipse.hono.util
Class TenantTracingConfig
- java.lang.Object
-
- org.eclipse.hono.util.TenantTracingConfig
-
public class TenantTracingConfig extends Object
A tenant specific tracing configuration.
-
-
Constructor Summary
Constructors Constructor Description TenantTracingConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TracingSamplingMode
getSamplingMode()
Gets the sampling mode that defines in how far spans created when processing messages for a tenant shall be recorded (sampled) by the tracing system.TracingSamplingMode
getSamplingMode(String authId)
Gets the sampling mode for a specific device.Map<String,TracingSamplingMode>
getSamplingModePerAuthId()
Gets the sampling modes defined for specific devices.TenantTracingConfig
setSamplingMode(TracingSamplingMode samplingMode)
Sets the sampling mode that defines in how far spans created when processing messages for a tenant shall be recorded (sampled) by the tracing system.TenantTracingConfig
setSamplingModePerAuthId(Map<String,TracingSamplingMode> samplingModePerAuthId)
Sets the sampling modes defined for specific devices.
-
-
-
Method Detail
-
getSamplingMode
public final TracingSamplingMode getSamplingMode()
Gets the sampling mode that defines in how far spans created when processing messages for a tenant shall be recorded (sampled) by the tracing system.- Returns:
- The sampling mode or
null
if not set.
-
setSamplingMode
public final TenantTracingConfig setSamplingMode(TracingSamplingMode samplingMode)
Sets the sampling mode that defines in how far spans created when processing messages for a tenant shall be recorded (sampled) by the tracing system.- Parameters:
samplingMode
- The sampling mode.- Returns:
- This instance for command chaining.
-
getSamplingModePerAuthId
public Map<String,TracingSamplingMode> getSamplingModePerAuthId()
Gets the sampling modes defined for specific devices.The sampling mode for a specific device overrides the value returned by
getSamplingMode()
.- Returns:
- An unmodifiable view on the device specific sampling modes. The returned map contains authentication identifiers as keys.
-
setSamplingModePerAuthId
public TenantTracingConfig setSamplingModePerAuthId(Map<String,TracingSamplingMode> samplingModePerAuthId)
Sets the sampling modes defined for specific devices.The sampling mode for a specific device overrides the value returned by
getSamplingMode()
.- Parameters:
samplingModePerAuthId
- The device specific sampling modes. The map must contain authentication identifiers as keys.- Returns:
- This instance for command chaining.
-
getSamplingMode
public final TracingSamplingMode getSamplingMode(String authId)
Gets the sampling mode for a specific device.- Parameters:
authId
- The authentication identity of the device.- Returns:
- The sampling mode set for the device or
the default sampling mode if no mode has been set for the device or
null
if no default sampling mode has been set.
-
-