reduce metric cardinaility
Some checks failed
Lint / pnpm_install (push) Successful in 2m16s
Test (production install and build) / production (22.11.0) (push) Successful in 1m21s
Publish Docker image / Build (push) Successful in 6m2s
Lint / lint (backend) (push) Failing after 2m43s
Lint / lint (frontend) (push) Failing after 2m42s
Lint / lint (frontend-embed) (push) Successful in 2m45s
Lint / lint (frontend-shared) (push) Successful in 2m36s
Lint / lint (misskey-bubble-game) (push) Successful in 2m53s
Lint / lint (misskey-js) (push) Successful in 2m44s
Test (backend) / unit (22.11.0) (push) Failing after 14m28s
Lint / lint (misskey-reversi) (push) Successful in 2m59s
Lint / lint (sw) (push) Successful in 3m4s
Lint / typecheck (misskey-js) (push) Successful in 2m12s
Lint / typecheck (backend) (push) Has been cancelled
Lint / typecheck (sw) (push) Has been cancelled
Lint / pnpm_install (pull_request) Successful in 2m53s
Test (production install and build) / production (22.11.0) (pull_request) Successful in 1m15s
Publish Docker image / Build (pull_request) Successful in 6m51s
Lint / lint (backend) (pull_request) Failing after 2m30s
Test (backend) / unit (22.11.0) (pull_request) Failing after 15m4s
Lint / lint (frontend) (pull_request) Failing after 2m31s
Lint / lint (frontend-embed) (pull_request) Successful in 2m38s
Lint / lint (frontend-shared) (pull_request) Successful in 2m46s
Lint / lint (misskey-bubble-game) (pull_request) Successful in 2m38s
Lint / lint (misskey-js) (pull_request) Successful in 2m41s
Lint / lint (misskey-reversi) (pull_request) Successful in 2m48s
Lint / lint (sw) (pull_request) Successful in 3m25s
Lint / typecheck (misskey-js) (pull_request) Successful in 2m37s
Lint / typecheck (sw) (pull_request) Successful in 2m21s
Lint / typecheck (backend) (pull_request) Successful in 3m50s

Signed-off-by: eternal-flame-AD <yume@yumechi.jp>
This commit is contained in:
ゆめ 2024-11-30 20:59:17 -06:00
parent 8521487461
commit 9d1632ce20
No known key found for this signature in database

View file

@ -57,7 +57,7 @@ function categorizeRequestPath(path: string): 'api' | 'health' | 'vite' | 'other
const mRequestTime = metricHistogram({
name: 'misskey_http_request_duration_seconds',
help: 'Duration of handling HTTP requests in seconds',
labelNames: ['host', 'cate', 'method', 'path'],
labelNames: ['cate', 'method', 'path'],
buckets: [0.001, 0.1, 0.5, 1, 2, 5],
});
@ -88,19 +88,19 @@ const mTooManyRequestsServed = metricCounter({
const mAggregateRequestsServed = metricCounter({
name: 'misskey_http_requests_served_total',
help: 'Total number of HTTP requests served including invalid requests',
labelNames: ['host', 'cate', 'status'],
labelNames: ['cate', 'status'],
});
const mRequestsServedByPath = metricCounter({
name: 'misskey_http_requests_served_by_path',
help: 'Total number of HTTP requests served',
labelNames: ['host', 'cate', 'method', 'path', 'status'],
labelNames: ['cate', 'method', 'path', 'status'],
});
const mFatalErrorCount = metricCounter({
name: 'misskey_fatal_http_errors_total',
help: 'Total number of HTTP errors that propagate to the top level',
labelNames: ['host', 'cate', 'method', 'path'],
labelNames: ['cate', 'method', 'path'],
});
const mLastSuccessfulRequest = metricGauge({
@ -172,7 +172,6 @@ export class ServerService implements OnApplicationShutdown {
const url = new URL(request.url, this.config.url);
const logPath = sanitizeRequestURI(url.pathname);
mFatalErrorCount?.inc({
host: request.hostname,
method: request.method,
path: logPath,
cate: categorizeRequestPath(logPath),
@ -187,7 +186,6 @@ export class ServerService implements OnApplicationShutdown {
const received = reply.getHeader('x-request-received') as string;
mAggregateRequestsServed?.inc({
host: request.hostname,
cate,
status: reply.statusCode,
});
@ -211,7 +209,6 @@ export class ServerService implements OnApplicationShutdown {
if (received) {
const duration = (+new Date()) - parseInt(received);
mRequestTime?.observe({
host: request.hostname,
method: request.method,
cate,
}, duration / 1000);
@ -234,7 +231,6 @@ export class ServerService implements OnApplicationShutdown {
const duration = (+new Date()) - parseInt(received);
mRequestTime?.observe({
host: request.hostname,
method: request.method,
cate,
path: logPath,
@ -253,7 +249,6 @@ export class ServerService implements OnApplicationShutdown {
}
mRequestsServedByPath?.inc({
host: request.hostname,
method: request.method,
path: logPath,
cate,