mirror of
https://github.com/andwati/zitadel.git
synced 2026-11-24 13:48:45 +00:00
fix(login): prettier setup (#11798)
# Which Problems Are Solved Invalid formatting in the login codebase due to invalid prettier configuration # How the Problems Are Solved Fxed .prettierignore wildcards for login source files # Additional Changes Removed .prettierrc file because there is already a prettier.config.mjs file # Additional Context
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import "server-only";
|
||||
import { metrics } from "@opentelemetry/api";
|
||||
import "server-only";
|
||||
|
||||
const serviceName = process.env.OTEL_SERVICE_NAME || "zitadel-login";
|
||||
const meter = metrics.getMeter(serviceName);
|
||||
@@ -8,13 +8,10 @@ const requestCounter = meter.createCounter("http_server_requests_total", {
|
||||
description: "Total number of HTTP requests",
|
||||
});
|
||||
|
||||
const requestDuration = meter.createHistogram(
|
||||
"http_server_request_duration_seconds",
|
||||
{
|
||||
description: "HTTP request duration in seconds",
|
||||
unit: "s",
|
||||
},
|
||||
);
|
||||
const requestDuration = meter.createHistogram("http_server_request_duration_seconds", {
|
||||
description: "HTTP request duration in seconds",
|
||||
unit: "s",
|
||||
});
|
||||
|
||||
const requestSize = meter.createHistogram("http_server_request_size_bytes", {
|
||||
description: "Size of HTTP request bodies in bytes",
|
||||
@@ -26,12 +23,9 @@ const responseSize = meter.createHistogram("http_server_response_size_bytes", {
|
||||
unit: "By",
|
||||
});
|
||||
|
||||
const responseStatusCounter = meter.createCounter(
|
||||
"http_server_response_status_total",
|
||||
{
|
||||
description: "Count of HTTP responses per status code",
|
||||
},
|
||||
);
|
||||
const responseStatusCounter = meter.createCounter("http_server_response_status_total", {
|
||||
description: "Count of HTTP responses per status code",
|
||||
});
|
||||
|
||||
const activeRequests = meter.createUpDownCounter("http_server_active_requests", {
|
||||
description: "Number of active HTTP requests",
|
||||
@@ -49,13 +43,10 @@ const authFailures = meter.createCounter("login_auth_failures_total", {
|
||||
description: "Total failed authentications",
|
||||
});
|
||||
|
||||
const sessionCreationDuration = meter.createHistogram(
|
||||
"login_session_creation_duration_seconds",
|
||||
{
|
||||
description: "Session creation duration in seconds",
|
||||
unit: "s",
|
||||
},
|
||||
);
|
||||
const sessionCreationDuration = meter.createHistogram("login_session_creation_duration_seconds", {
|
||||
description: "Session creation duration in seconds",
|
||||
unit: "s",
|
||||
});
|
||||
|
||||
/**
|
||||
* Record an authentication attempt.
|
||||
@@ -80,11 +71,7 @@ export function recordAuthSuccess(method: string, organization?: string): void {
|
||||
/**
|
||||
* Record a failed authentication.
|
||||
*/
|
||||
export function recordAuthFailure(
|
||||
method: string,
|
||||
reason: string,
|
||||
organization?: string,
|
||||
): void {
|
||||
export function recordAuthFailure(method: string, reason: string, organization?: string): void {
|
||||
authFailures.add(1, {
|
||||
method,
|
||||
reason,
|
||||
@@ -135,10 +122,7 @@ export function recordRequestEnd(
|
||||
/**
|
||||
* Record session creation duration.
|
||||
*/
|
||||
export function recordSessionCreationDuration(
|
||||
startTime: number,
|
||||
success: boolean,
|
||||
): void {
|
||||
export function recordSessionCreationDuration(startTime: number, success: boolean): void {
|
||||
const duration = (Date.now() - startTime) / 1000;
|
||||
sessionCreationDuration.record(duration, {
|
||||
success: success.toString(),
|
||||
|
||||
Reference in New Issue
Block a user