File tree 4 files changed +24
-4
lines changed 4 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
14
14
15
15
### Fixed
16
16
- Throw an error when http_middelware is processing a wrong handler [ #199 ] ( https://github.com/tarantool/metrics/issues/199 )
17
+ - cartridge issues metric fails before cartridge.cfg() call [ #298 ] ( https://github.com/tarantool/metrics/issues/298 )
17
18
18
19
## [ 0.10.0] - 2021-08-03
19
20
### Changed
Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ local metrics = require('metrics')
2
2
3
3
local cartridge_metrics = {
4
4
require (' metrics.cartridge.issues' ),
5
- require (' metrics.tarantool.clock' ),
6
5
}
7
6
8
7
local function enable ()
Original file line number Diff line number Diff line change @@ -3,14 +3,18 @@ local fun = require('fun')
3
3
4
4
local collectors_list = {}
5
5
6
- local function update_info_metrics ()
6
+ local function update ()
7
7
local list_on_instance = rawget (_G , ' __cartridge_issues_list_on_instance' )
8
8
9
9
if not list_on_instance then
10
10
return
11
11
end
12
12
13
- local issues = list_on_instance ()
13
+ local ok , issues = pcall (list_on_instance )
14
+
15
+ if not ok then
16
+ return
17
+ end
14
18
15
19
local levels = { ' warning' , ' critical' }
16
20
@@ -22,6 +26,6 @@ local function update_info_metrics()
22
26
end
23
27
24
28
return {
25
- update = update_info_metrics ,
29
+ update = update ,
26
30
list = collectors_list ,
27
31
}
Original file line number Diff line number Diff line change
1
+ local helpers = require (' test.helper' )
2
+
3
+ local t = require (' luatest' )
4
+ local g = t .group ()
5
+
6
+ g .before_all = function ()
7
+ t .skip_if (type (helpers ) ~= ' table' , ' Skip cartridge test' )
8
+ helpers .skip_cartridge_version_less (' 2.0.2' )
9
+ end
10
+
11
+ g .test_cartridge_issues_before_cartridge_cfg = function ()
12
+ require (' cartridge.issues' )
13
+ local issues = require (' metrics.cartridge.issues' )
14
+ local ok , error = pcall (issues .update )
15
+ t .assert (ok , error )
16
+ end
You can’t perform that action at this time.
0 commit comments