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 48fb36f commit 23856c7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 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.0] Revised Metric SDK (Alpha) - 2022-09-18

### 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
2 changes: 1 addition & 1 deletion example/view/go.mod
@@ -1,4 +1,4 @@
module go.opentelemetry.io/otel/example/prometheus
module go.opentelemetry.io/otel/example/view

go 1.18

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 23856c7

Please sign in to comment.