Skip to content

Commit

Permalink
Use const instead of an API
Browse files Browse the repository at this point in the history
  • Loading branch information
utezduyar committed Oct 31, 2023
1 parent 1840f0a commit ecaeafc
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions instrumentation/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ import (
"go.opentelemetry.io/otel/metric"
)

// ScopeName the instrumentation scope name for identifying meters.
const ScopeName string = "go.opentelemetry.io/contrib/instrumentation/runtime"

// Runtime reports the work-in-progress conventional runtime metrics specified by OpenTelemetry.
type runtime struct {
config config
Expand Down Expand Up @@ -95,11 +98,6 @@ func newConfig(opts ...Option) config {
return c
}

// Name returns the instrumentation scope name.
func Name() string {
return "go.opentelemetry.io/contrib/instrumentation/runtime"
}

// Start initializes reporting of runtime metrics using the supplied config.
func Start(opts ...Option) error {
c := newConfig(opts...)
Expand All @@ -111,7 +109,7 @@ func Start(opts ...Option) error {
}
r := &runtime{
meter: c.MeterProvider.Meter(
Name(),
ScopeName,
metric.WithInstrumentationVersion(Version()),
),
config: c,
Expand Down

0 comments on commit ecaeafc

Please sign in to comment.