mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-09 21:17:09 +08:00
metricutil: switch to using the cli meter provider
The meter provider initialization that was located here has now been moved to a common area in the docker cli. This upgrades our CLI version and then uses this common code instead of our own version. As a piece of additional functionality, the docker OTEL endpoint can now be overwritten with `DOCKER_CLI_OTEL_EXPORTER_OTLP_ENDPOINT` for testing. This removes the OTLP exporter from the CLI that was previously locked behind `BUILDX_EXPERIMENTAL`. I do plan for this to return, but as a proper part of the `docker/cli` implementation rather than something special with `buildx`. Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
This commit is contained in:
@ -266,11 +266,8 @@ func (o *buildOptionsHash) String() string {
|
||||
}
|
||||
|
||||
func runBuild(ctx context.Context, dockerCli command.Cli, options buildOptions) (err error) {
|
||||
mp, err := metricutil.NewMeterProvider(ctx, dockerCli)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer mp.Report(context.Background())
|
||||
mp := dockerCli.MeterProvider(ctx)
|
||||
defer metricutil.Shutdown(ctx, mp)
|
||||
|
||||
ctx, end, err := tracing.TraceCurrentCommand(ctx, "build")
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user