Class MetricEntityState
java.lang.Object
com.linkedin.venice.stats.metrics.MetricEntityState
- Direct Known Subclasses:
MetricEntityStateBase
,MetricEntityStateOneEnum
,MetricEntityStateThreeEnums
,MetricEntityStateTwoEnums
Abstract operational state of a metric which should be extended by different MetricEntityStates
to pre-create/cache the
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
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
MetricEntityState
objects, each containing the same Otel instrument but different Tehuti sensors.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
create the metrics/Sensors -
Constructor Summary
ConstructorsConstructorDescriptionMetricEntityState
(MetricEntity metricEntity, VeniceOpenTelemetryMetricsRepository otelRepository, Map<VeniceMetricsDimensions, String> baseDimensionsMap, MetricEntityState.TehutiSensorRegistrationFunction registerTehutiSensorFn, TehutiMetricNameEnum tehutiMetricNameEnum, List<io.tehuti.metrics.MeasurableStat> tehutiMetricStats) -
Method Summary
Modifier and TypeMethodDescriptionvoid
createMetric
(TehutiMetricNameEnum tehutiMetricNameEnum, List<io.tehuti.metrics.MeasurableStat> tehutiMetricStats, MetricEntityState.TehutiSensorRegistrationFunction registerTehutiSensorFn) void
recordOtelMetric
(double value, io.opentelemetry.api.common.Attributes attributes) Record otel metricsvoid
setOtelMetric
(Object otelMetric) void
setTehutiSensor
(io.tehuti.metrics.Sensor tehutiSensor)
-
Constructor Details
-
MetricEntityState
public MetricEntityState(MetricEntity metricEntity, VeniceOpenTelemetryMetricsRepository otelRepository, Map<VeniceMetricsDimensions, String> baseDimensionsMap, MetricEntityState.TehutiSensorRegistrationFunction registerTehutiSensorFn, TehutiMetricNameEnum tehutiMetricNameEnum, List<io.tehuti.metrics.MeasurableStat> tehutiMetricStats)
-
-
Method Details
-
setOtelMetric
-
setTehutiSensor
public void setTehutiSensor(io.tehuti.metrics.Sensor tehutiSensor) -
createMetric
public void createMetric(TehutiMetricNameEnum tehutiMetricNameEnum, List<io.tehuti.metrics.MeasurableStat> tehutiMetricStats, MetricEntityState.TehutiSensorRegistrationFunction registerTehutiSensorFn) -
recordOtelMetric
public void recordOtelMetric(double value, io.opentelemetry.api.common.Attributes attributes) Record otel metrics
-