Page MenuHomePhabricator

Emit a log from the orchestrator and evaluator on request result
Closed, ResolvedPublic

Description

Right now we emit a structured "Incoming request" log statement to the console on inbound requests, like:

{"name":"function-orchestrator","hostname":"…","pid":1,"level":10,"msg":"Incoming request","request_id":"…","request":{"url":"/1/v1/evaluate/","headers":{"content-type":"application/json","user-agent":"wikifunctions-request/1.39.0-alpha","content-length":"376","x-request-id":"…"},"method":"POST","params":{"0":"/1/v1/evaluate/"},"query":{},"remoteAddress":"172.30.0.5","remotePort":47220},"levelPath":"trace/req","time":"2022-06-15T16:58:51.695Z","v":0}

… but we don't emit a corresponding log on result outcome, which has a bunch of the metrics we might want to capture and react to (like whether the result was a success, or what actual implementation was used, or how long it took, or…). There's no obviously-easy place to put this in (at the end of the route, but that doesn't have access to the app to trigger a log?).

Event Timeline

@maryyang are you able to take this on as part of the work on logging?

Sure. I'll see where this fits in.

Change 833410 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/services/function-orchestrator@master] [WIP] routes: Log the response

https://gerrit.wikimedia.org/r/833410

Change 833410 merged by jenkins-bot:

[mediawiki/services/function-orchestrator@master] routes: Log the response

https://gerrit.wikimedia.org/r/833410