func New(ctx context.Context) (Publisher, error) {
	sess := awssession.New()
	ec2Client, err := ec2wrapper.NewMetricsClient()
	if err != nil {
		return nil, errors.Wrap(err, "publisher: unable to obtain EC2 service client")
	}
	clusterID := getClusterID(ec2Client)
	ec2MetadataClient := ec2metadatawrapper.New(sess)
	region, err := ec2MetadataClient.Region()
	if err != nil {
		return nil, errors.Wrap(err, "publisher: Unable to obtain region")
	}
	awsCfg := aws.Config{
		Region: aws.String(region),
	}
	sess = sess.Copy(&awsCfg)
	cloudwatchClient := cloudwatch.New(sess)
	derivedContext, cancel := context.WithCancel(ctx)
	return &cloudWatchPublisher{
		ctx:              derivedContext,
		cancel:           cancel,
		cloudwatchClient: cloudwatchClient,
		clusterID:        clusterID,
		localMetricData:  make([]*cloudwatch.MetricDatum, 0, localMetricDataSize),
	}, nil
}
New returns a new instance of `Publisher`
package publisher
import (
	"context"
	"sync"
	"time"
	"github.com/aws/amazon-vpc-cni-k8s/pkg/awsutils/awssession"
	"github.com/aws/amazon-vpc-cni-k8s/pkg/ec2metadatawrapper"
	"github.com/aws/amazon-vpc-cni-k8s/pkg/ec2wrapper"
	"github.com/aws/amazon-vpc-cni-k8s/pkg/utils/logger"
	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/service/cloudwatch"
	"github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface"
	"github.com/pkg/errors"
)
const (
	defaultInterval = time.Second * 60
	cloudwatchMetricNamespace = "Kubernetes"
	clusterIDDimension = "CLUSTER_ID"
	localMetricDataSize = 100
	maxDataPoints = 20
	defaultClusterID = "k8s-cluster"
)
var (
	clusterIDTags = []string{
		"eks:cluster-name",
		"CLUSTER_ID",
		"Name",
	}
)
var log = logger.Get()
type Publisher interface {
	Publish(metricDataPoints ...*cloudwatch.MetricDatum)
	Start()
	Stop()
}
type cloudWatchPublisher struct {
	ctx                  context.Context
	cancel               context.CancelFunc
	updateIntervalTicker *time.Ticker
	clusterID            string
	cloudwatchClient     cloudwatchiface.CloudWatchAPI
	localMetricData      []*cloudwatch.MetricDatum
	lock                 sync.RWMutex
}