Skip to content

Commit

Permalink
update links to openmetrics to reference the v1.0.0 release
Browse files Browse the repository at this point in the history
Signed-off-by: David Ashpole <[email protected]>
  • Loading branch information
dashpole committed Dec 16, 2024
1 parent b5abea9 commit 6cfc844
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions docs/metrics/extend/customresourcestate-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,13 @@ The above configuration was tested on [this](https://github.com/kubernetes/autos

### Metric types

The configuration supports three kind of metrics from the [OpenMetrics specification](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md).
The configuration supports three kind of metrics from the [OpenMetrics specification](https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md).

The metric type is specified by the `type` field and its specific configuration at the types specific struct.

#### Gauge

> Gauges are current measurements, such as bytes of memory currently used or the number of items in a queue. For gauges the absolute value is what is of interest to a user. [[0]](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#gauge)
> Gauges are current measurements, such as bytes of memory currently used or the number of items in a queue. For gauges the absolute value is what is of interest to a user. [[0]](https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#gauge)

Example:

Expand Down Expand Up @@ -386,7 +386,7 @@ kube_customresource_foo_status{customresource_group="myteam.io", customresource_

#### StateSet

> StateSets represent a series of related boolean values, also called a bitset. If ENUMs need to be encoded this MAY be done via StateSet. [[1]](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#stateset)
> StateSets represent a series of related boolean values, also called a bitset. If ENUMs need to be encoded this MAY be done via StateSet. [[1]](https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#stateset)

```yaml
kind: CustomResourceStateMetrics
Expand Down Expand Up @@ -420,7 +420,7 @@ kube_customresource_status_phase{customresource_group="myteam.io", customresourc

#### Info

> Info metrics are used to expose textual information which SHOULD NOT change during process lifetime. Common examples are an application's version, revision control commit, and the version of a compiler. [[2]](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#info)
> Info metrics are used to expose textual information which SHOULD NOT change during process lifetime. Common examples are an application's version, revision control commit, and the version of a compiler. [[2]](https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#info)

Metrics of type `Info` will always have a value of 1.

Expand Down
6 changes: 3 additions & 3 deletions pkg/customresourcestate/config_metrics_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type MetricMeta struct {
}

// MetricGauge targets a Path that may be a single value, array, or object. Arrays and objects will generate a metric per element.
// Ref: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#gauge
// Ref: https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#gauge
type MetricGauge struct {
// LabelFromKey adds a label with the given name if Path is an object. The label value will be the object key.
LabelFromKey string `yaml:"labelFromKey" json:"labelFromKey"`
Expand All @@ -38,15 +38,15 @@ type MetricGauge struct {
}

// MetricInfo is a metric which is used to expose textual information.
// Ref: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#info
// Ref: https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#info
type MetricInfo struct {
// LabelFromKey adds a label with the given name if Path is an object. The label value will be the object key.
LabelFromKey string `yaml:"labelFromKey" json:"labelFromKey"`
MetricMeta `yaml:",inline" json:",inline"`
}

// MetricStateSet is a metric which represent a series of related boolean values, also called a bitset.
// Ref: https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#stateset
// Ref: https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#stateset
type MetricStateSet struct {
MetricMeta `yaml:",inline" json:",inline"`

Expand Down
2 changes: 1 addition & 1 deletion pkg/metric/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var (
}
)

// Type represents the type of the metric. See https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#metric-types.
// Type represents the type of the metric. See https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#metric-types.
type Type string

// Supported metric types.
Expand Down

0 comments on commit 6cfc844

Please sign in to comment.