CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-opentelemetry--instrumentation-express

OpenTelemetry instrumentation for Express.js web applications enabling automatic distributed tracing and observability

80

1.63x
Overview
Eval results
Files

rubric.jsonevals/scenario-9/

{
  "context": "This criteria evaluates how well the engineer uses the @opentelemetry/instrumentation-express package's requestHook configuration option to enrich trace spans with custom business attributes. The focus is specifically on proper usage of the requestHook function to add span attributes based on request data.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "requestHook Configuration",
      "description": "The solution correctly configures the ExpressInstrumentation with a requestHook option that receives (span, info) parameters",
      "max_score": 25
    },
    {
      "name": "User ID Extraction",
      "description": "The requestHook uses span.setAttribute() to add 'user.id' attribute by extracting the value from the x-user-id request header (accessible via info.request.headers)",
      "max_score": 25
    },
    {
      "name": "Priority Determination",
      "description": "The requestHook uses span.setAttribute() to add 'request.priority' attribute based on x-priority header, with proper handling of valid values (high/medium/low) and defaulting to 'low' for missing or invalid values",
      "max_score": 25
    },
    {
      "name": "Request Body Detection",
      "description": "The requestHook uses span.setAttribute() to add 'request.has_body' boolean attribute by checking the HTTP method (info.request.method) - true for POST/PUT, false for GET",
      "max_score": 25
    }
  ]
}

Install with Tessl CLI

npx tessl i tessl/npm-opentelemetry--instrumentation-express

tile.json