feat(server/otel): restructure observability metrics and add active sessions gauge
- Moved RateLimitMetrics import path to a more centralized location. - Introduced a new file for active sessions gauge to track user sessions in the database. - Updated index.ts to include new metrics and ensure proper initialization of observability metrics. - Modified various routes and services to utilize the new observability structure. - Added smoke tests for HTTP and WebSocket metrics to ensure proper metric registration and functionality. - Enhanced error handling for metrics reading failures to improve observability.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type Redis from 'ioredis'
|
||||
|
||||
import type { Database } from '../../libs/db'
|
||||
import type { RevenueMetrics } from '../../libs/otel'
|
||||
import type { RevenueMetrics } from '../../otel'
|
||||
import type { ConfigKVService } from '../config-kv'
|
||||
|
||||
import { useLogger } from '@guiiai/logg'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type Redis from 'ioredis'
|
||||
|
||||
import type { RevenueMetrics } from '../../libs/otel'
|
||||
import type { RevenueMetrics } from '../../otel'
|
||||
import type { BillingService } from './billing-service'
|
||||
|
||||
import { useLogger } from '@guiiai/logg'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Database } from '../libs/db'
|
||||
import type { EngagementMetrics } from '../libs/otel'
|
||||
import type { EngagementMetrics } from '../otel'
|
||||
|
||||
import { useLogger } from '@guiiai/logg'
|
||||
import { and, eq, isNull, or, sql } from 'drizzle-orm'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { MessageRole, WireMessage } from '@proj-airi/server-sdk-shared'
|
||||
|
||||
import type { Database } from '../libs/db'
|
||||
import type { EngagementMetrics } from '../libs/otel'
|
||||
import type { EngagementMetrics } from '../otel'
|
||||
|
||||
import { useLogger } from '@guiiai/logg'
|
||||
import { and, eq, gt, inArray, isNull, sql } from 'drizzle-orm'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Logger } from '@guiiai/logg'
|
||||
|
||||
import type { EmailMetrics } from '../libs/otel'
|
||||
import type { EmailMetrics } from '../otel'
|
||||
|
||||
import { useLogger } from '@guiiai/logg'
|
||||
import { errorMessageFrom } from '@moeru/std'
|
||||
|
||||
Reference in New Issue
Block a user