Line data Source code
1 : // Copyright The OpenTelemetry Authors
2 : // SPDX-License-Identifier: Apache-2.0
3 :
4 : part of 'tracer.dart';
5 :
6 : /// Factory for creating Tracer instances.
7 : ///
8 : /// This factory class provides a static create method for constructing
9 : /// properly configured Tracer instances. It follows the factory pattern
10 : /// to separate the construction logic from the Tracer class itself.
11 : @internal
12 : class SDKTracerCreate {
13 : /// Creates a new Tracer with the specified delegate, provider, and optional sampler.
14 : ///
15 : /// @param delegate The API Tracer implementation to delegate to
16 : /// @param provider The TracerProvider that created this Tracer
17 : /// @param sampler Optional custom sampler for this Tracer
18 : /// @return A new APITracer instance (actually a Tracer implementation)
19 49 : static APITracer create({
20 : required APITracer delegate,
21 : required TracerProvider provider,
22 : Sampler? sampler,
23 : }) {
24 49 : return Tracer._(delegate: delegate, provider: provider, sampler: sampler);
25 : }
26 : }
|