func ConfigsForPod(pc *types.PrometheusCheck, pod *kubelet.Pod) []integration.Config {
	var configs []integration.Config
	namespacedName := fmt.Sprintf("%s/%s", pod.Metadata.Namespace, pod.Metadata.Name)
	if pc.IsExcluded(pod.Metadata.Annotations, namespacedName) {
		return configs
	}

	instances, found := buildInstances(pc, pod.Metadata.Annotations, namespacedName)
	if found {
		for _, container := range pod.Status.GetAllContainers() {
			if !pc.AD.MatchContainer(container.Name) {
				log.Debugf("Container '%s' doesn't match the AD configuration 'kubernetes_container_names', ignoring it", container.Name)
				continue
			}
			configs = append(configs, integration.Config{
				Name:          openmetricsCheckName,
				InitConfig:    integration.Data(openmetricsInitConfig),
				Instances:     instances,
				Provider:      names.PrometheusPods,
				Source:        "prometheus_pods:" + container.ID,
				ADIdentifiers: []string{container.ID},
			})
		}
		return configs
	}

	// TODO: Support AD matching based on label selectors

	return configs
}
// ConfigsForPod returns the openmetrics configurations for a given pod if it matches the AD configuration
ConfigsForPod returns the openmetrics configurations for a given pod if it matches the AD configuration
// ConfigsForPod returns the openmetrics configurations for a given pod if it matches the AD configuration
func ConfigsForPod(pc *types.PrometheusCheck, pod *kubelet.Pod) []integration.Config {
	var configs []integration.Config
	namespacedName := fmt.Sprintf("%s/%s", pod.Metadata.Namespace, pod.Metadata.Name)
	if pc.IsExcluded(pod.Metadata.Annotations, namespacedName) {
		return configs
	}
	instances, found := buildInstances(pc, pod.Metadata.Annotations, namespacedName)
	if found {
		for _, container := range pod.Status.GetAllContainers() {
			if !pc.AD.MatchContainer(container.Name) {
				log.Debugf("Container '%s' doesn't match the AD configuration 'kubernetes_container_names', ignoring it", container.Name)
				continue
			}
			configs = append(configs, integration.Config{
				Name:          openmetricsCheckName,
				InitConfig:    integration.Data(openmetricsInitConfig),
				Instances:     instances,
				Provider:      names.PrometheusPods,
				Source:        "prometheus_pods:" + container.ID,
				ADIdentifiers: []string{container.ID},
			})
		}
		return configs
	}
	return configs
}
func ConfigsForPod ( pc * types . PrometheusCheck , pod * kubelet . Pod ) [ ] integration . Config { var configs [ ] integration . Config namespacedName := fmt . Sprintf ( " " , pod . Metadata . Namespace , pod . Metadata . Name ) if pc . IsExcluded ( pod . Metadata . Annotations , namespacedName ) { return configs } instances , found := buildInstances ( pc , pod . Metadata . Annotations , namespacedName ) if found { for _ , container := range pod . Status . GetAllContainers ( ) { if ! pc . AD . MatchContainer ( container . Name ) { log . Debugf ( " " , container . Name ) continue } configs = append ( configs , integration . Config { Name : openmetricsCheckName , InitConfig : integration . Data ( openmetricsInitConfig ) , Instances : instances , Provider : names . PrometheusPods , Source : " " + container . ID , ADIdentifiers : [ ] string { container . ID } , } ) } return configs } return configs }
ConfigsForPod returns the openmetrics configurations for a given pod if it matches the AD configuration
ConfigsForPod returns the openmetrics configurations for a given pod if it matches the AD configuration
// TODO: Support AD matching based on label selectors