2020-07-22 21:34:44 +02:00
|
|
|
// 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.
|
|
|
|
|
2021-06-16 17:32:42 +02:00
|
|
|
package stdouttrace // import "go.opentelemetry.io/otel/exporters/stdout/stdouttrace"
|
2020-07-22 21:34:44 +02:00
|
|
|
|
|
|
|
import (
|
|
|
|
sdktrace "go.opentelemetry.io/otel/sdk/trace"
|
|
|
|
)
|
|
|
|
|
|
|
|
type Exporter struct {
|
|
|
|
traceExporter
|
|
|
|
}
|
|
|
|
|
|
|
|
var (
|
2021-04-07 17:03:43 +02:00
|
|
|
_ sdktrace.SpanExporter = &Exporter{}
|
2020-07-22 21:34:44 +02:00
|
|
|
)
|
|
|
|
|
2021-06-10 18:22:47 +02:00
|
|
|
// New creates an Exporter with the passed options.
|
|
|
|
func New(options ...Option) (*Exporter, error) {
|
2021-05-14 22:28:28 +02:00
|
|
|
cfg, err := newConfig(options...)
|
2020-07-22 21:34:44 +02:00
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
return &Exporter{
|
2021-06-16 17:32:42 +02:00
|
|
|
traceExporter: traceExporter{config: cfg},
|
2020-07-22 21:34:44 +02:00
|
|
|
}, nil
|
|
|
|
}
|