Documentation ¶
Index ¶
- Variables
- type Metrics
- func (*Metrics) Descriptor() ([]byte, []int)deprecated
- func (x *Metrics) GetEnabled() bool
- func (x *Metrics) GetSupportedMetrics() []string
- func (x *Metrics) GetUserMetrics() []*UserMetric
- func (*Metrics) ProtoMessage()
- func (x *Metrics) ProtoReflect() protoreflect.Message
- func (x *Metrics) Reset()
- func (x *Metrics) String() string
- func (m *Metrics) Validate() error
- func (m *Metrics) ValidateAll() error
- type MetricsMultiError
- type MetricsValidationError
- type UserMetric
- func (*UserMetric) Descriptor() ([]byte, []int)deprecated
- func (x *UserMetric) GetContext() string
- func (x *UserMetric) GetDescription() string
- func (x *UserMetric) GetLabels() map[string]string
- func (x *UserMetric) GetMetadata() map[string]string
- func (x *UserMetric) GetName() string
- func (x *UserMetric) GetTimestamp() *timestamppb.Timestamp
- func (x *UserMetric) GetType() UserMetric_MetricType
- func (x *UserMetric) GetUnit() string
- func (x *UserMetric) GetValue() float64
- func (*UserMetric) ProtoMessage()
- func (x *UserMetric) ProtoReflect() protoreflect.Message
- func (x *UserMetric) Reset()
- func (x *UserMetric) String() string
- func (m *UserMetric) Validate() error
- func (m *UserMetric) ValidateAll() error
- type UserMetricMultiError
- type UserMetricValidationError
- type UserMetric_MetricType
- func (UserMetric_MetricType) Descriptor() protoreflect.EnumDescriptor
- func (x UserMetric_MetricType) Enum() *UserMetric_MetricType
- func (UserMetric_MetricType) EnumDescriptor() ([]byte, []int)deprecated
- func (x UserMetric_MetricType) Number() protoreflect.EnumNumber
- func (x UserMetric_MetricType) String() string
- func (UserMetric_MetricType) Type() protoreflect.EnumType
Constants ¶
This section is empty.
Variables ¶
var ( UserMetric_MetricType_name = map[int32]string{ 0: "METRIC_TYPE_UNSPECIFIED", 1: "METRIC_TYPE_COUNTER", 2: "METRIC_TYPE_GAUGE", 3: "METRIC_TYPE_HISTOGRAM", 4: "METRIC_TYPE_SUMMARY", } UserMetric_MetricType_value = map[string]int32{ "METRIC_TYPE_UNSPECIFIED": 0, "METRIC_TYPE_COUNTER": 1, "METRIC_TYPE_GAUGE": 2, "METRIC_TYPE_HISTOGRAM": 3, "METRIC_TYPE_SUMMARY": 4, } )
Enum value maps for UserMetric_MetricType.
var File_middleware_metrics_v1_metrics_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Metrics ¶
type Metrics struct { Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` // Add a list of supported metrics for enabling or disabling specific metrics SupportedMetrics []string `protobuf:"bytes,5,rep,name=supported_metrics,proto3" json:"supported_metrics,omitempty"` // Repeated field for user-defined metrics UserMetrics []*UserMetric `protobuf:"bytes,6,rep,name=user_metrics,proto3" json:"user_metrics,omitempty"` // contains filtered or unexported fields }
Metrics
func (*Metrics) Descriptor
deprecated
func (*Metrics) GetEnabled ¶
func (*Metrics) GetSupportedMetrics ¶
func (*Metrics) GetUserMetrics ¶
func (x *Metrics) GetUserMetrics() []*UserMetric
func (*Metrics) ProtoMessage ¶
func (*Metrics) ProtoMessage()
func (*Metrics) ProtoReflect ¶
func (x *Metrics) ProtoReflect() protoreflect.Message
func (*Metrics) Validate ¶
Validate checks the field values on Metrics with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Metrics) ValidateAll ¶
ValidateAll checks the field values on Metrics with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in MetricsMultiError, or nil if none found.
type MetricsMultiError ¶
type MetricsMultiError []error
MetricsMultiError is an error wrapping multiple validation errors returned by Metrics.ValidateAll() if the designated constraints aren't met.
func (MetricsMultiError) AllErrors ¶
func (m MetricsMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (MetricsMultiError) Error ¶
func (m MetricsMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type MetricsValidationError ¶
type MetricsValidationError struct {
// contains filtered or unexported fields
}
MetricsValidationError is the validation error returned by Metrics.Validate if the designated constraints aren't met.
func (MetricsValidationError) Cause ¶
func (e MetricsValidationError) Cause() error
Cause function returns cause value.
func (MetricsValidationError) Error ¶
func (e MetricsValidationError) Error() string
Error satisfies the builtin error interface
func (MetricsValidationError) ErrorName ¶
func (e MetricsValidationError) ErrorName() string
ErrorName returns error name.
func (MetricsValidationError) Field ¶
func (e MetricsValidationError) Field() string
Field function returns field value.
func (MetricsValidationError) Key ¶
func (e MetricsValidationError) Key() bool
Key function returns key value.
func (MetricsValidationError) Reason ¶
func (e MetricsValidationError) Reason() string
Reason function returns reason value.
type UserMetric ¶
type UserMetric struct { // Timestamp: indicates the time of indicator data Timestamp *timestamppb.Timestamp `protobuf:"bytes,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"` // Indicator name Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` // Indicator value Value float64 `protobuf:"fixed64,3,opt,name=value,proto3" json:"value,omitempty"` // Indicator label for classification or filtering Labels map[string]string `` /* 153-byte string literal not displayed */ // Indicator unit Unit string `protobuf:"bytes,5,opt,name=unit,proto3" json:"unit,omitempty"` Type UserMetric_MetricType `protobuf:"varint,6,opt,name=type,proto3,enum=middleware.metrics.v1.UserMetric_MetricType" json:"type,omitempty"` // Description of indicators Description string `protobuf:"bytes,7,opt,name=description,proto3" json:"description,omitempty"` // Indicator context information Context string `protobuf:"bytes,8,opt,name=context,proto3" json:"context,omitempty"` // Additional information for metrics that can be used to store arbitrary metadata Metadata map[string]string `` /* 157-byte string literal not displayed */ // contains filtered or unexported fields }
func (*UserMetric) Descriptor
deprecated
func (*UserMetric) Descriptor() ([]byte, []int)
Deprecated: Use UserMetric.ProtoReflect.Descriptor instead.
func (*UserMetric) GetContext ¶
func (x *UserMetric) GetContext() string
func (*UserMetric) GetDescription ¶
func (x *UserMetric) GetDescription() string
func (*UserMetric) GetLabels ¶
func (x *UserMetric) GetLabels() map[string]string
func (*UserMetric) GetMetadata ¶
func (x *UserMetric) GetMetadata() map[string]string
func (*UserMetric) GetName ¶
func (x *UserMetric) GetName() string
func (*UserMetric) GetTimestamp ¶
func (x *UserMetric) GetTimestamp() *timestamppb.Timestamp
func (*UserMetric) GetType ¶
func (x *UserMetric) GetType() UserMetric_MetricType
func (*UserMetric) GetUnit ¶
func (x *UserMetric) GetUnit() string
func (*UserMetric) GetValue ¶
func (x *UserMetric) GetValue() float64
func (*UserMetric) ProtoMessage ¶
func (*UserMetric) ProtoMessage()
func (*UserMetric) ProtoReflect ¶
func (x *UserMetric) ProtoReflect() protoreflect.Message
func (*UserMetric) Reset ¶
func (x *UserMetric) Reset()
func (*UserMetric) String ¶
func (x *UserMetric) String() string
func (*UserMetric) Validate ¶
func (m *UserMetric) Validate() error
Validate checks the field values on UserMetric with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*UserMetric) ValidateAll ¶
func (m *UserMetric) ValidateAll() error
ValidateAll checks the field values on UserMetric with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in UserMetricMultiError, or nil if none found.
type UserMetricMultiError ¶
type UserMetricMultiError []error
UserMetricMultiError is an error wrapping multiple validation errors returned by UserMetric.ValidateAll() if the designated constraints aren't met.
func (UserMetricMultiError) AllErrors ¶
func (m UserMetricMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (UserMetricMultiError) Error ¶
func (m UserMetricMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type UserMetricValidationError ¶
type UserMetricValidationError struct {
// contains filtered or unexported fields
}
UserMetricValidationError is the validation error returned by UserMetric.Validate if the designated constraints aren't met.
func (UserMetricValidationError) Cause ¶
func (e UserMetricValidationError) Cause() error
Cause function returns cause value.
func (UserMetricValidationError) Error ¶
func (e UserMetricValidationError) Error() string
Error satisfies the builtin error interface
func (UserMetricValidationError) ErrorName ¶
func (e UserMetricValidationError) ErrorName() string
ErrorName returns error name.
func (UserMetricValidationError) Field ¶
func (e UserMetricValidationError) Field() string
Field function returns field value.
func (UserMetricValidationError) Key ¶
func (e UserMetricValidationError) Key() bool
Key function returns key value.
func (UserMetricValidationError) Reason ¶
func (e UserMetricValidationError) Reason() string
Reason function returns reason value.
type UserMetric_MetricType ¶
type UserMetric_MetricType int32
Type of indicator (e.g. counter, timer, histogram, etc.)
const ( UserMetric_METRIC_TYPE_UNSPECIFIED UserMetric_MetricType = 0 UserMetric_METRIC_TYPE_COUNTER UserMetric_MetricType = 1 UserMetric_METRIC_TYPE_GAUGE UserMetric_MetricType = 2 UserMetric_METRIC_TYPE_HISTOGRAM UserMetric_MetricType = 3 UserMetric_METRIC_TYPE_SUMMARY UserMetric_MetricType = 4 )
func (UserMetric_MetricType) Descriptor ¶
func (UserMetric_MetricType) Descriptor() protoreflect.EnumDescriptor
func (UserMetric_MetricType) Enum ¶
func (x UserMetric_MetricType) Enum() *UserMetric_MetricType
func (UserMetric_MetricType) EnumDescriptor
deprecated
func (UserMetric_MetricType) EnumDescriptor() ([]byte, []int)
Deprecated: Use UserMetric_MetricType.Descriptor instead.
func (UserMetric_MetricType) Number ¶
func (x UserMetric_MetricType) Number() protoreflect.EnumNumber
func (UserMetric_MetricType) String ¶
func (x UserMetric_MetricType) String() string
func (UserMetric_MetricType) Type ¶
func (UserMetric_MetricType) Type() protoreflect.EnumType