Skip to content

Commit

Permalink
fix for reviews
Browse files Browse the repository at this point in the history
Signed-off-by: Ziqi Zhao <zhaoziqi9146@gmail.com>
  • Loading branch information
fatsheep9146 committed Oct 19, 2022
1 parent a5164db commit 8041c7b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
6 changes: 1 addition & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
### Added

- Add trace context propagation support to `instrumentation/github.com/aws/aws-sdk-go-v2/otelaws` (#2856).
- [otelgrpc] add metric `rpc.server.duration` to otelgrpc instrumentation library. (#2700)
- [otelgrpc] Add `WithMeterProvider` function to enable metric and add metric `rpc.server.duration` to otelgrpc instrumentation library. (#2700)

## [1.11.0/0.36.3/0.5.1]

Expand All @@ -32,10 +32,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- The `Inject` function in `go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc` is deprecated. (#2838)
- The `Extract` function in `go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc` is deprecated. (#2838)

### Added

- [otelgrpc] Add `WithMeterProvider` function to enable metric and add metric `rpc.server.duration` to otelgrpc instrumentation library. (#2700)

## [0.36.1]

### Changed
Expand Down
2 changes: 1 addition & 1 deletion instrumentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ The following instrumentation packages are provided for popular Go packages and
| [github.com/labstack/echo](./github.com/labstack/echo/otelecho) | ||
| [github.com/Shopify/sarama](./github.com/Shopify/sarama/otelsarama) | ||
| [go.mongodb.org/mongo-driver](./go.mongodb.org/mongo-driver/mongo/otelmongo) | ||
| [google.golang.org/grpc](./google.golang.org/grpc/otelgrpc) | ||
| [google.golang.org/grpc](./google.golang.org/grpc/otelgrpc) | ||
| [gopkg.in/macaron.v1](./gopkg.in/macaron.v1/otelmacaron) | ||
| [host](./host) || |
| [net/http](./net/http/otelhttp) |||
Expand Down
5 changes: 3 additions & 2 deletions instrumentation/google.golang.org/grpc/otelgrpc/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ import (
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/metric"
"go.opentelemetry.io/otel/metric/global"
"go.opentelemetry.io/otel/metric/instrument"
"go.opentelemetry.io/otel/metric/instrument/syncint64"
"go.opentelemetry.io/otel/metric/unit"
"go.opentelemetry.io/otel/propagation"
semconv "go.opentelemetry.io/otel/semconv/v1.12.0"
"go.opentelemetry.io/otel/trace"
Expand Down Expand Up @@ -70,8 +72,7 @@ func newConfig(opts []Option) *config {
metric.WithSchemaURL(semconv.SchemaURL),
)
var err error
// the unit of rpc.server.duration is milliseconds
if c.rpcServerDuration, err = c.meter.SyncInt64().Histogram("rpc.server.duration"); err != nil {
if c.rpcServerDuration, err = c.meter.SyncInt64().Histogram("rpc.server.duration", instrument.WithUnit(unit.Milliseconds)); err != nil {
otel.Handle(err)
}

Expand Down

0 comments on commit 8041c7b

Please sign in to comment.