Skip to content

Commit

Permalink
Fix code review and add CHANGELOG
Browse files Browse the repository at this point in the history
  • Loading branch information
tony612 committed Sep 23, 2022
1 parent ea29dce commit 6987f73
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -8,6 +8,10 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm

## [Unreleased]

### Added

- Added an example of using metric views to customize instruments. (#3177)

## [0.32.1] Metric SDK (Alpha) - 2022-09-22

### Changed
Expand Down
2 changes: 1 addition & 1 deletion example/view/doc.go
Expand Up @@ -12,5 +12,5 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package main provides a code sample of using view to custom instruments.
// Package main provides a code sample of using metric views to customize instruments.
package main
6 changes: 3 additions & 3 deletions example/view/go.mod
@@ -1,14 +1,14 @@
module go.opentelemetry.io/otel/example/prometheus
module go.opentelemetry.io/otel/example/view

go 1.18

require (
github.com/prometheus/client_golang v1.13.0
go.opentelemetry.io/otel v1.10.0
go.opentelemetry.io/otel/exporters/prometheus v0.31.0
go.opentelemetry.io/otel/metric v0.32.0
go.opentelemetry.io/otel/metric v0.32.1
go.opentelemetry.io/otel/sdk v1.10.0
go.opentelemetry.io/otel/sdk/metric v0.32.0
go.opentelemetry.io/otel/sdk/metric v0.32.1
)

require (
Expand Down
8 changes: 2 additions & 6 deletions example/view/main.go
Expand Up @@ -12,9 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.

//go:build go1.18
// +build go1.18

package main

import (
Expand Down Expand Up @@ -42,14 +39,13 @@ const meterName = "github.com/open-telemetry/opentelemetry-go/example/view"
func main() {
ctx := context.Background()

// The exporter embeds a default OpenTelemetry Reader, allowing it to be used in WithReader
// The exporter embeds a default OpenTelemetry Reader, allowing it to be used in WithReader.
exporter := otelprom.New()

// View to customize histogram
// View to customize histogram buckets and rename a single histogram instrument.
customBucketsView, err := view.New(
// Match* to match instruments
view.MatchInstrumentName("custom_histogram"),
view.MatchInstrumentKind(view.SyncHistogram),
view.MatchInstrumentationScope(instrumentation.Scope{Name: meterName}),

// With* to modify instruments
Expand Down

0 comments on commit 6987f73

Please sign in to comment.