Package com.linkedin.venice.stats
Class VeniceMetricsConfig
java.lang.Object
com.linkedin.venice.stats.VeniceMetricsConfig
Configuration for metrics emitted by Venice: Holds OpenTelemetry as well as Tehuti configs
Configs starting with "otel.venice." are venice specific configs for OpenTelemetry metrics
other configs starting with "otel.exporter." are generic OpenTelemetry exporter configs but are parsed in this class and used setters to configure otel exporter.
Configs starting with "otel.venice." are venice specific configs for OpenTelemetry metrics
other configs starting with "otel.exporter." are generic OpenTelemetry exporter configs but are parsed in this class and used setters to configure otel exporter.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Default histogram aggregation to be used for all histograms: Select one of the below
1.static final String
Max buckets for base2_exponential_bucket_histogramstatic final String
Max scale for base2_exponential_bucket_histogramstatic final String
The Endpoint to which the metrics are exportedstatic final String
Additional headers to pass while creating OpenTelemetry exporterstatic final String
Protocol over which the metrics are exported toOTEL_EXPORTER_OTLP_METRICS_ENDPOINT
1.static final String
Aggregation Temporality selector to export only the delta or cumulate or differentstatic final String
Configuration to define a custom description for all Histogram metrics.static final String
Config Map to add custom dimensions to the metrics: Can be used for system dimensions amongst other custom dimensions
These will be emitted along with all the metrics emitted.static final String
Config to enable OpenTelemetry metricsstatic final String
Export interval in seconds for OpenTelemetry metricsstatic final String
Export opentelemetry metrics toOTEL_EXPORTER_OTLP_METRICS_ENDPOINT
overOTEL_EXPORTER_OTLP_METRICS_PROTOCOL
static final String
Export opentelemetry metrics to a log exporterVeniceOpenTelemetryMetricsRepository.LogBasedMetricExporter
static final String
Config to set the naming format for OpenTelemetry metricsVeniceOpenTelemetryMetricNamingFormat
static final String
Config to set the metric prefix for OpenTelemetry metricsstatic final String
Configuration to reuse theOpenTelemetry
instance already initialized by the application or other libraries and registered asGlobalOpenTelemetry
, instead of creating a new one. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
boolean
int
io.opentelemetry.sdk.metrics.export.MetricReader
io.opentelemetry.sdk.metrics.export.AggregationTemporalitySelector
int
int
io.tehuti.metrics.MetricConfig
toString()
boolean
boolean
-
Field Details
-
OTEL_VENICE_METRICS_ENABLED
Config to enable OpenTelemetry metrics- See Also:
-
OTEL_VENICE_USE_OPENTELEMETRY_INITIALIZED_BY_APPLICATION
Configuration to reuse theOpenTelemetry
instance already initialized by the application or other libraries and registered asGlobalOpenTelemetry
, instead of creating a new one. This is especially useful in clients where a single application may use multiple Venice client libraries. Without this setting, each library would initialize its own OpenTelemetry instance, leading to redundant initialization and increased resource usage.- See Also:
-
OTEL_VENICE_METRICS_PREFIX
Config to set the metric prefix for OpenTelemetry metrics- See Also:
-
OTEL_VENICE_METRICS_CUSTOM_DESCRIPTION_FOR_HISTOGRAM
Configuration to define a custom description for all Histogram metrics. This option is particularly relevant whenOTEL_VENICE_USE_OPENTELEMETRY_INITIALIZED_BY_APPLICATION
is enabled, restricting direct configuration of OpenTelemetry via Venice code and application code overrides can rely on something else like the description here without introducing new setters or APIs. When set to a non-empty string, if neeeded, this description could be used by application-level code overrides to control Histogram behavior (e.g., exponential vs. explicit aggregation) as done inVeniceOpenTelemetryMetricsRepository.setExponentialHistogramAggregation(io.opentelemetry.sdk.metrics.SdkMeterProviderBuilder, com.linkedin.venice.stats.VeniceMetricsConfig)
If null or unset, this configuration has no effect.- See Also:
-
OTEL_VENICE_METRICS_NAMING_FORMAT
Config to set the naming format for OpenTelemetry metricsVeniceOpenTelemetryMetricNamingFormat
- See Also:
-
OTEL_VENICE_METRICS_EXPORT_TO_LOG
Export opentelemetry metrics to a log exporterVeniceOpenTelemetryMetricsRepository.LogBasedMetricExporter
- See Also:
-
OTEL_VENICE_METRICS_EXPORT_TO_ENDPOINT
Export opentelemetry metrics toOTEL_EXPORTER_OTLP_METRICS_ENDPOINT
overOTEL_EXPORTER_OTLP_METRICS_PROTOCOL
- See Also:
-
OTEL_VENICE_METRICS_EXPORT_INTERVAL_IN_SECONDS
Export interval in seconds for OpenTelemetry metrics- See Also:
-
OTEL_VENICE_METRICS_CUSTOM_DIMENSIONS_MAP
Config Map to add custom dimensions to the metrics: Can be used for system dimensions amongst other custom dimensions
These will be emitted along with all the metrics emitted. custom dimensions are passed as key=value pairs separated by '=' Multiple headers are separated by ',' For example: "custom_dimension_one=value1,custom_dimension_two=value2,custom_dimension_three=value3"- See Also:
-
OTEL_EXPORTER_OTLP_METRICS_PROTOCOL
Protocol over which the metrics are exported toOTEL_EXPORTER_OTLP_METRICS_ENDPOINT
1.OtlpConfigUtil.PROTOCOL_HTTP_PROTOBUF
=> "http/protobuf"
2.OtlpConfigUtil.PROTOCOL_GRPC
=> "grpc"- See Also:
-
OTEL_EXPORTER_OTLP_METRICS_ENDPOINT
The Endpoint to which the metrics are exported- See Also:
-
OTEL_EXPORTER_OTLP_METRICS_HEADERS
Additional headers to pass while creating OpenTelemetry exporter- See Also:
-
OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
Aggregation Temporality selector to export only the delta or cumulate or different- See Also:
-
OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION
Default histogram aggregation to be used for all histograms: Select one of the below
1. base2_exponential_bucket_histogram
2. explicit_bucket_histogram- See Also:
-
OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION_MAX_SCALE
Max scale for base2_exponential_bucket_histogram- See Also:
-
OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION_MAX_BUCKETS
Max buckets for base2_exponential_bucket_histogram- See Also:
-
-
Method Details
-
getServiceName
-
getMetricPrefix
-
getMetricEntities
-
emitOtelMetrics
public boolean emitOtelMetrics() -
useOpenTelemetryInitializedByApplication
public boolean useOpenTelemetryInitializedByApplication() -
getOtelCustomDescriptionForHistogramMetrics
-
exportOtelMetricsToEndpoint
public boolean exportOtelMetricsToEndpoint() -
getExportOtelMetricsIntervalInSeconds
public int getExportOtelMetricsIntervalInSeconds() -
getOtelCustomDimensionsMap
-
getOtelExportProtocol
-
getOtelEndpoint
-
exportOtelMetricsToLog
public boolean exportOtelMetricsToLog() -
getOtelHeaders
-
getMetricNamingFormat
-
getOtelAggregationTemporalitySelector
public io.opentelemetry.sdk.metrics.export.AggregationTemporalitySelector getOtelAggregationTemporalitySelector() -
useOtelExponentialHistogram
public boolean useOtelExponentialHistogram() -
getOtelExponentialHistogramMaxScale
public int getOtelExponentialHistogramMaxScale() -
getOtelExponentialHistogramMaxBuckets
public int getOtelExponentialHistogramMaxBuckets() -
getOtelAdditionalMetricsReader
public io.opentelemetry.sdk.metrics.export.MetricReader getOtelAdditionalMetricsReader() -
getTehutiMetricConfig
public io.tehuti.metrics.MetricConfig getTehutiMetricConfig() -
toString
-