-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add secret provider interface under feature flag #13955
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ import ( | |
"github.com/prometheus/prometheus/discovery" | ||
"github.com/prometheus/prometheus/model/labels" | ||
"github.com/prometheus/prometheus/model/relabel" | ||
"github.com/prometheus/prometheus/secrets" | ||
"github.com/prometheus/prometheus/storage/remote/azuread" | ||
) | ||
|
||
|
@@ -223,13 +224,14 @@ var ( | |
|
||
// Config is the top-level configuration for Prometheus's config files. | ||
type Config struct { | ||
GlobalConfig GlobalConfig `yaml:"global"` | ||
AlertingConfig AlertingConfig `yaml:"alerting,omitempty"` | ||
RuleFiles []string `yaml:"rule_files,omitempty"` | ||
ScrapeConfigFiles []string `yaml:"scrape_config_files,omitempty"` | ||
ScrapeConfigs []*ScrapeConfig `yaml:"scrape_configs,omitempty"` | ||
StorageConfig StorageConfig `yaml:"storage,omitempty"` | ||
TracingConfig TracingConfig `yaml:"tracing,omitempty"` | ||
GlobalConfig GlobalConfig `yaml:"global"` | ||
AlertingConfig AlertingConfig `yaml:"alerting,omitempty"` | ||
RuleFiles []string `yaml:"rule_files,omitempty"` | ||
ScrapeConfigFiles []string `yaml:"scrape_config_files,omitempty"` | ||
ScrapeConfigs []*ScrapeConfig `yaml:"scrape_configs,omitempty"` | ||
StorageConfig StorageConfig `yaml:"storage,omitempty"` | ||
TracingConfig TracingConfig `yaml:"tracing,omitempty"` | ||
SecretProviders *secrets.Configs `yaml:"secrets,omitempty"` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice, but this requires a bit of documentation for users (and reviewers, and future code readers) to understand this. Perhaps https://github.com/prometheus/prometheus/blob/67326d8e5cab4251341b4c76bc6e9f9668865614/docs/configuration/configuration.md is a proper file for this? |
||
|
||
RemoteWriteConfigs []*RemoteWriteConfig `yaml:"remote_write,omitempty"` | ||
RemoteReadConfigs []*RemoteReadConfig `yaml:"remote_read,omitempty"` | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1998,6 +1998,10 @@ var expectedErrors = []struct { | |
filename: "scrape_config_files_scrape_protocols2.bad.yml", | ||
errMsg: `parsing YAML file testdata/scrape_config_files_scrape_protocols2.bad.yml: duplicated protocol in scrape_protocols, got [OpenMetricsText1.0.0 PrometheusProto OpenMetricsText1.0.0] for scrape config with job name "node"`, | ||
}, | ||
{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add a few examples how inline/file would work (valid configs with inline and file?) |
||
filename: "secret_provider.bad.missing_provider_config.yml", | ||
errMsg: "expected secret provider but found none", | ||
}, | ||
} | ||
|
||
func TestBadConfigs(t *testing.T) { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
secrets: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add one for unexisting provider? |
||
- name: abc |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,6 +201,7 @@ require ( | |
) | ||
|
||
replace ( | ||
github.com/prometheus/common => github.com/TheSpiritXIII/prometheus-common v0.50.0-gmp.0 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could upgrade common and remove this line, no? |
||
k8s.io/klog => github.com/simonpasquier/klog-gokit v0.3.0 | ||
k8s.io/klog/v2 => github.com/simonpasquier/klog-gokit/v3 v3.3.0 | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we give a bit more context on this error to the config applier/Prometheus logs? What flags has to be enabled?