Skip to content
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

Append ruler labels as external labels when using stateless ruler mode #5205

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -13,6 +13,7 @@ We use *breaking :warning:* to mark changes that are not backward compatible (re
### Fixed

### Changed
- [#5205](https://github.com/thanos-io/thanos/pull/5205) Rule: Add ruler labels as external labels in stateless ruler mode.

### Removed

Expand Down
4 changes: 3 additions & 1 deletion cmd/thanos/rule.go
Expand Up @@ -363,7 +363,9 @@ func runRule(
return 0, nil
}, walDir, 1*time.Minute, nil)
if err := remoteStore.ApplyConfig(&config.Config{
GlobalConfig: config.DefaultGlobalConfig,
GlobalConfig: config.GlobalConfig{
ExternalLabels: labelsTSDBToProm(conf.lset),
},
RemoteWriteConfigs: rwCfg.RemoteWriteConfigs,
}); err != nil {
return errors.Wrap(err, "applying config to remote storage")
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/rule_test.go
Expand Up @@ -539,12 +539,14 @@ func TestRule_CanRemoteWriteData(t *testing.T) {
"__name__": "test_absent_metric",
"job": "thanos-receive",
"receive": "1",
"replica": "1",
"tenant_id": "default-tenant",
},
{
"__name__": "test_absent_metric",
"job": "thanos-receive",
"receive": "2",
"replica": "1",
"tenant_id": "default-tenant",
},
})
Expand Down