You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: otel_metrics.go
    path of file: ./repos/neosync/worker/internal/benthos/metrics
    
    the code of the file until where you have to start completion: package benthos_metrics

import (
	"context"

	"github.com/benthosdev/benthos/v4/public/service"
	"go.opentelemetry.io/otel/attribute"
	"go.opentelemetry.io/otel/metric"
)

func RegisterOtelMetricsExporter(env *service.Environment, meter metric.Meter) error {
	return env.RegisterMetricsExporter(
		"otel_collector",
		service.NewConfigSpec(),
		func(conf *service.ParsedConfig, log *service.Logger) (service.MetricsExporter, error) {
			return newOtlpMetricsExporter(meter, log), nil
		},
	)
}

var _ service.MetricsExporter = &otlpMetricsExporter{}

type otlpMetricsExporter struct {
	logger  *service.Logger
	meter   metric.Meter
	buckets []float64
}

func newOtlpMetricsExporter(meter metric.Meter, logger *service.Logger) *otlpMetricsExporter {
	return &otlpMetricsExporter{
		logger:  logger,
		meter:   meter,
		buckets: []float64{0, 5, 10, 25, 50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000},
	}
}

type otlpCounter struct {
	counter metric.Int64Counter
	labels  []attribute.KeyValue
}

func (c *otlpCounter) Incr(count int64) {
	c.counter.Add(context.Background(), count, me
    
func (om *otlpMetricsExporter) NewGaugeCtor(path string, labelNames ...string) service.MetricsExporterGaugeCtor {
	return func(labelValues ...string) service.MetricsExporterGauge {
		var attrs []attribute.KeyValue
		for idx, label := range labelNames {
			attrs = append(attrs, attribute.String(label, labelValues[idx]))
		}

		gauge, err := om.meter.Int64ObservableGauge(
			path,
		)
		if err != nil {
			om.logger.Error(err.Error())
			return nil
		}

		gaugeChan := make(chan int64, 10)
		latestChan := make(chan int64, 1)
		latestChan <- 0
		_, err = om.meter.RegisterCallback(
			func(ctx context.Context, o metric.Observer) error {
				var last int64
				if len(gaugeChan) == 0 {
					last = <-latestChan
					latestChan <- last
					o.ObserveInt64(gauge, last)
					return nil
				}
				var value int64 = 0
				for len(gaugeChan) > 0 {
					value = <-gaugeChan
				}
				o.ObserveInt64(gauge, value)
				<-latestChan
				latestChan <- value
				return nil
			},
			gauge,
		)
		if err != nil {
			om.logger.Error(err.Error())
			return nil
		}
		return &otlpGauge{
			gauge:     gauge,
			gaugeChan: gaugeChan,
			lables:    attrs,
		}
	}
}