docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
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
}
]
}