func NewQueryFrontendServiceMonitor(opts Options) *monitoringv1.ServiceMonitor {
	l := ComponentLabels(LabelQueryFrontendComponent, opts.Name)
	serviceMonitorName := serviceMonitorName(QueryFrontendName(opts.Name))
	serviceName := serviceNameQueryFrontendHTTP(opts.Name)
	lokiEndpoint := serviceMonitorEndpoint(lokiHTTPPortName, serviceName, opts.Namespace, opts.Flags.EnableTLSServiceMonitorConfig)
	return newServiceMonitor(opts.Namespace, serviceMonitorName, l, lokiEndpoint)
}
NewQueryFrontendServiceMonitor creates a k8s service monitor for the query-frontend component
package manifests
import (
	"github.com/ViaQ/logerr/kverrors"
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/apimachinery/pkg/labels"
	"sigs.k8s.io/controller-runtime/pkg/client"
	"github.com/imdario/mergo"
	monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
)
func BuildServiceMonitors(opts Options) []client.Object {
	return []client.Object{
		NewDistributorServiceMonitor(opts),
		NewIngesterServiceMonitor(opts),
		NewQuerierServiceMonitor(opts),
		NewCompactorServiceMonitor(opts),
		NewQueryFrontendServiceMonitor(opts),
		NewGatewayServiceMonitor(opts),
	}
}
func NewDistributorServiceMonitor(opts Options) *monitoringv1.ServiceMonitor {
	l := ComponentLabels(LabelDistributorComponent, opts.Name)
	serviceMonitorName := serviceMonitorName(DistributorName(opts.Name))
	serviceName := serviceNameDistributorHTTP(opts.Name)
	lokiEndpoint := serviceMonitorEndpoint(lokiHTTPPortName, serviceName, opts.Namespace, opts.Flags.EnableTLSServiceMonitorConfig)
	return newServiceMonitor(opts.Namespace, serviceMonitorName, l, lokiEndpoint)
}
func NewIngesterServiceMonitor(opts Options) *monitoringv1.ServiceMonitor {
	l := ComponentLabels(LabelIngesterComponent, opts.Name)
	serviceMonitorName := serviceMonitorName(IngesterName(opts.Name))
	serviceName := serviceNameIngesterHTTP(opts.Name)
	lokiEndpoint := serviceMonitorEndpoint(lokiHTTPPortName, serviceName, opts.Namespace, opts.Flags.EnableTLSServiceMonitorConfig)
	return newServiceMonitor(opts.Namespace, serviceMonitorName, l, lokiEndpoint)
}
func NewQuerierServiceMonitor(opts Options) *monitoringv1.ServiceMonitor {
	l := ComponentLabels(LabelQuerierComponent, opts.Name)
	serviceMonitorName := serviceMonitorName(QuerierName(opts.Name))
	serviceName := serviceNameQuerierHTTP(opts.Name)
	lokiEndpoint := serviceMonitorEndpoint(lokiHTTPPortName, serviceName, opts.Namespace, opts.Flags.EnableTLSServiceMonitorConfig)
	return newServiceMonitor(opts.Namespace, serviceMonitorName, l, lokiEndpoint)
}
func NewCompactorServiceMonitor(opts Options) *monitoringv1.ServiceMonitor {
	l := ComponentLabels(LabelCompactorComponent, opts.Name)
	serviceMonitorName := serviceMonitorName(CompactorName(opts.Name))
	serviceName := serviceNameCompactorHTTP(opts.Name)
	lokiEndpoint := serviceMonitorEndpoint(lokiHTTPPortName, serviceName, opts.Namespace, opts.Flags.EnableTLSServiceMonitorConfig)
	return newServiceMonitor(opts.Namespace, serviceMonitorName, l, lokiEndpoint)
}