@@ -68,7 +68,7 @@ var CLI struct {
6868 TLSCertFile string `default:"" help:"File containing the default x509 Certificate for HTTPS."`
6969 TLSPrivateKeyFile string `default:"" help:"File containing the default x509 private key matching --tls-cert-file."`
7070 TLSClientCAFile string `default:"" help:"File containing the CA certificate for the client"`
71- MimirTenantIDs [] string `default:"" help:"Mimir tenant IDs to query if multi-tenancy is enabled."`
71+ MimirOrgID string `default:"" help:"Mimir tenant ID to query if multi-tenancy is enabled."`
7272 } `cmd:"" help:"Runs Pyrra's API and UI."`
7373 Filesystem struct {
7474 ConfigFiles string `default:"/etc/pyrra/*.yaml" help:"The folder where Pyrra finds the config files to use. Any non yaml files will be ignored."`
@@ -86,8 +86,10 @@ var CLI struct {
8686 MimirURL * url.URL `default:"" help:"The URL to the Mimir API. If specified provisions rules via Mimir instead of Prometheus"`
8787 MimirPrometheusPrefix string `default:"prometheus" help:"The prefix for the Prometheus API in Mimir"`
8888 MimirBasicAuthUsername string `default:"" help:"The HTTP basic authentication username"`
89- MimirBasicAuthPassword string `default:"" help:"The HTTP basic authentication password"`
9089 MimirWriteAlertingRules bool `default:"false" help:"If alerting rules should be provisioned to the Mimir Ruler."`
90+ MimirBasicAuthPassword string `default:"" help:"The HTTP basic authentication password"`
91+ MimirOrgID string `default:"" help:"Mimir tenant ID to query if multi-tenancy is enabled."`
92+ MimirDeploymentMode string `default:"standalone" help:"Mimir deployment mode. Possible values: standalone (default), distributed"`
9193 } `cmd:"" help:"Runs Pyrra's Kubernetes operator and backend for the API."`
9294 Generate struct {
9395 ConfigFiles string `default:"/etc/pyrra/*.yaml" help:"The folder where Pyrra finds the config files to use."`
@@ -132,12 +134,12 @@ func main() {
132134 if CLI .API .TLSClientCAFile != "" {
133135 clientConfig .TLSConfig = promconfig.TLSConfig {CAFile : CLI .API .TLSClientCAFile }
134136 }
135- if len ( CLI . API . MimirTenantIDs ) > 0 {
136- mimirHeaderValue := strings .Join (CLI .API .MimirTenantIDs , "|" )
137+
138+ if strings .EqualFold (CLI .API .MimirOrgID , "" ) {
137139 clientConfig .HTTPHeaders = & promconfig.Headers {
138140 Headers : map [string ]promconfig.Header {
139- "X-Scope-OrgID" : {
140- Values : []string {mimirHeaderValue },
141+ mimir . TenantHeaderName : {
142+ Values : []string {CLI . API . MimirOrgID },
141143 },
142144 },
143145 }
@@ -190,6 +192,8 @@ func main() {
190192 PrometheusPrefix : CLI .Kubernetes .MimirPrometheusPrefix ,
191193 BasicAuthUsername : CLI .Kubernetes .MimirBasicAuthUsername ,
192194 BasicAuthPassword : CLI .Kubernetes .MimirBasicAuthPassword ,
195+ OrgID : CLI .Kubernetes .MimirOrgID ,
196+ DeploymentMode : CLI .Kubernetes .MimirDeploymentMode ,
193197 }
194198
195199 mimirClient , err = mimir .NewClient (mimirConfig )
0 commit comments