Skip to content

Commit

Permalink
rock: override built-in metrics
Browse files Browse the repository at this point in the history
The ability to override built-in modules was introduced with [1].
After [2], metrics will be embedded to core Tarantool. The ability to
override them with installed rock will make it possible to use old
Tarantool with new metrics.

1. tarantool/tarantool#7774
2. tarantool/tarantool#7725

Closes tarantool/tarantool#7727
  • Loading branch information
DifferentialOrange committed Mar 17, 2023
1 parent 47ae46a commit c0a3b30
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ jobs:
with:
module-name: 'metrics'
version-pre-extraction-hook: |
local rock_utils = require('test.rock_utils')
rock_utils.remove_builtin('metrics')
rock_utils.assert_nonbuiltin('metrics')
require('test.rock_utils').assert_nonbuiltin('metrics')
package:
# Skip pull request jobs when the source branch is in the same
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/push_rockspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ jobs:
with:
module-name: 'metrics'
version-pre-extraction-hook: |
local rock_utils = require('test.rock_utils')
rock_utils.remove_builtin('metrics')
rock_utils.assert_nonbuiltin('metrics')
require('test.rock_utils').assert_nonbuiltin('metrics')
push-scm-rockspec:
runs-on: [ ubuntu-20.04 ]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ doc/locale/en/
*.lua.c

build.luarocks
packpack
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- simultaneous `include` and `exclude` arguments
(`exclude` has higher priority)
- Build rock with cmake
- Override built-in metrics, if installed

### Deprecated
- Passing nonexistent metrics to `enable_default_metrics()`
Expand Down
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,8 @@ install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/cartridge
DESTINATION ${TARANTOOL_INSTALL_LUADIR}
)

install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}
DESTINATION ${TARANTOOL_INSTALL_LUADIR}/override
)
3 changes: 3 additions & 0 deletions rpm/tarantool-metrics.spec
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,13 @@ Easy collecting, storing and manipulating metrics timeseriess.
mkdir -p %{br_luapkgdir}
cp -rv metrics %{br_luapkgdir}
cp -rv cartridge %{br_luapkgdir}
mkdir %{br_luapkgdir}/override
cp -rv metrics %{br_luapkgdir}/override

%files
%{luapkgdir}/metrics
%{luapkgdir}/cartridge
%{luapkgdir}/override

%doc README.md
%doc doc/monitoring/getting_started.rst
Expand Down

0 comments on commit c0a3b30

Please sign in to comment.