MetricDescriptor.Type enum items currently specify GAUGE and COUNTER types, however their meaning does not match that of the specification.
The GAUGE enum value in this repository corresponds to specification's Non-monotonic Counters and Gauges.
The COUNTER enum value in this repository corresponds to specification's monotonic Counters and Gauges.
To avoid confusion I suggest renaming enum values to the following:
enum Type {
// Represents monotonic int64 Counter or Gauge
MONOTONIC_INT64 = 1;
// Represents monotonic double Counter or Gauge
MONOTONIC_DOUBLE = 2;
// Represents non-monotonic int64 Counter or Gauge
NONMONOTONIC_INT64 = 3;
// Represents non-monotonic double Counter or Gauge
NONMONOTONIC_DOUBLE = 4;
}
Alternatively we can have finer definition of metric type that includes 3 fields: data type, kind of the metric as defined in the spec (i.e. Counter, Gauge, Measure) and a flag indicating monotonicity of the metric:
enum Kind { Counter, Gauge, Measure };
enum DataType { Int64, Double, Histogram, Summary };
Kind kind;
DataType data_type;
bool monotonic;
Note that in this case certain combinations will be non-representable with current protobuf schema and we need to define precisely which combinations of enums and monitonicity are valid and correspond to DataPoint types for which we have defined protobuf messages.
MetricDescriptor.Type enum items currently specify GAUGE and COUNTER types, however their meaning does not match that of the specification.
The GAUGE enum value in this repository corresponds to specification's Non-monotonic Counters and Gauges.
The COUNTER enum value in this repository corresponds to specification's monotonic Counters and Gauges.
To avoid confusion I suggest renaming enum values to the following:
Alternatively we can have finer definition of metric type that includes 3 fields: data type, kind of the metric as defined in the spec (i.e. Counter, Gauge, Measure) and a flag indicating monotonicity of the metric:
Note that in this case certain combinations will be non-representable with current protobuf schema and we need to define precisely which combinations of enums and monitonicity are valid and correspond to DataPoint types for which we have defined protobuf messages.