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)
}
NewDistributorServiceMonitor creates a k8s service monitor for the distributor 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),
	}
}