@budibase/server 2.4.43 → 2.4.44-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/builder/assets/{index.8b377b88.js → index.76deb808.js} +385 -384
- package/builder/assets/index.7f9a008b.css +6 -0
- package/builder/index.html +7 -7
- package/dist/api/controllers/application.js +28 -24
- package/dist/api/controllers/public/metrics.js +113 -0
- package/dist/api/controllers/row/external.js +15 -0
- package/dist/api/controllers/static/index.js +84 -24
- package/dist/api/controllers/static/templates/BudibaseApp.svelte +34 -11
- package/dist/api/controllers/table/utils.js +2 -4
- package/dist/api/routes/public/index.js +8 -0
- package/dist/api/routes/public/metrics.js +30 -0
- package/dist/app.js +1 -0
- package/dist/integrations/googlesheets.js +4 -0
- package/dist/integrations/redis.js +1 -1
- package/dist/middleware/currentapp.js +1 -27
- package/dist/package.json +12 -11
- package/dist/sdk/users/utils.js +11 -6
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/utilities/fileSystem/app.js +1 -10
- package/dist/utilities/global.js +17 -7
- package/jest.config.ts +1 -0
- package/package.json +13 -12
- package/specs/openapi.json +39 -0
- package/specs/openapi.yaml +169 -0
- package/specs/resources/application.ts +11 -0
- package/specs/resources/index.ts +2 -0
- package/specs/resources/metrics.ts +81 -0
- package/src/api/controllers/application.ts +20 -21
- package/src/api/controllers/component.ts +2 -2
- package/src/api/controllers/public/metrics.ts +251 -0
- package/src/api/controllers/row/external.ts +14 -0
- package/src/api/controllers/static/index.ts +69 -26
- package/src/api/controllers/static/templates/BudibaseApp.svelte +34 -11
- package/src/api/controllers/table/tests/utils.spec.ts +97 -0
- package/src/api/controllers/table/utils.ts +20 -12
- package/src/api/controllers/view/tests/__snapshots__/viewBuilder.spec.js.snap +48 -48
- package/src/api/routes/public/index.ts +10 -1
- package/src/api/routes/public/metrics.ts +28 -0
- package/src/api/routes/public/tests/metrics.spec.js +34 -0
- package/src/api/routes/tests/__snapshots__/datasource.spec.ts.snap +22 -22
- package/src/api/routes/tests/__snapshots__/view.spec.js.snap +5 -5
- package/src/api/routes/tests/appSync.spec.ts +1 -1
- package/src/api/routes/tests/internalSearch.spec.js +6 -6
- package/src/api/routes/tests/user.spec.js +2 -2
- package/src/app.ts +2 -1
- package/src/automations/automationUtils.ts +1 -1
- package/src/automations/tests/automation.spec.ts +99 -0
- package/src/db/defaultData/datasource_bb_default.ts +1 -1
- package/src/definitions/openapi.ts +15 -0
- package/src/integrations/googlesheets.ts +4 -0
- package/src/integrations/redis.ts +1 -1
- package/src/integrations/tests/googlesheets.spec.ts +4 -0
- package/src/integrations/tests/redis.spec.ts +9 -5
- package/src/middleware/currentapp.ts +3 -32
- package/src/middleware/tests/currentapp.spec.js +6 -42
- package/src/sdk/users/tests/utils.spec.ts +159 -0
- package/src/sdk/users/utils.ts +18 -7
- package/src/tests/jestSetup.ts +5 -1
- package/src/tests/utilities/TestConfiguration.ts +7 -19
- package/src/tests/utilities/structures.ts +13 -1
- package/src/utilities/fileSystem/app.ts +2 -9
- package/src/utilities/global.ts +21 -9
- package/src/utilities/rowProcessor/index.ts +1 -1
- package/builder/assets/favicon.e7fc7733.png +0 -0
- package/builder/assets/index.b0e3aca6.css +0 -6
- package/src/automations/tests/automation.spec.js +0 -84
|
@@ -46,16 +46,7 @@ exports.deleteApp = deleteApp;
|
|
|
46
46
|
const getComponentLibraryManifest = (library) => __awaiter(void 0, void 0, void 0, function* () {
|
|
47
47
|
const appId = backend_core_1.context.getAppId();
|
|
48
48
|
const filename = "manifest.json";
|
|
49
|
-
|
|
50
|
-
// when testing in cypress and so on we need to get the package
|
|
51
|
-
// as the environment may not be fully fleshed out for dev or prod
|
|
52
|
-
if (environment_1.default.isTest()) {
|
|
53
|
-
library = library.replace("standard-components", "client");
|
|
54
|
-
const lib = library.split("/")[1];
|
|
55
|
-
const path = require.resolve(library).split(lib)[0];
|
|
56
|
-
return require((0, path_1.join)(path, lib, filename));
|
|
57
|
-
}
|
|
58
|
-
else if (environment_1.default.isDev()) {
|
|
49
|
+
if (environment_1.default.isDev() || environment_1.default.isTest()) {
|
|
59
50
|
const path = (0, path_1.join)(exports.NODE_MODULES_PATH, "@budibase", "client", filename);
|
|
60
51
|
// always load from new so that updates are refreshed
|
|
61
52
|
delete require.cache[require.resolve(path)];
|
package/dist/utilities/global.js
CHANGED
|
@@ -45,26 +45,33 @@ function updateAppRole(user, { appId } = {}) {
|
|
|
45
45
|
return user;
|
|
46
46
|
}
|
|
47
47
|
exports.updateAppRole = updateAppRole;
|
|
48
|
-
function checkGroupRoles(user,
|
|
48
|
+
function checkGroupRoles(user, opts = {}) {
|
|
49
49
|
return __awaiter(this, void 0, void 0, function* () {
|
|
50
50
|
if (user.roleId && user.roleId !== backend_core_1.roles.BUILTIN_ROLE_IDS.PUBLIC) {
|
|
51
51
|
return user;
|
|
52
52
|
}
|
|
53
|
-
if (appId) {
|
|
54
|
-
user.roleId = yield pro_1.groups.getGroupRoleId(user, appId
|
|
53
|
+
if (opts.appId) {
|
|
54
|
+
user.roleId = yield pro_1.groups.getGroupRoleId(user, opts.appId, {
|
|
55
|
+
groups: opts.groups,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
// final fallback, simply couldn't find a role - user must be public
|
|
59
|
+
if (!user.roleId) {
|
|
60
|
+
user.roleId = backend_core_1.roles.BUILTIN_ROLE_IDS.PUBLIC;
|
|
55
61
|
}
|
|
56
62
|
return user;
|
|
57
63
|
});
|
|
58
64
|
}
|
|
59
|
-
function processUser(user,
|
|
65
|
+
function processUser(user, opts = {}) {
|
|
60
66
|
var _a;
|
|
61
67
|
return __awaiter(this, void 0, void 0, function* () {
|
|
62
68
|
if (user) {
|
|
63
69
|
delete user.password;
|
|
64
70
|
}
|
|
65
|
-
|
|
71
|
+
const appId = opts.appId || backend_core_1.context.getAppId();
|
|
72
|
+
user = updateAppRole(user, { appId });
|
|
66
73
|
if (!user.roleId && ((_a = user === null || user === void 0 ? void 0 : user.userGroups) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
67
|
-
user = yield checkGroupRoles(user, { appId });
|
|
74
|
+
user = yield checkGroupRoles(user, { appId, groups: opts === null || opts === void 0 ? void 0 : opts.groups });
|
|
68
75
|
}
|
|
69
76
|
return user;
|
|
70
77
|
});
|
|
@@ -98,6 +105,7 @@ function getGlobalUsers(users) {
|
|
|
98
105
|
return __awaiter(this, void 0, void 0, function* () {
|
|
99
106
|
const appId = backend_core_1.context.getAppId();
|
|
100
107
|
const db = backend_core_1.tenancy.getGlobalDB();
|
|
108
|
+
const allGroups = yield pro_1.groups.fetch();
|
|
101
109
|
let globalUsers;
|
|
102
110
|
if (users) {
|
|
103
111
|
const globalIds = users.map(user => (0, utils_1.getGlobalIDFromUserMetadataID)(user._id));
|
|
@@ -118,7 +126,9 @@ function getGlobalUsers(users) {
|
|
|
118
126
|
if (!appId) {
|
|
119
127
|
return globalUsers;
|
|
120
128
|
}
|
|
121
|
-
|
|
129
|
+
// pass in the groups, meaning we don't actually need to retrieve them for
|
|
130
|
+
// each user individually
|
|
131
|
+
return Promise.all(globalUsers.map(user => processUser(user, { groups: allGroups })));
|
|
122
132
|
});
|
|
123
133
|
}
|
|
124
134
|
exports.getGlobalUsers = getGlobalUsers;
|
package/jest.config.ts
CHANGED
|
@@ -43,6 +43,7 @@ const config: Config.InitialOptions = {
|
|
|
43
43
|
"../backend-core/src/**/*.{js,ts}",
|
|
44
44
|
// The use of coverage with couchdb view functions breaks tests
|
|
45
45
|
"!src/db/views/staticViews.*",
|
|
46
|
+
"!src/**/*.spec.{js,ts}",
|
|
46
47
|
"!src/tests/**/*.{js,ts}",
|
|
47
48
|
],
|
|
48
49
|
coverageReporters: ["lcov", "json", "clover"],
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/server",
|
|
3
3
|
"email": "hi@budibase.com",
|
|
4
|
-
"version": "2.4.
|
|
4
|
+
"version": "2.4.44-alpha.1",
|
|
5
5
|
"description": "Budibase Web Server",
|
|
6
6
|
"main": "src/index.ts",
|
|
7
7
|
"repository": {
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"debug": "yarn build && node --expose-gc --inspect=9222 dist/index.js",
|
|
16
16
|
"postbuild": "copyfiles -u 1 src/**/*.svelte dist/ && copyfiles -u 1 src/**/*.hbs dist/ && copyfiles -u 1 src/**/*.json dist/",
|
|
17
17
|
"test": "bash scripts/test.sh",
|
|
18
|
+
"test:memory": "jest --maxWorkers=2 --logHeapUsage --forceExit",
|
|
18
19
|
"test:watch": "jest --watch",
|
|
19
20
|
"predocker": "copyfiles -f ../client/dist/budibase-client.js ../client/manifest.json client",
|
|
20
21
|
"build:docker": "yarn run predocker && docker build . -t app-service --label version=$BUDIBASE_RELEASE_VERSION",
|
|
@@ -43,12 +44,12 @@
|
|
|
43
44
|
"license": "GPL-3.0",
|
|
44
45
|
"dependencies": {
|
|
45
46
|
"@apidevtools/swagger-parser": "10.0.3",
|
|
46
|
-
"@budibase/backend-core": "
|
|
47
|
-
"@budibase/client": "
|
|
48
|
-
"@budibase/pro": "2.4.
|
|
49
|
-
"@budibase/shared-core": "
|
|
50
|
-
"@budibase/string-templates": "
|
|
51
|
-
"@budibase/types": "
|
|
47
|
+
"@budibase/backend-core": "2.4.44-alpha.1",
|
|
48
|
+
"@budibase/client": "2.4.44-alpha.1",
|
|
49
|
+
"@budibase/pro": "2.4.44-alpha.0",
|
|
50
|
+
"@budibase/shared-core": "2.4.44-alpha.1",
|
|
51
|
+
"@budibase/string-templates": "2.4.44-alpha.1",
|
|
52
|
+
"@budibase/types": "2.4.44-alpha.1",
|
|
52
53
|
"@bull-board/api": "3.7.0",
|
|
53
54
|
"@bull-board/koa": "3.9.4",
|
|
54
55
|
"@elastic/elasticsearch": "7.10.0",
|
|
@@ -125,7 +126,7 @@
|
|
|
125
126
|
"@babel/core": "7.17.4",
|
|
126
127
|
"@babel/preset-env": "7.16.11",
|
|
127
128
|
"@budibase/standard-components": "^0.9.139",
|
|
128
|
-
"@jest/test-sequencer": "
|
|
129
|
+
"@jest/test-sequencer": "29.5.0",
|
|
129
130
|
"@swc/core": "^1.3.25",
|
|
130
131
|
"@swc/jest": "^0.2.24",
|
|
131
132
|
"@trendyol/jest-testcontainers": "^2.1.1",
|
|
@@ -134,7 +135,7 @@
|
|
|
134
135
|
"@types/global-agent": "2.1.1",
|
|
135
136
|
"@types/google-spreadsheet": "3.1.5",
|
|
136
137
|
"@types/ioredis": "4.28.10",
|
|
137
|
-
"@types/jest": "
|
|
138
|
+
"@types/jest": "29.5.0",
|
|
138
139
|
"@types/koa": "2.13.4",
|
|
139
140
|
"@types/koa__router": "8.0.8",
|
|
140
141
|
"@types/lodash": "4.14.180",
|
|
@@ -154,7 +155,7 @@
|
|
|
154
155
|
"eslint": "6.8.0",
|
|
155
156
|
"ioredis-mock": "7.2.0",
|
|
156
157
|
"is-wsl": "2.2.0",
|
|
157
|
-
"jest": "
|
|
158
|
+
"jest": "29.5.0",
|
|
158
159
|
"jest-openapi": "0.14.2",
|
|
159
160
|
"jest-serial-runner": "^1.2.1",
|
|
160
161
|
"nodemon": "2.0.15",
|
|
@@ -166,7 +167,7 @@
|
|
|
166
167
|
"supertest": "6.2.2",
|
|
167
168
|
"swagger-jsdoc": "6.1.0",
|
|
168
169
|
"timekeeper": "2.2.0",
|
|
169
|
-
"ts-jest": "
|
|
170
|
+
"ts-jest": "29.0.5",
|
|
170
171
|
"ts-node": "10.8.1",
|
|
171
172
|
"tsconfig-paths": "4.0.0",
|
|
172
173
|
"typescript": "4.7.3",
|
|
@@ -175,5 +176,5 @@
|
|
|
175
176
|
"optionalDependencies": {
|
|
176
177
|
"oracledb": "5.3.0"
|
|
177
178
|
},
|
|
178
|
-
"gitHead": "
|
|
179
|
+
"gitHead": "2597bbe05cd384874fad4f4da9ffd525117dcacf"
|
|
179
180
|
}
|
package/specs/openapi.json
CHANGED
|
@@ -115,6 +115,15 @@
|
|
|
115
115
|
]
|
|
116
116
|
}
|
|
117
117
|
},
|
|
118
|
+
"deploymentOutput": {
|
|
119
|
+
"value": {
|
|
120
|
+
"data": {
|
|
121
|
+
"_id": "ef12381f934b4f129675cdbb76eff3c2",
|
|
122
|
+
"status": "SUCCESS",
|
|
123
|
+
"appUrl": "/app-url"
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
118
127
|
"inputRow": {
|
|
119
128
|
"value": {
|
|
120
129
|
"_id": "ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4",
|
|
@@ -413,6 +422,9 @@
|
|
|
413
422
|
}
|
|
414
423
|
]
|
|
415
424
|
}
|
|
425
|
+
},
|
|
426
|
+
"metrics": {
|
|
427
|
+
"value": "# HELP budibase_os_uptime Time in seconds that the host operating system has been up.\n# TYPE budibase_os_uptime counter\nbudibase_os_uptime 54958\n# HELP budibase_os_free_mem Bytes of memory free for usage on the host operating system.\n# TYPE budibase_os_free_mem gauge\nbudibase_os_free_mem 804507648\n# HELP budibase_os_total_mem Total bytes of memory on the host operating system.\n# TYPE budibase_os_total_mem gauge\nbudibase_os_total_mem 16742404096\n# HELP budibase_os_used_mem Total bytes of memory in use on the host operating system.\n# TYPE budibase_os_used_mem gauge\nbudibase_os_used_mem 15937896448\n# HELP budibase_os_load1 Host operating system load average.\n# TYPE budibase_os_load1 gauge\nbudibase_os_load1 1.91\n# HELP budibase_os_load5 Host operating system load average.\n# TYPE budibase_os_load5 gauge\nbudibase_os_load5 1.75\n# HELP budibase_os_load15 Host operating system load average.\n# TYPE budibase_os_load15 gauge\nbudibase_os_load15 1.56\n# HELP budibase_tenant_user_count The number of users created.\n# TYPE budibase_tenant_user_count gauge\nbudibase_tenant_user_count 1\n# HELP budibase_tenant_app_count The number of apps created by a user.\n# TYPE budibase_tenant_app_count gauge\nbudibase_tenant_app_count 2\n# HELP budibase_tenant_production_app_count The number of apps a user has published.\n# TYPE budibase_tenant_production_app_count gauge\nbudibase_tenant_production_app_count 1\n# HELP budibase_tenant_dev_app_count The number of apps a user has unpublished in development.\n# TYPE budibase_tenant_dev_app_count gauge\nbudibase_tenant_dev_app_count 1\n# HELP budibase_tenant_db_count The number of couchdb databases including global tables such as _users.\n# TYPE budibase_tenant_db_count gauge\nbudibase_tenant_db_count 3\n# HELP budibase_quota_usage_apps The number of apps created.\n# TYPE budibase_quota_usage_apps gauge\nbudibase_quota_usage_apps 1\n# HELP budibase_quota_limit_apps The limit on the number of apps that can be created.\n# TYPE budibase_quota_limit_apps gauge\nbudibase_quota_limit_apps 9007199254740991\n# HELP budibase_quota_usage_rows The number of database rows used from the quota.\n# TYPE budibase_quota_usage_rows gauge\nbudibase_quota_usage_rows 0\n# HELP budibase_quota_limit_rows The limit on the number of rows that can be created.\n# TYPE budibase_quota_limit_rows gauge\nbudibase_quota_limit_rows 9007199254740991\n# HELP budibase_quota_usage_plugins The number of plugins in use.\n# TYPE budibase_quota_usage_plugins gauge\nbudibase_quota_usage_plugins 0\n# HELP budibase_quota_limit_plugins The limit on the number of plugins that can be created.\n# TYPE budibase_quota_limit_plugins gauge\nbudibase_quota_limit_plugins 9007199254740991\n# HELP budibase_quota_usage_user_groups The number of user groups created.\n# TYPE budibase_quota_usage_user_groups gauge\nbudibase_quota_usage_user_groups 0\n# HELP budibase_quota_limit_user_groups The limit on the number of user groups that can be created.\n# TYPE budibase_quota_limit_user_groups gauge\nbudibase_quota_limit_user_groups 9007199254740991\n# HELP budibase_quota_usage_queries The number of queries used in the current month.\n# TYPE budibase_quota_usage_queries gauge\nbudibase_quota_usage_queries 0\n# HELP budibase_quota_limit_queries The limit on the number of queries for the current month.\n# TYPE budibase_quota_limit_queries gauge\nbudibase_quota_limit_queries 9007199254740991\n# HELP budibase_quota_usage_automations The number of automations used in the current month.\n# TYPE budibase_quota_usage_automations gauge\nbudibase_quota_usage_automations 0\n# HELP budibase_quota_limit_automations The limit on the number of automations that can be created.\n# TYPE budibase_quota_limit_automations gauge\nbudibase_quota_limit_automations 9007199254740991\n"
|
|
416
428
|
}
|
|
417
429
|
},
|
|
418
430
|
"securitySchemes": {
|
|
@@ -2054,6 +2066,33 @@
|
|
|
2054
2066
|
}
|
|
2055
2067
|
}
|
|
2056
2068
|
},
|
|
2069
|
+
"/metrics": {
|
|
2070
|
+
"get": {
|
|
2071
|
+
"operationId": "metricsGet",
|
|
2072
|
+
"summary": "Retrieve Budibase tenant metrics",
|
|
2073
|
+
"description": "Output metrics in OpenMetrics format compatible with Prometheus",
|
|
2074
|
+
"tags": [
|
|
2075
|
+
"metrics"
|
|
2076
|
+
],
|
|
2077
|
+
"responses": {
|
|
2078
|
+
"200": {
|
|
2079
|
+
"description": "Returns tenant metrics.",
|
|
2080
|
+
"content": {
|
|
2081
|
+
"text/plain": {
|
|
2082
|
+
"schema": {
|
|
2083
|
+
"type": "string"
|
|
2084
|
+
},
|
|
2085
|
+
"examples": {
|
|
2086
|
+
"metrics": {
|
|
2087
|
+
"$ref": "#/components/examples/metrics"
|
|
2088
|
+
}
|
|
2089
|
+
}
|
|
2090
|
+
}
|
|
2091
|
+
}
|
|
2092
|
+
}
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
},
|
|
2057
2096
|
"/queries/{queryId}": {
|
|
2058
2097
|
"post": {
|
|
2059
2098
|
"operationId": "queryExecute",
|
package/specs/openapi.yaml
CHANGED
|
@@ -85,6 +85,12 @@ components:
|
|
|
85
85
|
updatedAt: 2022-02-22T13:00:54.035Z
|
|
86
86
|
createdAt: 2022-02-11T18:02:26.961Z
|
|
87
87
|
status: development
|
|
88
|
+
deploymentOutput:
|
|
89
|
+
value:
|
|
90
|
+
data:
|
|
91
|
+
_id: ef12381f934b4f129675cdbb76eff3c2
|
|
92
|
+
status: SUCCESS
|
|
93
|
+
appUrl: /app-url
|
|
88
94
|
inputRow:
|
|
89
95
|
value:
|
|
90
96
|
_id: ro_ta_5b1649e42a5b41dea4ef7742a36a7a70_e6dc7e38cf1343b2b56760265201cda4
|
|
@@ -290,6 +296,152 @@ components:
|
|
|
290
296
|
name: Admin
|
|
291
297
|
permissionId: admin
|
|
292
298
|
inherits: POWER
|
|
299
|
+
metrics:
|
|
300
|
+
value: >
|
|
301
|
+
# HELP budibase_os_uptime Time in seconds that the host operating system
|
|
302
|
+
has been up.
|
|
303
|
+
|
|
304
|
+
# TYPE budibase_os_uptime counter
|
|
305
|
+
|
|
306
|
+
budibase_os_uptime 54958
|
|
307
|
+
|
|
308
|
+
# HELP budibase_os_free_mem Bytes of memory free for usage on the host operating system.
|
|
309
|
+
|
|
310
|
+
# TYPE budibase_os_free_mem gauge
|
|
311
|
+
|
|
312
|
+
budibase_os_free_mem 804507648
|
|
313
|
+
|
|
314
|
+
# HELP budibase_os_total_mem Total bytes of memory on the host operating system.
|
|
315
|
+
|
|
316
|
+
# TYPE budibase_os_total_mem gauge
|
|
317
|
+
|
|
318
|
+
budibase_os_total_mem 16742404096
|
|
319
|
+
|
|
320
|
+
# HELP budibase_os_used_mem Total bytes of memory in use on the host operating system.
|
|
321
|
+
|
|
322
|
+
# TYPE budibase_os_used_mem gauge
|
|
323
|
+
|
|
324
|
+
budibase_os_used_mem 15937896448
|
|
325
|
+
|
|
326
|
+
# HELP budibase_os_load1 Host operating system load average.
|
|
327
|
+
|
|
328
|
+
# TYPE budibase_os_load1 gauge
|
|
329
|
+
|
|
330
|
+
budibase_os_load1 1.91
|
|
331
|
+
|
|
332
|
+
# HELP budibase_os_load5 Host operating system load average.
|
|
333
|
+
|
|
334
|
+
# TYPE budibase_os_load5 gauge
|
|
335
|
+
|
|
336
|
+
budibase_os_load5 1.75
|
|
337
|
+
|
|
338
|
+
# HELP budibase_os_load15 Host operating system load average.
|
|
339
|
+
|
|
340
|
+
# TYPE budibase_os_load15 gauge
|
|
341
|
+
|
|
342
|
+
budibase_os_load15 1.56
|
|
343
|
+
|
|
344
|
+
# HELP budibase_tenant_user_count The number of users created.
|
|
345
|
+
|
|
346
|
+
# TYPE budibase_tenant_user_count gauge
|
|
347
|
+
|
|
348
|
+
budibase_tenant_user_count 1
|
|
349
|
+
|
|
350
|
+
# HELP budibase_tenant_app_count The number of apps created by a user.
|
|
351
|
+
|
|
352
|
+
# TYPE budibase_tenant_app_count gauge
|
|
353
|
+
|
|
354
|
+
budibase_tenant_app_count 2
|
|
355
|
+
|
|
356
|
+
# HELP budibase_tenant_production_app_count The number of apps a user has published.
|
|
357
|
+
|
|
358
|
+
# TYPE budibase_tenant_production_app_count gauge
|
|
359
|
+
|
|
360
|
+
budibase_tenant_production_app_count 1
|
|
361
|
+
|
|
362
|
+
# HELP budibase_tenant_dev_app_count The number of apps a user has unpublished in development.
|
|
363
|
+
|
|
364
|
+
# TYPE budibase_tenant_dev_app_count gauge
|
|
365
|
+
|
|
366
|
+
budibase_tenant_dev_app_count 1
|
|
367
|
+
|
|
368
|
+
# HELP budibase_tenant_db_count The number of couchdb databases including global tables such as _users.
|
|
369
|
+
|
|
370
|
+
# TYPE budibase_tenant_db_count gauge
|
|
371
|
+
|
|
372
|
+
budibase_tenant_db_count 3
|
|
373
|
+
|
|
374
|
+
# HELP budibase_quota_usage_apps The number of apps created.
|
|
375
|
+
|
|
376
|
+
# TYPE budibase_quota_usage_apps gauge
|
|
377
|
+
|
|
378
|
+
budibase_quota_usage_apps 1
|
|
379
|
+
|
|
380
|
+
# HELP budibase_quota_limit_apps The limit on the number of apps that can be created.
|
|
381
|
+
|
|
382
|
+
# TYPE budibase_quota_limit_apps gauge
|
|
383
|
+
|
|
384
|
+
budibase_quota_limit_apps 9007199254740991
|
|
385
|
+
|
|
386
|
+
# HELP budibase_quota_usage_rows The number of database rows used from the quota.
|
|
387
|
+
|
|
388
|
+
# TYPE budibase_quota_usage_rows gauge
|
|
389
|
+
|
|
390
|
+
budibase_quota_usage_rows 0
|
|
391
|
+
|
|
392
|
+
# HELP budibase_quota_limit_rows The limit on the number of rows that can be created.
|
|
393
|
+
|
|
394
|
+
# TYPE budibase_quota_limit_rows gauge
|
|
395
|
+
|
|
396
|
+
budibase_quota_limit_rows 9007199254740991
|
|
397
|
+
|
|
398
|
+
# HELP budibase_quota_usage_plugins The number of plugins in use.
|
|
399
|
+
|
|
400
|
+
# TYPE budibase_quota_usage_plugins gauge
|
|
401
|
+
|
|
402
|
+
budibase_quota_usage_plugins 0
|
|
403
|
+
|
|
404
|
+
# HELP budibase_quota_limit_plugins The limit on the number of plugins that can be created.
|
|
405
|
+
|
|
406
|
+
# TYPE budibase_quota_limit_plugins gauge
|
|
407
|
+
|
|
408
|
+
budibase_quota_limit_plugins 9007199254740991
|
|
409
|
+
|
|
410
|
+
# HELP budibase_quota_usage_user_groups The number of user groups created.
|
|
411
|
+
|
|
412
|
+
# TYPE budibase_quota_usage_user_groups gauge
|
|
413
|
+
|
|
414
|
+
budibase_quota_usage_user_groups 0
|
|
415
|
+
|
|
416
|
+
# HELP budibase_quota_limit_user_groups The limit on the number of user groups that can be created.
|
|
417
|
+
|
|
418
|
+
# TYPE budibase_quota_limit_user_groups gauge
|
|
419
|
+
|
|
420
|
+
budibase_quota_limit_user_groups 9007199254740991
|
|
421
|
+
|
|
422
|
+
# HELP budibase_quota_usage_queries The number of queries used in the current month.
|
|
423
|
+
|
|
424
|
+
# TYPE budibase_quota_usage_queries gauge
|
|
425
|
+
|
|
426
|
+
budibase_quota_usage_queries 0
|
|
427
|
+
|
|
428
|
+
# HELP budibase_quota_limit_queries The limit on the number of queries for the current month.
|
|
429
|
+
|
|
430
|
+
# TYPE budibase_quota_limit_queries gauge
|
|
431
|
+
|
|
432
|
+
budibase_quota_limit_queries 9007199254740991
|
|
433
|
+
|
|
434
|
+
# HELP budibase_quota_usage_automations The number of automations used in the current month.
|
|
435
|
+
|
|
436
|
+
# TYPE budibase_quota_usage_automations gauge
|
|
437
|
+
|
|
438
|
+
budibase_quota_usage_automations 0
|
|
439
|
+
|
|
440
|
+
# HELP budibase_quota_limit_automations The limit on the number of automations that can be created.
|
|
441
|
+
|
|
442
|
+
# TYPE budibase_quota_limit_automations gauge
|
|
443
|
+
|
|
444
|
+
budibase_quota_limit_automations 9007199254740991
|
|
293
445
|
securitySchemes:
|
|
294
446
|
ApiKeyAuth:
|
|
295
447
|
type: apiKey
|
|
@@ -1531,6 +1683,23 @@ paths:
|
|
|
1531
1683
|
examples:
|
|
1532
1684
|
applications:
|
|
1533
1685
|
$ref: "#/components/examples/applications"
|
|
1686
|
+
/metrics:
|
|
1687
|
+
get:
|
|
1688
|
+
operationId: metricsGet
|
|
1689
|
+
summary: Retrieve Budibase tenant metrics
|
|
1690
|
+
description: Output metrics in OpenMetrics format compatible with Prometheus
|
|
1691
|
+
tags:
|
|
1692
|
+
- metrics
|
|
1693
|
+
responses:
|
|
1694
|
+
"200":
|
|
1695
|
+
description: Returns tenant metrics.
|
|
1696
|
+
content:
|
|
1697
|
+
text/plain:
|
|
1698
|
+
schema:
|
|
1699
|
+
type: string
|
|
1700
|
+
examples:
|
|
1701
|
+
metrics:
|
|
1702
|
+
$ref: "#/components/examples/metrics"
|
|
1534
1703
|
"/queries/{queryId}":
|
|
1535
1704
|
post:
|
|
1536
1705
|
operationId: queryExecute
|
|
@@ -15,6 +15,12 @@ const application = {
|
|
|
15
15
|
lockedBy: userResource.getExamples().user.value.user,
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
const deployment = {
|
|
19
|
+
_id: "ef12381f934b4f129675cdbb76eff3c2",
|
|
20
|
+
status: "SUCCESS",
|
|
21
|
+
appUrl: "/app-url",
|
|
22
|
+
}
|
|
23
|
+
|
|
18
24
|
const base = {
|
|
19
25
|
name: {
|
|
20
26
|
description: "The name of the app.",
|
|
@@ -108,6 +114,11 @@ export default new Resource()
|
|
|
108
114
|
data: [application],
|
|
109
115
|
},
|
|
110
116
|
},
|
|
117
|
+
deploymentOutput: {
|
|
118
|
+
value: {
|
|
119
|
+
data: deployment,
|
|
120
|
+
},
|
|
121
|
+
},
|
|
111
122
|
})
|
|
112
123
|
.setSchemas({
|
|
113
124
|
application: applicationSchema,
|
package/specs/resources/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ import row from "./row"
|
|
|
3
3
|
import table from "./table"
|
|
4
4
|
import query from "./query"
|
|
5
5
|
import user from "./user"
|
|
6
|
+
import metrics from "./metrics"
|
|
6
7
|
import misc from "./misc"
|
|
7
8
|
|
|
8
9
|
export const examples = {
|
|
@@ -12,6 +13,7 @@ export const examples = {
|
|
|
12
13
|
...query.getExamples(),
|
|
13
14
|
...user.getExamples(),
|
|
14
15
|
...misc.getExamples(),
|
|
16
|
+
...metrics.getExamples(),
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
export const schemas = {
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import Resource from "./utils/Resource"
|
|
2
|
+
|
|
3
|
+
const metricsResponse =
|
|
4
|
+
"# HELP budibase_os_uptime Time in seconds that the host operating system has been up.\n" +
|
|
5
|
+
"# TYPE budibase_os_uptime counter\n" +
|
|
6
|
+
"budibase_os_uptime 54958\n" +
|
|
7
|
+
"# HELP budibase_os_free_mem Bytes of memory free for usage on the host operating system.\n" +
|
|
8
|
+
"# TYPE budibase_os_free_mem gauge\n" +
|
|
9
|
+
"budibase_os_free_mem 804507648\n" +
|
|
10
|
+
"# HELP budibase_os_total_mem Total bytes of memory on the host operating system.\n" +
|
|
11
|
+
"# TYPE budibase_os_total_mem gauge\n" +
|
|
12
|
+
"budibase_os_total_mem 16742404096\n" +
|
|
13
|
+
"# HELP budibase_os_used_mem Total bytes of memory in use on the host operating system.\n" +
|
|
14
|
+
"# TYPE budibase_os_used_mem gauge\n" +
|
|
15
|
+
"budibase_os_used_mem 15937896448\n" +
|
|
16
|
+
"# HELP budibase_os_load1 Host operating system load average.\n" +
|
|
17
|
+
"# TYPE budibase_os_load1 gauge\n" +
|
|
18
|
+
"budibase_os_load1 1.91\n" +
|
|
19
|
+
"# HELP budibase_os_load5 Host operating system load average.\n" +
|
|
20
|
+
"# TYPE budibase_os_load5 gauge\n" +
|
|
21
|
+
"budibase_os_load5 1.75\n" +
|
|
22
|
+
"# HELP budibase_os_load15 Host operating system load average.\n" +
|
|
23
|
+
"# TYPE budibase_os_load15 gauge\n" +
|
|
24
|
+
"budibase_os_load15 1.56\n" +
|
|
25
|
+
"# HELP budibase_tenant_user_count The number of users created.\n" +
|
|
26
|
+
"# TYPE budibase_tenant_user_count gauge\n" +
|
|
27
|
+
"budibase_tenant_user_count 1\n" +
|
|
28
|
+
"# HELP budibase_tenant_app_count The number of apps created by a user.\n" +
|
|
29
|
+
"# TYPE budibase_tenant_app_count gauge\n" +
|
|
30
|
+
"budibase_tenant_app_count 2\n" +
|
|
31
|
+
"# HELP budibase_tenant_production_app_count The number of apps a user has published.\n" +
|
|
32
|
+
"# TYPE budibase_tenant_production_app_count gauge\n" +
|
|
33
|
+
"budibase_tenant_production_app_count 1\n" +
|
|
34
|
+
"# HELP budibase_tenant_dev_app_count The number of apps a user has unpublished in development.\n" +
|
|
35
|
+
"# TYPE budibase_tenant_dev_app_count gauge\n" +
|
|
36
|
+
"budibase_tenant_dev_app_count 1\n" +
|
|
37
|
+
"# HELP budibase_tenant_db_count The number of couchdb databases including global tables such as _users.\n" +
|
|
38
|
+
"# TYPE budibase_tenant_db_count gauge\n" +
|
|
39
|
+
"budibase_tenant_db_count 3\n" +
|
|
40
|
+
"# HELP budibase_quota_usage_apps The number of apps created.\n" +
|
|
41
|
+
"# TYPE budibase_quota_usage_apps gauge\n" +
|
|
42
|
+
"budibase_quota_usage_apps 1\n" +
|
|
43
|
+
"# HELP budibase_quota_limit_apps The limit on the number of apps that can be created.\n" +
|
|
44
|
+
"# TYPE budibase_quota_limit_apps gauge\n" +
|
|
45
|
+
"budibase_quota_limit_apps 9007199254740991\n" +
|
|
46
|
+
"# HELP budibase_quota_usage_rows The number of database rows used from the quota.\n" +
|
|
47
|
+
"# TYPE budibase_quota_usage_rows gauge\n" +
|
|
48
|
+
"budibase_quota_usage_rows 0\n" +
|
|
49
|
+
"# HELP budibase_quota_limit_rows The limit on the number of rows that can be created.\n" +
|
|
50
|
+
"# TYPE budibase_quota_limit_rows gauge\n" +
|
|
51
|
+
"budibase_quota_limit_rows 9007199254740991\n" +
|
|
52
|
+
"# HELP budibase_quota_usage_plugins The number of plugins in use.\n" +
|
|
53
|
+
"# TYPE budibase_quota_usage_plugins gauge\n" +
|
|
54
|
+
"budibase_quota_usage_plugins 0\n" +
|
|
55
|
+
"# HELP budibase_quota_limit_plugins The limit on the number of plugins that can be created.\n" +
|
|
56
|
+
"# TYPE budibase_quota_limit_plugins gauge\n" +
|
|
57
|
+
"budibase_quota_limit_plugins 9007199254740991\n" +
|
|
58
|
+
"# HELP budibase_quota_usage_user_groups The number of user groups created.\n" +
|
|
59
|
+
"# TYPE budibase_quota_usage_user_groups gauge\n" +
|
|
60
|
+
"budibase_quota_usage_user_groups 0\n" +
|
|
61
|
+
"# HELP budibase_quota_limit_user_groups The limit on the number of user groups that can be created.\n" +
|
|
62
|
+
"# TYPE budibase_quota_limit_user_groups gauge\n" +
|
|
63
|
+
"budibase_quota_limit_user_groups 9007199254740991\n" +
|
|
64
|
+
"# HELP budibase_quota_usage_queries The number of queries used in the current month.\n" +
|
|
65
|
+
"# TYPE budibase_quota_usage_queries gauge\n" +
|
|
66
|
+
"budibase_quota_usage_queries 0\n" +
|
|
67
|
+
"# HELP budibase_quota_limit_queries The limit on the number of queries for the current month.\n" +
|
|
68
|
+
"# TYPE budibase_quota_limit_queries gauge\n" +
|
|
69
|
+
"budibase_quota_limit_queries 9007199254740991\n" +
|
|
70
|
+
"# HELP budibase_quota_usage_automations The number of automations used in the current month.\n" +
|
|
71
|
+
"# TYPE budibase_quota_usage_automations gauge\n" +
|
|
72
|
+
"budibase_quota_usage_automations 0\n" +
|
|
73
|
+
"# HELP budibase_quota_limit_automations The limit on the number of automations that can be created.\n" +
|
|
74
|
+
"# TYPE budibase_quota_limit_automations gauge\n" +
|
|
75
|
+
"budibase_quota_limit_automations 9007199254740991\n"
|
|
76
|
+
|
|
77
|
+
export default new Resource().setExamples({
|
|
78
|
+
metrics: {
|
|
79
|
+
value: metricsResponse,
|
|
80
|
+
},
|
|
81
|
+
})
|