@@ -62,7 +62,6 @@ func BindOptions(opts *RawOptions, cmd *cobra.Command) error {
6262 cmd .Flags ().StringVar (& opts .RenderedConfig , "rendered-config" , opts .RenderedConfig , "Path to the rendered configuration YAML file." )
6363 cmd .Flags ().StringVar (& opts .SubscriptionID , "subscription-id" , opts .SubscriptionID , "Azure subscription ID." )
6464 cmd .Flags ().StringVar (& opts .StartTimeFallback , "start-time-fallback" , opts .StartTimeFallback , "Optional RFC3339 time to use as start time fallback when steps and test timing are unavailable." )
65- cmd .Flags ().StringVar (& opts .QueriesConfigPath , "queries-config" , opts .QueriesConfigPath , "Path to YAML file specifying PromQL queries to execute and chart." )
6665 cmd .Flags ().StringVar (& opts .SeverityThreshold , "severity-threshold" , opts .SeverityThreshold , "Include alerts at this severity level or more critical (Sev0=critical .. Sev4=verbose). E.g. Sev2 includes Sev0, Sev1, Sev2. If not set, all severities are shown." )
6766 return nil
6867}
@@ -73,7 +72,6 @@ type RawOptions struct {
7372 RenderedConfig string
7473 SubscriptionID string
7574 StartTimeFallback string
76- QueriesConfigPath string
7775 SeverityThreshold string
7876}
7977
@@ -199,27 +197,25 @@ func (o *ValidatedOptions) Complete(ctx context.Context) (*Options, error) {
199197 cred : cred ,
200198 }
201199
202- if o .QueriesConfigPath != "" {
203- queries , err := loadQueriesConfig (o .QueriesConfigPath )
204- if err != nil {
205- return nil , fmt .Errorf ("failed to load queries config: %w" , err )
206- }
207- completed .Queries = queries
208- logger .Info ("loaded queries config" , "path" , o .QueriesConfigPath , "queries" , len (queries .Queries ))
200+ queries , err := loadQueriesConfig ()
201+ if err != nil {
202+ return nil , fmt .Errorf ("failed to load queries config: %w" , err )
203+ }
204+ completed .Queries = queries
205+ logger .Info ("loaded embedded queries config" , "queries" , len (queries .Queries ))
209206
210- // Resolve Prometheus endpoints eagerly so we fail fast
211- completed .SvcPromEndpoint , err = lookupPrometheusEndpoint (ctx , cred , o .SubscriptionID , regionRG , svcWorkspace )
212- if err != nil {
213- return nil , fmt .Errorf ("failed to look up svc Prometheus endpoint for workspace %s in %s: %w" , svcWorkspace , regionRG , err )
214- }
215- logger .Info ("resolved svc Prometheus endpoint" , "endpoint" , completed .SvcPromEndpoint )
207+ // Resolve Prometheus endpoints eagerly so we fail fast
208+ completed .SvcPromEndpoint , err = lookupPrometheusEndpoint (ctx , cred , o .SubscriptionID , regionRG , svcWorkspace )
209+ if err != nil {
210+ return nil , fmt .Errorf ("failed to look up svc Prometheus endpoint for workspace %s in %s: %w" , svcWorkspace , regionRG , err )
211+ }
212+ logger .Info ("resolved svc Prometheus endpoint" , "endpoint" , completed .SvcPromEndpoint )
216213
217- completed .HcpPromEndpoint , err = lookupPrometheusEndpoint (ctx , cred , o .SubscriptionID , regionRG , hcpWorkspace )
218- if err != nil {
219- return nil , fmt .Errorf ("failed to look up hcp Prometheus endpoint for workspace %s in %s: %w" , hcpWorkspace , regionRG , err )
220- }
221- logger .Info ("resolved hcp Prometheus endpoint" , "endpoint" , completed .HcpPromEndpoint )
214+ completed .HcpPromEndpoint , err = lookupPrometheusEndpoint (ctx , cred , o .SubscriptionID , regionRG , hcpWorkspace )
215+ if err != nil {
216+ return nil , fmt .Errorf ("failed to look up hcp Prometheus endpoint for workspace %s in %s: %w" , hcpWorkspace , regionRG , err )
222217 }
218+ logger .Info ("resolved hcp Prometheus endpoint" , "endpoint" , completed .HcpPromEndpoint )
223219
224220 return & Options {completedOptions : completed }, nil
225221}
0 commit comments