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

Deprecate old explicit bounds, add message for explicit bounds #255

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
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
55 changes: 23 additions & 32 deletions opentelemetry/proto/metrics/v1/metrics.proto
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,23 @@ message DoubleDataPoint {
repeated DoubleExemplar exemplars = 5;
}

// ExplicitBounds specifies buckets with explicitly defined bounds for values.
// The bucket boundaries are described by "bounds" field.
message ExplicitBounds {
// This defines size(bounds) + 1 (= N) buckets. The boundaries for bucket
// at index i are:
//
// (-infinity, bounds[i]) for i == 0
// [bounds[i-1], bounds[i]) for 0 < i < N-1
// [bounds[i], +infinity) for i == N-1
// The values in bounds array must be strictly increasing.
//
// Note: only [a, b) intervals are currently supported for each bucket except the first one.
// If we decide to also support (a, b] intervals we should add support for these by defining
// a boolean value which decides what type of intervals to use.
repeated double explicit_bounds = 7;
}

// IntHistogramDataPoint is a single data point in a timeseries that describes
// the time-varying values of a Histogram of int values. A Histogram contains
// summary statistics for a population of values, it may optionally contain
Expand Down Expand Up @@ -420,24 +437,11 @@ message IntHistogramDataPoint {
// Otherwise all option fields and "buckets" field must be omitted in which case the
// distribution of values in the histogram is unknown and only the total count and sum are known.

repeated double deprecated_explicit_bounds = 7 [deprecated=true];

// explicit_bounds is the only supported bucket option currently.
// TODO: Add more bucket options.

// explicit_bounds specifies buckets with explicitly defined bounds for values.
// The bucket boundaries are described by "bounds" field.
//
// This defines size(bounds) + 1 (= N) buckets. The boundaries for bucket
// at index i are:
//
// (-infinity, bounds[i]) for i == 0
// [bounds[i-1], bounds[i]) for 0 < i < N-1
// [bounds[i], +infinity) for i == N-1
// The values in bounds array must be strictly increasing.
//
// Note: only [a, b) intervals are currently supported for each bucket except the first one.
// If we decide to also support (a, b] intervals we should add support for these by defining
// a boolean value which decides what type of intervals to use.
repeated double explicit_bounds = 7;
ExplicitBounds explicit_bounds = 9;

// (Optional) List of exemplars collected from
// measurements that were used to form the data point
Expand Down Expand Up @@ -496,24 +500,11 @@ message DoubleHistogramDataPoint {
// Otherwise all option fields and "buckets" field must be omitted in which case the
// distribution of values in the histogram is unknown and only the total count and sum are known.

repeated double deprecated_explicit_bounds = 7 [deprecated=true];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For my own understanding, we're not supporting JSON compatibility yet, so this kind of deprecation (with an immediate rename) is ok?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will also break Collector's build because the field name is used in the codebase, but that's acceptable for now.
What's probably more important is that once we update Collector translation code to use the new explicit_bounds field we are going to break semantic compatibility with existing senders / receivers. (Alternatively, we can look at the deprecated field as well, but not sure if we want to do that).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am deprecating the field and plan to accept it in the receiver and translate it into the new format

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this answered my question. Can we rename here? Does this break a JSON implementation?

I understand from a PROTO standpoint, this isn't breaking, but this would break text-based version (IIUC). Do we not have text-based usage yet so only proto matters?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does break JSON. This is acceptable, since JSON is currently declared Alpha: https://github.com/open-telemetry/opentelemetry-proto#maturity-level and we allow breaking changes while in Alpha.


// explicit_bounds is the only supported bucket option currently.
// TODO: Add more bucket options.

// explicit_bounds specifies buckets with explicitly defined bounds for values.
// The bucket boundaries are described by "bounds" field.
//
// This defines size(bounds) + 1 (= N) buckets. The boundaries for bucket
// at index i are:
//
// (-infinity, bounds[i]) for i == 0
// [bounds[i-1], bounds[i]) for 0 < i < N-1
// [bounds[i], +infinity) for i == N-1
// The values in bounds array must be strictly increasing.
//
// Note: only [a, b) intervals are currently supported for each bucket except the first one.
// If we decide to also support (a, b] intervals we should add support for these by defining
// a boolean value which decides what type of intervals to use.
repeated double explicit_bounds = 7;
ExplicitBounds explicit_bounds = 9;

// (Optional) List of exemplars collected from
// measurements that were used to form the data point
Expand Down