type Counter … var _ … var _ … type exemplarCounterMetric … // NewCounter returns an object which satisfies the kubeCollector and CounterMetric interfaces. // However, the object returned will not measure anything unless the collector is first // registered, since the metric is lazily instantiated. func NewCounter(opts *CounterOpts) *Counter { … } func (c *Counter) Desc() *prometheus.Desc { … } func (c *Counter) Write(to *dto.Metric) error { … } // Reset resets the underlying prometheus Counter to start counting from 0 again func (c *Counter) Reset() { … } // setPrometheusCounter sets the underlying CounterMetric object, i.e. the thing that does the measurement. func (c *Counter) setPrometheusCounter(counter prometheus.Counter) { … } // DeprecatedVersion returns a pointer to the Version or nil func (c *Counter) DeprecatedVersion() *semver.Version { … } // initializeMetric invocation creates the actual underlying Counter. Until this method is called // the underlying counter is a no-op. func (c *Counter) initializeMetric() { … } // initializeDeprecatedMetric invocation creates the actual (but deprecated) Counter. Until this method // is called the underlying counter is a no-op. func (c *Counter) initializeDeprecatedMetric() { … } // WithContext allows the normal Counter metric to pass in context. func (c *Counter) WithContext(ctx context.Context) CounterMetric { … } // withExemplar initializes the exemplarMetric object and sets the exemplar value. func (c *Counter) withExemplar(v float64) { … } func (c *Counter) Add(v float64) { … } func (c *Counter) Inc() { … } // withExemplar attaches an exemplar to the metric. func (e *exemplarCounterMetric) withExemplar(v float64) { … } type CounterVec … var _ … // NewCounterVec returns an object which satisfies the kubeCollector and (almost) CounterVecMetric interfaces. // However, the object returned will not measure anything unless the collector is first // registered, since the metric is lazily instantiated, and only members extracted after // registration will actually measure anything. func NewCounterVec(opts *CounterOpts, labels []string) *CounterVec { … } // DeprecatedVersion returns a pointer to the Version or nil func (v *CounterVec) DeprecatedVersion() *semver.Version { … } // initializeMetric invocation creates the actual underlying CounterVec. Until this method is called // the underlying counterVec is a no-op. func (v *CounterVec) initializeMetric() { … } // initializeDeprecatedMetric invocation creates the actual (but deprecated) CounterVec. Until this method is called // the underlying counterVec is a no-op. func (v *CounterVec) initializeDeprecatedMetric() { … } // WithLabelValues returns the Counter for the given slice of label // values (same order as the VariableLabels in Desc). If that combination of // label values is accessed for the first time, a new Counter is created IFF the counterVec // has been registered to a metrics registry. func (v *CounterVec) WithLabelValues(lvs ...string) CounterMetric { … } // With returns the Counter for the given Labels map (the label names // must match those of the VariableLabels in Desc). If that label map is // accessed for the first time, a new Counter is created IFF the counterVec has // been registered to a metrics registry. func (v *CounterVec) With(labels map[string]string) CounterMetric { … } // Delete deletes the metric where the variable labels are the same as those // passed in as labels. It returns true if a metric was deleted. // // It is not an error if the number and names of the Labels are inconsistent // with those of the VariableLabels in Desc. However, such inconsistent Labels // can never match an actual metric, so the method will always return false in // that case. func (v *CounterVec) Delete(labels map[string]string) bool { … } // Reset deletes all metrics in this vector. func (v *CounterVec) Reset() { … } // WithContext returns wrapped CounterVec with context func (v *CounterVec) WithContext(ctx context.Context) *CounterVecWithContext { … } type CounterVecWithContext … // WithLabelValues is the wrapper of CounterVec.WithLabelValues. func (vc *CounterVecWithContext) WithLabelValues(lvs ...string) CounterMetric { … } // With is the wrapper of CounterVec.With. func (vc *CounterVecWithContext) With(labels map[string]string) CounterMetric { … }