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: processor_metric.go
    path of file: ./repos/benthos/internal/impl/pure
    
    the code of the file until where you have to start completion: package pure

import (
	"context"
	"errors"
	"fmt"
	"sort"
	"strconv"
	"strings"

	"github.com/benthosdev/benthos/v4/internal/bloblang/field"
	"github.com/benthosdev/benthos/v4/internal/bundle"
	"github.com/benthosdev/benthos/v4/internal/component/interop"
	"github.com/benthosdev/benthos/v4/internal/component/metrics"
	"github.com/benthosdev/benthos/v4/internal/component/processor"
	"github.com/benthosdev/benthos/v4/internal/log"
	"github.com/benthosdev/benthos/v4/internal/message"
	"github.com/benthosdev/benthos/v4/public/service"
)

const (
	metProcFieldType   = "type"
	metProcFieldName   = "name"
	metProcFieldLabels = "labels"
	metProcFieldValue  = "val
    
func init() {
	err := service.RegisterBatchProcessor(
		"metric", metProcSpec(),
		func(conf *service.ParsedConfig, res *service.Resources) (service.BatchProcessor, error) {
			procTypeStr, err := conf.FieldString(metProcFieldType)
			if err != nil {
				return nil, err
			}

			procName, err := conf.FieldString(metProcFieldName)
			if err != nil {
				return nil, err
			}

			var labelMap map[string]string
			if conf.Contains(metProcFieldLabels) {
				if labelMap, err = conf.FieldStringMap(metProcFieldLabels); err != nil {
					return nil, err
				}
			}

			valueStr, err := conf.FieldString(metProcFieldValue)
			if err != nil {
				return nil, err
			}

			mgr := interop.UnwrapManagement(res)
			p, err := newMetricProcessor(procTypeStr, procName, valueStr, labelMap, mgr)
			if err != nil {
				return nil, err
			}

			return interop.NewUnwrapInternalBatchProcessor(p), nil
		})
	if err != nil {
		panic(err)
	}
}