Class VeniceMetricsConfig


  • public class VeniceMetricsConfig
    extends java.lang.Object
    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.
    • Field Detail

      • OTEL_VENICE_METRICS_ENABLED

        public static final java.lang.String OTEL_VENICE_METRICS_ENABLED
        Config to enable OpenTelemetry metrics
        See Also:
        Constant Field Values
      • OTEL_VENICE_METRICS_PREFIX

        public static final java.lang.String OTEL_VENICE_METRICS_PREFIX
        Config to set the metric prefix for OpenTelemetry metrics
        See Also:
        Constant Field Values
      • OTEL_VENICE_METRICS_EXPORT_TO_LOG

        public static final java.lang.String OTEL_VENICE_METRICS_EXPORT_TO_LOG
        Export opentelemetry metrics to a log exporter VeniceOpenTelemetryMetricsRepository.LogBasedMetricExporter
        See Also:
        Constant Field Values
      • OTEL_VENICE_METRICS_CUSTOM_DIMENSIONS_MAP

        public static final java.lang.String 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:
        Constant Field Values
      • OTEL_EXPORTER_OTLP_METRICS_PROTOCOL

        public static final java.lang.String OTEL_EXPORTER_OTLP_METRICS_PROTOCOL
        Protocol over which the metrics are exported to OTEL_EXPORTER_OTLP_METRICS_ENDPOINT
        1. OtlpConfigUtil.PROTOCOL_HTTP_PROTOBUF => "http/protobuf"
        2. OtlpConfigUtil.PROTOCOL_GRPC => "grpc"
        See Also:
        Constant Field Values
      • OTEL_EXPORTER_OTLP_METRICS_ENDPOINT

        public static final java.lang.String OTEL_EXPORTER_OTLP_METRICS_ENDPOINT
        The Endpoint to which the metrics are exported
        See Also:
        Constant Field Values
      • OTEL_EXPORTER_OTLP_METRICS_HEADERS

        public static final java.lang.String OTEL_EXPORTER_OTLP_METRICS_HEADERS
        Additional headers to pass while creating OpenTelemetry exporter
        See Also:
        Constant Field Values
      • OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE

        public static final java.lang.String OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE
        Aggregation Temporality selector to export only the delta or cumulate or different
        See Also:
        Constant Field Values
      • OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION

        public static final java.lang.String 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:
        Constant Field Values
      • OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION_MAX_SCALE

        public static final java.lang.String OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION_MAX_SCALE
        Max scale for base2_exponential_bucket_histogram
        See Also:
        Constant Field Values
      • OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION_MAX_BUCKETS

        public static final java.lang.String OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION_MAX_BUCKETS
        Max buckets for base2_exponential_bucket_histogram
        See Also:
        Constant Field Values
    • Method Detail

      • getServiceName

        public java.lang.String getServiceName()
      • getMetricPrefix

        public java.lang.String getMetricPrefix()
      • getMetricEntities

        public java.util.Collection<MetricEntity> getMetricEntities()
      • emitOtelMetrics

        public boolean emitOtelMetrics()
      • exportOtelMetricsToEndpoint

        public boolean exportOtelMetricsToEndpoint()
      • getOtelCustomDimensionsMap

        public java.util.Map<java.lang.String,​java.lang.String> getOtelCustomDimensionsMap()
      • getOtelExportProtocol

        public java.lang.String getOtelExportProtocol()
      • getOtelEndpoint

        public java.lang.String getOtelEndpoint()
      • exportOtelMetricsToLog

        public boolean exportOtelMetricsToLog()
      • getOtelHeaders

        public java.util.Map<java.lang.String,​java.lang.String> getOtelHeaders()
      • getOtelAggregationTemporalitySelector

        public io.opentelemetry.sdk.metrics.export.AggregationTemporalitySelector getOtelAggregationTemporalitySelector()
      • useOtelExponentialHistogram

        public boolean useOtelExponentialHistogram()
      • getOtelExponentialHistogramMaxScale

        public int getOtelExponentialHistogramMaxScale()
      • getOtelExponentialHistogramMaxBuckets

        public int getOtelExponentialHistogramMaxBuckets()
      • getTehutiMetricConfig

        public io.tehuti.metrics.MetricConfig getTehutiMetricConfig()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object