Skip to content

Commit

Permalink
Remove unneeded inst rename views for otelgocql (#2960)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Nov 3, 2022
1 parent 4fe9de8 commit 5fd652a
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions instrumentation/github.com/gocql/gocql/otelgocql/example/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,21 +128,8 @@ func main() {

func views() ([]view.View, error) {
var vs []view.View
// TODO: Remove renames when the Prometheus exporter natively supports
// metric instrument name sanitation
// (https://github.com/open-telemetry/opentelemetry-go/issues/3183).
v, err := view.New(
view.MatchInstrumentName("db.cassandra.queries"),
view.WithRename("db_cassandra_queries"),
)
if err != nil {
return nil, err
}
vs = append(vs, v)

v, err = view.New(
view.MatchInstrumentName("db.cassandra.rows"),
view.WithRename("db_cassandra_rows"),
view.WithSetAggregation(aggregation.ExplicitBucketHistogram{
Boundaries: []float64{0.001, 0.01, 0.1, 0.5, 1, 2, 5, 10},
}),
Expand All @@ -152,27 +139,8 @@ func views() ([]view.View, error) {
}
vs = append(vs, v)

v, err = view.New(
view.MatchInstrumentName("db.cassandra.batch.queries"),
view.WithRename("db_cassandra_batch_queries"),
)
if err != nil {
return nil, err
}
vs = append(vs, v)

v, err = view.New(
view.MatchInstrumentName("db.cassandra.connections"),
view.WithRename("db_cassandra_connections"),
)
if err != nil {
return nil, err
}
vs = append(vs, v)

v, err = view.New(
view.MatchInstrumentName("db.cassandra.latency"),
view.WithRename("db_cassandra_latency"),
view.WithSetAggregation(aggregation.ExplicitBucketHistogram{
Boundaries: []float64{0.001, 0.01, 0.1, 0.5, 1, 2, 5, 10},
}),
Expand Down

0 comments on commit 5fd652a

Please sign in to comment.