Class AsyncMetricEntityState
java.lang.Object
com.linkedin.venice.stats.metrics.AsyncMetricEntityState
- Direct Known Subclasses:
AsyncMetricEntityStateBase
,MetricEntityState
Abstract operational state of an Async metric which
1. is extended by
This abstract class holds:
1. Whether otel is enabled or not
2. A
3. One OpenTelemetry (Otel) Instrument
4. Zero or one (out of zero for new metrics or more for existing metrics) Tehuti sensors for this Otel Metric.
One Otel instrument can cover multiple Tehuti sensors through the use of dimensions. Ideally, this class should represent a one-to-many mapping between an Otel instrument and Tehuti sensors. However, to simplify lookup during runtime, this class holds one Otel instrument and one Tehuti sensor. If an Otel instrument corresponds to multiple Tehuti sensors, there will be multiple
MetricEntityState
to provide the record() functionality for non async metrics
2. should be extended by different AsyncMetricEntityStates like AsyncMetricEntityStateBase
to
pre-create/cache the Attributes
for different number/type of dimensions. check out the
classes extending this for more details. This abstract class holds:
1. Whether otel is enabled or not
2. A
MetricEntity
3. One OpenTelemetry (Otel) Instrument
4. Zero or one (out of zero for new metrics or more for existing metrics) Tehuti sensors for this Otel Metric.
One Otel instrument can cover multiple Tehuti sensors through the use of dimensions. Ideally, this class should represent a one-to-many mapping between an Otel instrument and Tehuti sensors. However, to simplify lookup during runtime, this class holds one Otel instrument and one Tehuti sensor. If an Otel instrument corresponds to multiple Tehuti sensors, there will be multiple
AsyncMetricEntityState
objects, each containing the same Otel instrument but different Tehuti sensors.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
create the metrics/Sensors -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final MetricEntity
protected Object
Otel metricprotected final VeniceOpenTelemetryMetricsRepository
protected io.tehuti.metrics.Sensor
Respective tehuti metric -
Constructor Summary
ConstructorsConstructorDescriptionAsyncMetricEntityState
(MetricEntity metricEntity, VeniceOpenTelemetryMetricsRepository otelRepository, Map<VeniceMetricsDimensions, String> baseDimensionsMap, AsyncMetricEntityState.TehutiSensorRegistrationFunction registerTehutiSensorFn, TehutiMetricNameEnum tehutiMetricNameEnum, List<io.tehuti.metrics.MeasurableStat> tehutiMetricStats, LongSupplier asyncCallback, io.opentelemetry.api.common.Attributes asyncAttributes) -
Method Summary
Modifier and TypeMethodDescriptionvoid
createMetric
(TehutiMetricNameEnum tehutiMetricNameEnum, List<io.tehuti.metrics.MeasurableStat> tehutiMetricStats, AsyncMetricEntityState.TehutiSensorRegistrationFunction registerTehutiSensorFn, LongSupplier asyncCallback, io.opentelemetry.api.common.Attributes asyncAttributes) void
setOtelMetric
(Object otelMetric) void
setTehutiSensor
(io.tehuti.metrics.Sensor tehutiSensor)
-
Field Details
-
otelRepository
-
metricEntity
-
otelMetric
Otel metric -
tehutiSensor
protected io.tehuti.metrics.Sensor tehutiSensorRespective tehuti metric
-
-
Constructor Details
-
AsyncMetricEntityState
public AsyncMetricEntityState(MetricEntity metricEntity, VeniceOpenTelemetryMetricsRepository otelRepository, Map<VeniceMetricsDimensions, String> baseDimensionsMap, AsyncMetricEntityState.TehutiSensorRegistrationFunction registerTehutiSensorFn, TehutiMetricNameEnum tehutiMetricNameEnum, List<io.tehuti.metrics.MeasurableStat> tehutiMetricStats, LongSupplier asyncCallback, io.opentelemetry.api.common.Attributes asyncAttributes)
-
-
Method Details
-
setOtelMetric
-
setTehutiSensor
public void setTehutiSensor(io.tehuti.metrics.Sensor tehutiSensor) -
createMetric
public void createMetric(TehutiMetricNameEnum tehutiMetricNameEnum, List<io.tehuti.metrics.MeasurableStat> tehutiMetricStats, AsyncMetricEntityState.TehutiSensorRegistrationFunction registerTehutiSensorFn, LongSupplier asyncCallback, io.opentelemetry.api.common.Attributes asyncAttributes)
-