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: metric.go
    path of file: ./repos/bk-cmdb/src/source_controller/cacheservice/event
    
    the code of the file until where you have to start completion: /*
 * Tencent is pleased to support the open source community by making 蓝鲸 available.
 * Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
 * Licensed under the MIT License (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 * http://opensource.org/licenses/MIT
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on a
    
func InitialMetrics(collection string, subSys string) *EventMetrics {
	labels := prometheus.Labels{"collection": collection}

	m := new(EventMetrics)
	m.totalEventCount = prometheus.NewCounterVec(prometheus.CounterOpts{
		Namespace:   metrics.Namespace,
		Subsystem:   subSys,
		Name:        "total_event_count",
		Help:        "the total event count which we handled with this resources",
		ConstLabels: labels,
	}, []string{"action"})
	metrics.Register().MustRegister(m.totalEventCount)

	m.lastEventTime = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace:   metrics.Namespace,
		Subsystem:   subSys,
		Name:        "last_event_unix_time_seconds",
		Help:        "records the time that event occurs at unix time seconds",
		ConstLabels: labels,
	}, []string{})
	metrics.Register().MustRegister(m.lastEventTime)

	m.eventLagDurations = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Namespace:   metrics.Namespace,
		Subsystem:   subSys,
		Name:        "event_lag_seconds",
		Help:        "the lags(seconds) of the event between it occurs and we received it",
		ConstLabels: labels,
		Buckets:     []float64{0.02, 0.04, 0.06, 0.08, 0.1, 0.3, 0.5, 0.7, 1, 5, 10, 20, 30, 60, 120},
	}, []string{"action"})
	metrics.Register().MustRegister(m.eventLagDurations)

	m.lastEventLagDuration = prometheus.NewGaugeVec(prometheus.GaugeOpts{
		Namespace:   metrics.Namespace,
		Subsystem:   subSys,
		Name:        "last_event_lag_seconds",
		Help:        "record the last event's lag duration in seconds",
		ConstLabels: labels,
	}, []string{})
	metrics.Register().MustRegister(m.lastEventLagDuration)

	m.cycleDurations = prometheus.NewHistogramVec(prometheus.HistogramOpts{
		Namespace:   metrics.Namespace,
		Subsystem:   subSys,
		Name:        "event_cycle_seconds",
		Help:        "the total duration(seconds) of each event being handled",
		ConstLabels: labels,
		Buckets:     []float64{0.02, 0.04, 0.06, 0.08, 0.1, 0.3, 0.5, 0.7, 1, 5, 10, 15, 20, 40, 60, 120},
	}, []string{})
	metrics.Register().MustRegister(m.cycleDurations)

	m.totalErrorCount = prometheus.NewCounterVec(prometheus.CounterOpts{
		Namespace: metrics.Namespace,
		Subsystem: subSys,
		Name:      "total_error_count",
		Help: "the total error event count which we handled with this resources, " +
			"including invalid event and re-watch operations",
		ConstLabels: labels,
	}, []string{"error_type"})
	metrics.Register().MustRegister(m.totalErrorCount)

	return m
}