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: opentelemetry.go
    path of file: ./repos/aws-node-termination-handler/pkg/observability
    
    the code of the file until where you have to start completion: // Copyright 2016-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may
// not use this file except in compli
    
func InitMetrics(enabled bool, port int) (Metrics, error) {
	exporter, err := prometheus.New()
	if err != nil {
		return Metrics{}, fmt.Errorf("failed to create Prometheus exporter: %w", err)
	}
	provider := metric.NewMeterProvider(metric.WithReader(exporter))
	metrics, err := registerMetricsWith(provider)
	if err != nil {
		return Metrics{}, fmt.Errorf("failed to register metrics with Prometheus provider: %w", err)
	}
	metrics.enabled = enabled

	// Starts an async process to collect golang runtime stats
	// go.opentelemetry.io/contrib/instrumentation/runtime
	if err = runtime.Start(
		runtime.WithMeterProvider(provider),
		runtime.WithMinimumReadMemStatsInterval(1*time.Second)); err != nil {
		return Metrics{}, fmt.Errorf("failed to start Go runtime metrics collection: %w", err)
	}

	go serveMetrics(port)

	return metrics, nil
}