Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alias api types to root #696

Merged
merged 4 commits into from
May 7, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 15 additions & 0 deletions doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package otel // import "go.opentelemetry.io/otel"
68 changes: 68 additions & 0 deletions otel.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Copyright The OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package otel

import (
"go.opentelemetry.io/otel/api/global"
"go.opentelemetry.io/otel/api/metric"
"go.opentelemetry.io/otel/api/propagation"
"go.opentelemetry.io/otel/api/trace"
)

type Tracer = trace.Tracer
type TraceProvider = trace.Provider

type Meter = metric.Meter
type MeterProvider = metric.Provider

type Propagators = propagation.Propagators

func GlobalTracer(name string) Tracer {
return global.Tracer(name)
}

// GlobalTraceProvider returns the registered global trace provider.
func GlobalTraceProvider() TraceProvider {
return global.TraceProvider()
}

// SetGlobalTraceProvider registers `tp` as the global trace provider.
func SetGlobalTraceProvider(tp TraceProvider) {
global.SetTraceProvider(tp)
}

func GlobalMeter(name string) Meter {
return global.Meter(name)
}

// GlobalMeterProvider returns the registered global meter provider.
func GlobalMeterProvider() MeterProvider {
return global.MeterProvider()
}

// SetGlobalMeterProvider registers `mp` as the global meter provider.
func SetGlobalMeterProvider(mp MeterProvider) {
global.SetMeterProvider(mp)
}

// GlobalPropagators returns the registered global propagators instance.
func GlobalPropagators() Propagators {
return global.Propagators()
}

// SetGlobalPropagators registers `p` as the global propagators instance.
func SetGlobalPropagators(p Propagators) {
global.SetPropagators(p)
}