Merge pull request #16699 from prometheus/release-3.4

This commit is contained in:
Jan-Otto Kröpke 2025-06-06 17:04:53 +02:00 committed by GitHub
commit 6d10fce2b6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 27 additions and 0 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## 3.4.2 / 2025-06-04
* [BUGFIX] OTLP receiver: Fix default configuration not being respected if the `otlp:` block is unset in the config file. #16693
## 3.4.1 / 2025-05-31
* [BUGFIX] Parser: Add reproducer for a dangling-reference issue in parsers. #16633

View File

@ -158,6 +158,7 @@ var (
DefaultConfig = Config{
GlobalConfig: DefaultGlobalConfig,
Runtime: DefaultRuntimeConfig,
OTLPConfig: DefaultOTLPConfig,
}
// DefaultGlobalConfig is the default global configuration.

View File

@ -22,6 +22,7 @@ var ruleFilesExpectedConf = &Config{
GlobalConfig: DefaultGlobalConfig,
Runtime: DefaultRuntimeConfig,
OTLPConfig: DefaultOTLPConfig,
RuleFiles: []string{
"testdata/first.rules",
"testdata/rules/second.rules",

View File

@ -1867,6 +1867,26 @@ func TestOTLPAllowUTF8(t *testing.T) {
verify(t, err)
})
})
t.Run("good config - missing otlp config uses default", func(t *testing.T) {
fpath := filepath.Join("testdata", "otlp_empty.yml")
verify := func(t *testing.T, conf *Config, err error) {
t.Helper()
require.NoError(t, err)
require.Equal(t, UnderscoreEscapingWithSuffixes, conf.OTLPConfig.TranslationStrategy)
}
t.Run("LoadFile", func(t *testing.T) {
conf, err := LoadFile(fpath, false, promslog.NewNopLogger())
verify(t, conf, err)
})
t.Run("Load", func(t *testing.T) {
content, err := os.ReadFile(fpath)
require.NoError(t, err)
conf, err := Load(string(content), promslog.NewNopLogger())
verify(t, conf, err)
})
})
}
func TestLoadConfig(t *testing.T) {

1
config/testdata/otlp_empty.yml vendored Normal file
View File

@ -0,0 +1 @@
global: