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

Function dockerMetricExporter

cli/command/telemetry_docker.go:115–134  ·  view source on GitHub ↗
(ctx context.Context, cli Cli)

Source from the content-addressed store, hash-verified

113}
114
115func dockerMetricExporter(ctx context.Context, cli Cli) []sdkmetric.Option {
116 endpoint, secure := dockerExporterOTLPEndpoint(cli)
117 if endpoint == "" {
118 return nil
119 }
120
121 opts := []otlpmetricgrpc.Option{
122 otlpmetricgrpc.WithEndpoint(endpoint),
123 }
124 if !secure {
125 opts = append(opts, otlpmetricgrpc.WithInsecure())
126 }
127
128 exp, err := otlpmetricgrpc.New(ctx, opts...)
129 if err != nil {
130 otel.Handle(err)
131 return nil
132 }
133 return []sdkmetric.Option{sdkmetric.WithReader(newCLIReader(exp))}
134}
135
136// unixSocketEndpoint converts the unix scheme from URL to
137// an OTEL endpoint that can be used with the OTLP exporter.

Callers 1

Calls 2

newCLIReaderFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…