Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
748 B ยท 24 lines
TypeScript
12345678910111213141516171819202122232425import type { IdentifyProps } from "@openstatus/analytics";import type { Workspace } from "@openstatus/db/src/schema";
/** * The OpenPanel identity for API traffic: one `api_<workspaceId>` profile per * workspace, shared by the V1 REST and ConnectRPC surfaces. */export function apiAnalyticsIdentity( workspace: Workspace, headers: Headers,): IdentifyProps { return { userId: `api_${workspace.id}`, workspaceId: `${workspace.id}`, workspaceName: workspace.name || workspace.slug, plan: workspace.plan, source: "api", location: headers.get("fly-client-ip") || headers.get("x-forwarded-for")?.split(",").at(-1)?.trim() || undefined, userAgent: headers.get("user-agent") ?? undefined, };}