-
Notifications
You must be signed in to change notification settings - Fork 25
Add tnt_cartridge_config_applied metric #511
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0b22c3e
to
1d85558
Compare
1d85558
to
317059b
Compare
Satbek
approved these changes
Jul 4, 2025
DifferentialOrange
approved these changes
Jul 4, 2025
oleg-jukovec
requested changes
Jul 4, 2025
CHANGELOG.md
Outdated
@@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | |||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | |||
|
|||
## [Unreleased] | |||
### Added | |||
- `tnt_cartridge_config_applied` metric |
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.
Suggested change
- `tnt_cartridge_config_applied` metric | |
- `tnt_cartridge_config_applied` metric. |
Comment on lines
148
to
180
g.test_config_applied_metric = function() | ||
helpers.skip_cartridge_version_less('2.16.1') | ||
local main_server = g.cluster:server('main') | ||
|
||
t.helpers.retrying({}, function() | ||
local resp = main_server:http_request('get', '/metrics') | ||
local config_metric = utils.find_metric('tnt_cartridge_config_applied', resp.json) | ||
|
||
t.assert_is_not(config_metric, nil, 'Cartridge config applied metric presents in /metrics response') | ||
t.assert_equals(config_metric[1].value, 1, 'Config should be applied') | ||
end) | ||
|
||
main_server.net_box:eval([[ | ||
local patch = require('cartridge').config_patch_clusterwide | ||
local ok, err = patch({ | ||
['conflict'] = {}, | ||
['conflict.yml'] = "text", | ||
}) | ||
]]) | ||
|
||
t.helpers.retrying({}, function() | ||
local resp = main_server:http_request('get', '/metrics') | ||
local config_metric = utils.find_metric('tnt_cartridge_config_applied', resp.json) | ||
|
||
t.assert_is_not(config_metric, nil, 'Cartridge config applied metric presents in /metrics response') | ||
t.assert_equals(config_metric[1].value, 0, 'Config should not be applied') | ||
end) | ||
end |
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.
Please, split the test into two separate tests: config applied and not applied.
317059b
to
2dfcea0
Compare
oleg-jukovec
approved these changes
Jul 4, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added a new metric
tnt_cartridge_config_applied
to track whether the clusterwide config was successfully applied. It reports1
if the config was successfully applied and0
otherwise.Depends on the cartridge's config_applied var.
Closes TNTP-3354