func WithTracingDisabled() TracingOption {
	return tracingOption(func(cfg *config) {
		cfg.TracingDisabled = true
	})
}
TracingDisabled can be used to skip tracing configuration.
package uptrace
import (
	"context"
	"os"
	"github.com/uptrace/uptrace-go/internal"
	"go.opentelemetry.io/otel/attribute"
	"go.opentelemetry.io/otel/propagation"
	"go.opentelemetry.io/otel/sdk/resource"
	sdktrace "go.opentelemetry.io/otel/sdk/trace"
	semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
)
type config struct {
	DSN string
	ResourceAttributes []attribute.KeyValue
	Resource           *resource.Resource
	TracingDisabled   bool
	TextMapPropagator propagation.TextMapPropagator
	TracerProvider    *sdktrace.TracerProvider
	TraceSampler      sdktrace.Sampler
	PrettyPrint       bool
	MetricsDisabled bool
}
func newConfig(opts []Option) *config {
	cfg := new(config)
	if dsn, ok := os.LookupEnv("UPTRACE_DSN"); ok {
		cfg.DSN = dsn
	}
	for _, opt := range opts {
		opt.apply(cfg)
	}
	return cfg
}
func (cfg *config) newResource() *resource.Resource {
	if cfg.Resource != nil {
		if len(cfg.ResourceAttributes) > 0 {
			internal.Logger.Printf("WithResource is used with other resource options (discarding %v)",
				cfg.ResourceAttributes)
		}
		return cfg.Resource
	}
	return buildResource(cfg.ResourceAttributes)
}
func buildResource(attrs []attribute.KeyValue) *resource.Resource {
	ctx := context.TODO()
	res, _ := resource.New(ctx,
		resource.WithFromEnv(),
		resource.WithTelemetrySDK(),
		resource.WithHost(),
		resource.WithSchemaURL(semconv.SchemaURL),
		resource.WithAttributes(attrs...))
	if res == nil {
		return resource.Environment()
	}
	return res
}
type Option interface {
	apply(cfg *config)
}
type option func(cfg *config)
func (fn option) apply(cfg *config) {
	fn(cfg)
}
func WithDSN(dsn string) Option {
	return option(func(cfg *config) {
		cfg.DSN = dsn
	})
}
func WithServiceName(serviceName string) Option {
	return option(func(cfg *config) {
		attr := semconv.ServiceNameKey.String(serviceName)
		cfg.ResourceAttributes = append(cfg.ResourceAttributes, attr)
	})
}
func WithServiceVersion(serviceVersion string) Option {
	return option(func(cfg *config) {
		attr := semconv.ServiceVersionKey.String(serviceVersion)
		cfg.ResourceAttributes = append(cfg.ResourceAttributes, attr)
	})
}
func WithDeploymentEnvironment(env string) Option {
	return option(func(cfg *config) {
		attr := semconv.DeploymentEnvironmentKey.String(env)
		cfg.ResourceAttributes = append(cfg.ResourceAttributes, attr)
	})
}
func WithResourceAttributes(resourceAttributes []attribute.KeyValue) Option {
	return option(func(cfg *config) {
		cfg.ResourceAttributes = resourceAttributes
	})
}
func WithResource(resource *resource.Resource) Option {
	return option(func(cfg *config) {
		cfg.Resource = resource
	})
}
type TracingOption interface {
	Option
	tracing()
}
type tracingOption func(cfg *config)
var _ TracingOption = (*tracingOption)(nil)
func (fn tracingOption) apply(cfg *config) {
	fn(cfg)
}
func (fn tracingOption) tracing() {}