func (pc *PrometheusCheck) initInstances() {
	if len(pc.Instances) == 0 {
		// Put a default config
		pc.Instances = append(pc.Instances, &OpenmetricsInstance{
			Metrics:   openmetricsDefaultMetrics,
			Namespace: openmetricsDefaultNS,
		})
		return
	}

	for _, instance := range pc.Instances {
		// Default the required config values if not set
		if len(instance.Metrics) == 0 {
			instance.Metrics = openmetricsDefaultMetrics
		}
	}
}
// initInstances defaults the Instances field in PrometheusCheck
initInstances defaults the Instances field in PrometheusCheck
// initInstances defaults the Instances field in PrometheusCheck
func (pc *PrometheusCheck) initInstances() {
	if len(pc.Instances) == 0 {
		pc.Instances = append(pc.Instances, &OpenmetricsInstance{
			Metrics:   openmetricsDefaultMetrics,
			Namespace: openmetricsDefaultNS,
		})
		return
	}
	for _, instance := range pc.Instances {
		if len(instance.Metrics) == 0 {
			instance.Metrics = openmetricsDefaultMetrics
		}
	}
}
func ( pc * PrometheusCheck ) initInstances ( ) { if len ( pc . Instances ) == 0 { pc . Instances = append ( pc . Instances , & OpenmetricsInstance { Metrics : openmetricsDefaultMetrics , Namespace : openmetricsDefaultNS , } ) return } for _ , instance := range pc . Instances { if len ( instance . Metrics ) == 0 { instance . Metrics = openmetricsDefaultMetrics } } }
initInstances defaults the Instances field in PrometheusCheck
initInstances defaults the Instances field in PrometheusCheck
// Put a default config // Default the required config values if not set