github.com/caos/orbos@v1.5.14-0.20221103111702-e6cd0cea7ad4/internal/operator/boom/application/applications/zitadel/servicemonitor.go (about)

     1  package zitadel
     2  
     3  import (
     4  	"github.com/caos/orbos/internal/operator/boom/application/applications/metricspersisting/servicemonitor"
     5  	deprecatedlabels "github.com/caos/orbos/internal/operator/boom/labels"
     6  	"github.com/caos/orbos/internal/operator/boom/name"
     7  )
     8  
     9  func GetServicemonitors(instanceName string) []*servicemonitor.Config {
    10  	return []*servicemonitor.Config{
    11  		getOperatorServicemonitor(instanceName),
    12  		getZitadelServicemonitor(instanceName),
    13  	}
    14  }
    15  
    16  func getZitadelServicemonitor(instanceName string) *servicemonitor.Config {
    17  	var monitorName name.Application = "zitadel-servicemonitor"
    18  
    19  	return &servicemonitor.Config{
    20  		Name: monitorName.String(),
    21  		Endpoints: []*servicemonitor.ConfigEndpoint{{
    22  			Port: "http",
    23  		}},
    24  		MonitorMatchingLabels: deprecatedlabels.GetMonitorLabels(instanceName, monitorName),
    25  		ServiceMatchingLabels: getApplicationServiceLabels(),
    26  
    27  		JobName:           monitorName.String(),
    28  		NamespaceSelector: []string{"caos-zitadel"},
    29  	}
    30  }
    31  
    32  func getOperatorServicemonitor(instanceName string) *servicemonitor.Config {
    33  	var monitorName name.Application = "zitadel-operator-servicemonitor"
    34  
    35  	return &servicemonitor.Config{
    36  		Name: monitorName.String(),
    37  		Endpoints: []*servicemonitor.ConfigEndpoint{{
    38  			Port: "http",
    39  		}},
    40  		MonitorMatchingLabels: deprecatedlabels.GetMonitorLabels(instanceName, monitorName),
    41  		ServiceMatchingLabels: getOperatorServiceLabels(),
    42  
    43  		JobName:           monitorName.String(),
    44  		NamespaceSelector: []string{"caos-system"},
    45  	}
    46  }