v2.4.2

drive-ai integration

Services that invoke LLMs (autograb, marketplace stock colours, cmstosocial) emit drive-ai-style attributes so GenAI dashboards pick them up.

Logger / TraceUtils

Shared lib in libs/logging:

ts
import { Logger, TraceUtils } from '../../../libs/logging'

const traceContext = TraceUtils.extractTraceContext(event, context)
const logger = new Logger(traceContext)
  • TraceUtils.extractTraceContext — pulls traceId/spanId from the API Gateway event for log↔span correlation.
  • Logger — structured JSON logger attaching trace context.

Attribute conventions

drive-ai auto-wires gen_ai.*, app.agent.*, service.name, deployment.environment.name. When calling an LLM (OpenRouter/Portkey), emit the same conventions:

  • Lowercase; _ joins compound words within a value (search_grouped).
  • . namespaces (aws.bedrock).
  • Never camelCase, never kebab-case.

Canonical attribute list and span-name conventions live in the drive-ai docs. Use the drive-ai MCP from AGENTS.md (mcp__drive-ai-mcp__search_drive_ai_docs) when those conventions need to be refreshed.

Identity

drive-ai splits telemetry identity into application + component:

  • service.name = Serverless service name (e.g. drive-api-marketplace)
  • app.component = bare feature token (stock_colours, cmstosocial)

Layer info (controller/service/repo) is structural — already in the span name + http.route; never duplicate into app.component.

Esc