Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add gauge subtype for prometheus unknown type #496

Closed
wants to merge 6 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions opentelemetry/proto/metrics/v1/metrics.proto
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,15 @@ message Metric {
// "StartTimeUnixNano" is ignored for all data points.
message Gauge {
repeated NumberDataPoint data_points = 1;

// type provides additional type information for gauges.
//
// When receiving from older producers of OTLP, it is safe to assume the
// zero-value for type, GAUGE_TYPE_STANDARD. When sending OTLP to older
// consumers, it is safe for them to ignore the field. In both cases, the
// previous behavior without type is maintained until producer and
// consumer are aware of the field.
GaugeType type = 2;
}

// Sum represents the type of a scalar metric that is calculated as a sum of all
Expand Down Expand Up @@ -337,6 +346,24 @@ enum DataPointFlags {
// Bits 2-31 are reserved for future use.
}

// GaugeType defines valid gauge "sub-types", which are used to describe
// gauges which have additional properties. These types generally apply
// to metrics which originate from protocols which support these additional
// types, but are represented as gauges in OTLP.
enum GaugeType {
// GAUGE_TYPE_STANDARD is the default GaugeType, which represents a standard
// gauge. Since the OpenTelemetry API enforces types, this type is used for
// all metrics from OpenTelemetry instrumentation.
GAUGE_TYPE_STANDARD = 0;

// GAUGE_TYPE_UNKNOWN is a GaugeType which represents a metric for which the
// real type is not known, but is treated as a Gauge, such as a Prometheus
// metric without a TYPE comment. For example, the metric may be a
// monotonically-increasing sum, or histogram, but type information was not
// included at the source.
GAUGE_TYPE_UNKNOWN = 1;
}

// NumberDataPoint is a single data point in a timeseries that describes the
// time-varying scalar value of a metric.
message NumberDataPoint {
Expand Down
Loading