public final class MetricsUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static void |
defaultDimensions(software.amazon.cloudwatchlogs.emf.model.DimensionSet... dimensionSets)
Configure default dimension to be used by logger.
|
static void |
defaultDimensionSet(software.amazon.cloudwatchlogs.emf.model.DimensionSet dimensionSet)
Deprecated.
use
defaultDimensions(DimensionSet...) instead |
static software.amazon.cloudwatchlogs.emf.model.DimensionSet[] |
getDefaultDimensions() |
static boolean |
hasDefaultDimension() |
static software.amazon.cloudwatchlogs.emf.logger.MetricsLogger |
metricsLogger()
The instance of the
MetricsLogger used by Metrics. |
static void |
withSingleMetric(java.lang.String name,
double value,
software.amazon.cloudwatchlogs.emf.model.Unit unit,
java.util.function.Consumer<software.amazon.cloudwatchlogs.emf.logger.MetricsLogger> logger)
Add and immediately flush a single metric.
|
static void |
withSingleMetric(java.lang.String name,
double value,
software.amazon.cloudwatchlogs.emf.model.Unit unit,
java.lang.String namespace,
java.util.function.Consumer<software.amazon.cloudwatchlogs.emf.logger.MetricsLogger> logger)
Add and immediately flush a single metric.
|
public static software.amazon.cloudwatchlogs.emf.logger.MetricsLogger metricsLogger()
MetricsLogger used by Metrics.public static void defaultDimensions(software.amazon.cloudwatchlogs.emf.model.DimensionSet... dimensionSets)
Metrics annotation captures configured service as a dimension ServicedimensionSets - Default value of dimensions set for logger@Deprecated public static void defaultDimensionSet(software.amazon.cloudwatchlogs.emf.model.DimensionSet dimensionSet)
defaultDimensions(DimensionSet...) insteadMetrics annotation captures configured service as a dimension ServicedimensionSet - Default value of dimension set for loggerpublic static void withSingleMetric(java.lang.String name,
double value,
software.amazon.cloudwatchlogs.emf.model.Unit unit,
java.util.function.Consumer<software.amazon.cloudwatchlogs.emf.logger.MetricsLogger> logger)
Metrics annotation or via POWERTOOLS_METRICS_NAMESPACE env var.
It by default captures function_request_id as property if used together with Metrics annotation. It will also
capture xray_trace_id as property if tracing is enabled.name - the name of the metricvalue - the value of the metricunit - the unit type of the metriclogger - the MetricsLoggerpublic static void withSingleMetric(java.lang.String name,
double value,
software.amazon.cloudwatchlogs.emf.model.Unit unit,
java.lang.String namespace,
java.util.function.Consumer<software.amazon.cloudwatchlogs.emf.logger.MetricsLogger> logger)
Metrics annotation. It will also
capture xray_trace_id as property if tracing is enabled.name - the name of the metricvalue - the value of the metricunit - the unit type of the metricnamespace - the namespace associated with the metriclogger - the MetricsLoggerpublic static software.amazon.cloudwatchlogs.emf.model.DimensionSet[] getDefaultDimensions()
public static boolean hasDefaultDimension()
Copyright © 2022. All rights reserved.