Skip to content

Commit

Permalink
Deprecate the sdk/metric/view package (#3476)
Browse files Browse the repository at this point in the history
* Deprecate the sdk/metric/view package

* Add deprecation to changelog
  • Loading branch information
MrAlias committed Nov 21, 2022
1 parent dbf960c commit c4333a9
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 0 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -53,6 +53,11 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Do not report empty partial-success responses in the `go.opentelemetry.io/otel/exporters/otlp` exporters. (#3438, #3432)
- Handle partial success responses in `go.opentelemetry.io/otel/exporters/otlp/otlpmetric` exporters. (#3162, #3440)

### Deprecated

- The `go.opentelemetry.io/otel/sdk/metric/view` package is deprecated.
Use `Instrument`, `InstrumentKind`, `View`, and `NewView` in `go.opentelemetry.io/otel/sdk/metric` instead. (#3476)

## [1.11.1/0.33.0] 2022-10-19

### Added
Expand Down
3 changes: 3 additions & 0 deletions sdk/metric/view/doc.go
Expand Up @@ -17,4 +17,7 @@
// registered with a MeterProvider in the go.opentelemetry.io/otel/sdk/metric
// package. See the WithReader option in that package for more information on
// how this registration takes place.
//
// Deprecated: Use Instrument, InstrumentKind, View, and NewView in
// go.opentelemetry.io/otel/sdk/metric instead.
package view // import "go.opentelemetry.io/otel/sdk/metric/view"
2 changes: 2 additions & 0 deletions sdk/metric/view/instrument.go
Expand Up @@ -20,6 +20,8 @@ import (
)

// Instrument uniquely identifies an instrument within a meter.
//
// Deprecated: Use Instrument in go.opentelemetry.io/otel/sdk/metric instead.
type Instrument struct {
Scope instrumentation.Scope

Expand Down
21 changes: 21 additions & 0 deletions sdk/metric/view/instrumentkind.go
Expand Up @@ -15,6 +15,9 @@
package view // import "go.opentelemetry.io/otel/sdk/metric/view"

// InstrumentKind describes the kind of instrument a Meter can create.
//
// Deprecated: Use InstrumentKind in go.opentelemetry.io/otel/sdk/metric
// instead.
type InstrumentKind uint8

// These are all the instrument kinds supported by the SDK.
Expand All @@ -24,20 +27,38 @@ const (
undefinedInstrument InstrumentKind = iota
// SyncCounter is an instrument kind that records increasing values
// synchronously in application code.
//
// Deprecated: Use InstrumentKindSyncCounter in
// go.opentelemetry.io/otel/sdk/metric instead.
SyncCounter
// SyncUpDownCounter is an instrument kind that records increasing and
// decreasing values synchronously in application code.
//
// Deprecated: Use InstrumentKindSyncUpDownCounter in
// go.opentelemetry.io/otel/sdk/metric instead.
SyncUpDownCounter
// SyncHistogram is an instrument kind that records a distribution of
// values synchronously in application code.
//
// Deprecated: Use InstrumentKindSyncHistogram in
// go.opentelemetry.io/otel/sdk/metric instead.
SyncHistogram
// AsyncCounter is an instrument kind that records increasing values in an
// asynchronous callback.
//
// Deprecated: Use InstrumentKindAsyncCounter in
// go.opentelemetry.io/otel/sdk/metric instead.
AsyncCounter
// AsyncUpDownCounter is an instrument kind that records increasing and
// decreasing values in an asynchronous callback.
//
// Deprecated: Use InstrumentKindAsyncUpDownCounter in
// go.opentelemetry.io/otel/sdk/metric instead.
AsyncUpDownCounter
// AsyncGauge is an instrument kind that records current values in an
// asynchronous callback.
//
// Deprecated: Use InstrumentKindAsyncGauge in
// go.opentelemetry.io/otel/sdk/metric instead.
AsyncGauge
)
4 changes: 4 additions & 0 deletions sdk/metric/view/view.go
Expand Up @@ -31,6 +31,8 @@ import (
// reported by Instruments.
//
// An empty View will match all instruments, and do no transformations.
//
// Deprecated: Use View in go.opentelemetry.io/otel/sdk/metric instead.
type View struct {
instrumentName *regexp.Regexp
hasWildcard bool
Expand All @@ -48,6 +50,8 @@ type View struct {
// Options are all applied to the View. An instrument needs to match all of
// the match Options passed for the View to be applied to it. Similarly, all
// transform operation Options are applied to matched Instruments.
//
// Deprecated: Use NewView in go.opentelemetry.io/otel/sdk/metric instead.
func New(opts ...Option) (View, error) {
v := View{}

Expand Down

0 comments on commit c4333a9

Please sign in to comment.