MCPcopy Index your code
hub / github.com/docker/cli / createGlobalMeterProvider

Method createGlobalMeterProvider

cli/command/telemetry.go:119–126  ·  view source on GitHub ↗

createGlobalMeterProvider creates a new MeterProvider from the initialized DockerCli struct with the given options and sets it as the global meter provider

(ctx context.Context, opts ...sdkmetric.Option)

Source from the content-addressed store, hash-verified

117// createGlobalMeterProvider creates a new MeterProvider from the initialized DockerCli struct
118// with the given options and sets it as the global meter provider
119func (cli *DockerCli) createGlobalMeterProvider(ctx context.Context, opts ...sdkmetric.Option) {
120 allOpts := make([]sdkmetric.Option, 0, len(opts)+2)
121 allOpts = append(allOpts, sdkmetric.WithResource(cli.Resource()))
122 allOpts = append(allOpts, dockerMetricExporter(ctx, cli)...)
123 allOpts = append(allOpts, opts...)
124 mp := sdkmetric.NewMeterProvider(allOpts...)
125 otel.SetMeterProvider(mp)
126}
127
128// createGlobalTracerProvider creates a new TracerProvider from the initialized DockerCli struct
129// with the given options and sets it as the global tracer provider

Callers 1

InitializeMethod · 0.95

Calls 2

ResourceMethod · 0.95
dockerMetricExporterFunction · 0.85

Tested by

no test coverage detected