CosmosMicrometerMetricsOptions Class
- java.
lang. Object - com.
azure. core. util. MetricsOptions - com.
azure. cosmos. models. CosmosMicrometerMetricsOptions
- com.
- com.
public final class CosmosMicrometerMetricsOptions
extends MetricsOptions
Micrometer-specific Azure Cosmos DB SDK metrics options
Constructor Summary
| Constructor | Description |
|---|---|
| CosmosMicrometerMetricsOptions() |
Instantiates new Micrometer-specific Azure Cosmos DB SDK metrics options |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
Cosmos |
addMetricCategories(CosmosMetricCategory[] categories)
Adds categories of metrics that should be emitted. |
|
Cosmos |
applyDiagnosticThresholdsForTransportLevelMeters(boolean isEnabled)
Sets a flag indicating whether for transport level (rntbd) meters should only be emitted when diagnostic thresholds are violated. |
|
Cosmos |
configureDefaultPercentiles(double[] percentiles)
Sets the default percentiles that should be captured for metrics (where applicable) unless overridden for a specific meter in its CosmosMicrometerMeterOptions By default percentiles 0.95 and 0.99 are captured. |
|
Cosmos |
configureDefaultTagNames(CosmosMetricTagName[] tags)
Sets the default tags that should be used for metrics (where applicable) unless overridden for a specific meter in its CosmosMicrometerMeterOptions By default all applicable tags are added for each metric. |
|
Cosmos |
configureMeter(CosmosMetricName meterName, CosmosMicrometerMeterOptions options)
Allows overriding meter-specific options. |
|
Cosmos |
enableHistogramsByDefault(boolean publishHistograms)
Sets a flag indicating whether by default histograms should be published for metrics (where applicable) unless overridden for a specific meter in its CosmosMicrometerMeterOptions By default histograms are published. |
|
Cosmos |
meterRegistry(MeterRegistry clientMetricMeterRegistry)
Sets Metric |
|
Cosmos |
removeMetricCategories(CosmosMetricCategory[] categories)
Removes categories of metrics that should be emitted. |
|
Cosmos |
setEnabled(boolean enabled) |
|
Cosmos |
setMetricCategories(CosmosMetricCategory[] categories)
Sets the categories of metrics that should be emitted. |
Methods inherited from MetricsOptions
Methods inherited from java.lang.Object
Constructor Details
CosmosMicrometerMetricsOptions
public CosmosMicrometerMetricsOptions()
Instantiates new Micrometer-specific Azure Cosmos DB SDK metrics options
Method Details
addMetricCategories
public CosmosMicrometerMetricsOptions addMetricCategories(CosmosMetricCategory[] categories)
Adds categories of metrics that should be emitted. By default the following categories will be enabled: OperationSummary (required), RequestSummary, DirectChannels, DirectRequests, System (required) (the System and OperationSummary metrics are always collected and can't be disabled when enabling Cosmos metrics) An overview of the different metric categories can be found here: https://aka.ms/azure-cosmos-metrics NOTE: metric categories are mutable. You can safely modify the categories on the CosmosClientTelemetryConfig instance passed into the CosmosClientBuilder after the CosmosClient was created - and changes to the config instance will be reflected at runtime by the client.
Parameters:
- a comma-separated list of metric categories that should be emitted
Returns:
applyDiagnosticThresholdsForTransportLevelMeters
public CosmosMicrometerMetricsOptions applyDiagnosticThresholdsForTransportLevelMeters(boolean isEnabled)
Sets a flag indicating whether for transport level (rntbd) meters should only be emitted when diagnostic thresholds are violated. This can be enabled to reduce the cardinality of dimensions (and the number of time series being stored) especially when the partition/replica-level dimensions are enabled and the workload is dealing with containers having a high number of physical partitions. Request-level metrics usually are used to capture metrics per backend endpoint/replica - a high cardinality dimension. Filtering by diagnostic thresholds reduces the overhead - but also means request-level metrics can only be used for debugging purposes - not for monitoring purposes. So, it is important to use the unfiltered operation-level metrics for health monitoring in this case. By default, no filtering happens and diagnostic thresholds are not applied.
Parameters:
- a flag indicating whether for transport level (rntbd) meters should only be emitted when diagnostic thresholds are violated. (when they are applicable to a specific meter and there is no override in applyDiagnosticThresholds(boolean isEnabled) for that meter.
Returns:
configureDefaultPercentiles
public CosmosMicrometerMetricsOptions configureDefaultPercentiles(double[] percentiles)
Sets the default percentiles that should be captured for metrics (where applicable) unless overridden for a specific meter in its CosmosMicrometerMeterOptions By default percentiles 0.95 and 0.99 are captured. If percentiles is null or empty no percentiles will be captured.
Parameters:
- the default percentiles to be captured (when they are applicable to a specific meter and there is no override in CosmosMicrometerMeterOptions for that meter.
Returns:
configureDefaultTagNames
public CosmosMicrometerMetricsOptions configureDefaultTagNames(CosmosMetricTagName[] tags)
Sets the default tags that should be used for metrics (where applicable) unless overridden for a specific meter in its CosmosMicrometerMeterOptions By default all applicable tags are added for each metric. Adding tags/dimensions especially with high cardinality has some overhead - so, this method allows modifying the set of tags to be applied when some are not relevant in a certain use case.
Parameters:
- the default tags to be used (when they are applicable to a specific meter and there is no override in CosmosMicrometerMeterOptions for that meter.
Returns:
configureMeter
public CosmosMicrometerMetricsOptions configureMeter(CosmosMetricName meterName, CosmosMicrometerMeterOptions options)
Allows overriding meter-specific options.
Parameters:
Returns:
enableHistogramsByDefault
public CosmosMicrometerMetricsOptions enableHistogramsByDefault(boolean publishHistograms)
Sets a flag indicating whether by default histograms should be published for metrics (where applicable) unless overridden for a specific meter in its CosmosMicrometerMeterOptions By default histograms are published. Publishing histograms has its overhead - so, this method allows disabling histograms by default.
Parameters:
- a flag indicating whether by default histograms should be published for metrics (when they are applicable to a specific meter and there is no override in CosmosMicrometerMeterOptions for that meter.
Returns:
meterRegistry
public CosmosMicrometerMetricsOptions meterRegistry(MeterRegistry clientMetricMeterRegistry)
Sets MetricRegistry to be used to emit client metrics
Parameters:
- the MetricRegistry to be used to emit client metrics
Returns:
removeMetricCategories
public CosmosMicrometerMetricsOptions removeMetricCategories(CosmosMetricCategory[] categories)
Removes categories of metrics that should be emitted. By default the following categories will be enabled: OperationSummary (required), RequestSummary, DirectChannels, DirectRequests, System (required) (the System and OperationSummary metrics are always collected and can't be disabled when enabling Cosmos metrics) An overview of the different metric categories can be found here: https://aka.ms/azure-cosmos-metrics NOTE: metric categories are mutable. You can safely modify the categories on the CosmosClientTelemetryConfig instance passed into the CosmosClientBuilder after the CosmosClient was created - and changes to the config instance will be reflected at runtime by the client.
Parameters:
- a comma-separated list of metric categories that should be emitted
Returns:
setEnabled
public CosmosMicrometerMetricsOptions setEnabled(boolean enabled)
Overrides:
CosmosMicrometerMetricsOptions.setEnabled(boolean enabled)Parameters:
setMetricCategories
public CosmosMicrometerMetricsOptions setMetricCategories(CosmosMetricCategory[] categories)
Sets the categories of metrics that should be emitted. By default the following categories will be enabled: OperationSummary (required), RequestSummary, DirectChannels, DirectRequests, System (required) (the System and OperationSummary metrics are always collected and can't be disabled when enabling Cosmos metrics) For most use-cases that should be sufficient. An overview of the different metric categories can be found here: https://aka.ms/azure-cosmos-metrics NOTE: metric categories are mutable. You can safely modify the categories on the CosmosClientTelemetryConfig instance passed into the CosmosClientBuilder after the CosmosClient was created - and changes to the config instance will be reflected at runtime by the client.
Parameters:
- a comma-separated list of metric categories that should be emitted
Returns: