feat(login): added support for otel push-based logs, metrics, and traces (#11429)

This commit is contained in:
Mridang Agarwalla
2026-03-04 15:58:56 +05:30
committed by GitHub
parent 685be24dfe
commit 3f3413a230
41 changed files with 4182 additions and 350 deletions
+6 -3
View File
@@ -1,6 +1,7 @@
"use server";
import { addSessionToCookie, updateSessionCookie } from "@/lib/cookies";
import { createLogger } from "@/lib/logger";
import {
createSessionForUserIdAndIdpIntent,
createSessionFromChecksAndChallenges,
@@ -16,6 +17,8 @@ import { Checks } from "@zitadel/proto/zitadel/session/v2/session_service_pb";
import { headers } from "next/headers";
import { getServiceConfig } from "../service-url";
const logger = createLogger("cookie");
type CustomCookieData = {
id: string;
token: string;
@@ -52,7 +55,7 @@ export async function createSessionAndUpdateCookie(command: {
let sessionLifetime = command.lifetime;
if (!sessionLifetime || !sessionLifetime.seconds) {
console.warn("No session lifetime provided, using default of 24 hours.");
logger.warn("No session lifetime provided, using default of 24 hours");
sessionLifetime = {
seconds: BigInt(24 * 60 * 60), // 24 hours
@@ -126,7 +129,7 @@ export async function createSessionForIdpAndUpdateCookie({
let sessionLifetime = lifetime;
if (!sessionLifetime || !sessionLifetime.seconds) {
console.warn("No IDP session lifetime provided, using default of 24 hours.");
logger.warn("No IDP session lifetime provided, using default of 24 hours");
sessionLifetime = {
seconds: BigInt(24 * 60 * 60), // 24 hours
@@ -140,7 +143,7 @@ export async function createSessionForIdpAndUpdateCookie({
idpIntent,
lifetime: sessionLifetime,
}).catch((error: ErrorDetail | CredentialsCheckError) => {
console.error("Could not set session", error);
logger.error("Could not set session", { error });
if ("failedAttempts" in error && error.failedAttempts) {
throw {
error: `Failed to authenticate: You had ${error.failedAttempts} password attempts.`,