reduce metric cardinaility
Some checks failed
Lint / pnpm_install (push) Successful in 2m39s
Test (production install and build) / production (22.11.0) (push) Successful in 1m19s
Publish Docker image / Build (push) Successful in 6m44s
Test (backend) / unit (22.11.0) (push) Failing after 15m43s
Lint / lint (frontend) (push) Failing after 2m58s
Lint / lint (backend) (push) Failing after 3m32s
Lint / lint (frontend-embed) (push) Successful in 3m11s
Lint / lint (frontend-shared) (push) Successful in 3m23s
Lint / lint (misskey-bubble-game) (push) Successful in 3m8s
Lint / lint (misskey-js) (push) Successful in 3m9s
Lint / lint (misskey-reversi) (push) Successful in 2m56s
Lint / typecheck (backend) (push) Successful in 2m59s
Lint / lint (sw) (push) Successful in 3m33s
Lint / typecheck (misskey-js) (push) Successful in 2m3s
Lint / typecheck (sw) (push) Successful in 2m10s

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 6d752fbf0c
No known key found for this signature in database
2 changed files with 5 additions and 10 deletions

View file

@ -43,7 +43,7 @@ const mIncomingApProcessingTime = metricHistogram({
name: 'misskey_incoming_ap_processing_time', name: 'misskey_incoming_ap_processing_time',
help: 'Incoming AP processing time in seconds', help: 'Incoming AP processing time in seconds',
labelNames: ['incoming_host', 'incoming_type', 'success'], labelNames: ['incoming_host', 'incoming_type', 'success'],
buckets: [1, 10, 60, 300, 1800], buckets: [2, 10, 60, 300],
}); });
const mIncomingApEvent = metricCounter({ const mIncomingApEvent = metricCounter({

View file

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