Interface VeniceDimensionInterface

All Known Implementing Classes:
AdminMessageProcessingComponent, AdminMessageType, ControllerRoute, HttpResponseStatusCodeCategory, HttpResponseStatusEnum, InstanceErrorType, MessageType, RejectionReason, ReplicaState, ReplicaType, RequestFanoutType, RequestRetryAbortReason, RequestRetryType, RequestType, StoreRepushTriggerSource, StreamProgress, VeniceAdaptiveThrottlerType, VeniceChunkingStatus, VeniceComputeOperationType, VeniceConsumerPoolAction, VeniceDCREvent, VeniceDCROperation, VeniceHeartbeatComponent, VeniceIngestionDestinationComponent, VeniceIngestionFailureReason, VeniceIngestionSourceComponent, VenicePartialUpdateOperation, VenicePushJobStatus, VeniceRecordType, VeniceRegionLocality, VeniceResponseStatusCategory, VeniceSystemStoreType, Version.PushType, VersionRole

public interface VeniceDimensionInterface
Every enum that should be used as a dimension for otel should implement this interface as this mandates the enum to have a dimension name and a dimension value. All such enums should add a test class that uses VeniceDimensionTestFixture to validate that the enum value count matches expected mappings, that all instances share the same dimension name, and that each instance's dimension value matches the expected value.
  • Method Details

    • getDimensionName

      VeniceMetricsDimensions getDimensionName()
      Dimension name: Returns the VeniceMetricsDimensions for the enum. All the instances of a Enum class should have the same dimension name. Ideally this could have been a static variable/method in the Enum class, but to enforce having this method via this interface, it is made as a non-static method.
    • getDimensionValue

      default String getDimensionValue()
      Dimension value: Returns the dimension value for each enum instance. Default implementation returns name().toLowerCase(), which is the convention for most dimension enums. Override only when the dimension value differs from the lowercase enum constant name (e.g., HTTP status codes, custom string mappings).

      This default relies on all implementors being enums. If this interface is ever implemented by a non-enum class, this method MUST be overridden — the default will throw ClassCastException.