Page MenuHomePhabricator

WF service logging seems to be partially missing
Closed, ResolvedPublic

Description

  • function-orchestrator logs
    • Base "heap logs" (from logResourceUsage) are present
      • … but missing requestId value
      • … but warn in normalized.dropped.no_such_field that the following messages aren't defined in the template, and so were dropped: stream, logsource, kubernetes, program, normalized_message, metadata, time, docker, rsyslog, timestamp
      • … and the "DURING orchestrate()" / "AFTER orchetrate()" ones are missing?
    • All other log messages appear to be missing, most importantly "Incoming orchestrator request" and "Outgoing orchestrator response" for overall traceability.
  • function-evaluator logs
    • "calling executor in evaluator.." / "...finished calling executor in evaluator" are present
      • … but missing requestId value
      • … but warn in normalized.dropped.no_such_field that the following messages aren't defined in the template, and so were dropped: metadata, stream, rsyslog, logsource, kubernetes, time, timestamp, program, normalized_message, docker
    • All other log messages appear to be missing, including 'Incoming evaluator request', 'calling execute in executor..., original time: …' etc.

Details

Related Changes in Gerrit:
Related Changes in GitLab:
TitleReferenceAuthorSource BranchDest Branch
Add integration test for WikimediaEcsFormatMiddlewarerepos/data-engineering/service-utils!11tchinadd-ecs-testmain
update service-utils version for levels fixrepos/abstract-wiki/wikifunctions/function-orchestrator!291ecarggrace/T386972/bump-service-util-versionmain
update service-utils version for levels fixrepos/abstract-wiki/wikifunctions/function-evaluator!319ecarggrace/T386972/bump-service-util-versionmain
Customize query in GitLab

Event Timeline

This was the MR to fix the missing requestIds.

Note:
Yesterday, we were able to see the requestIds when looking at the Production logs. Today, we only see log events at warn level on the dashboard as well as the logs in Production.

Thanks for all of your support @tchin !!

This was a wild combination of issues which resulted in me submitting an issue upstream.
So, a quick explanation working backwards:

  1. The library I'm using to deep merge when reformatting log messages doesn't merge Symbols (seems like a bug)
  2. Winston uses symbols for internal state
  3. If Symbol('level') is not in the logged message object, apparently Winston doesn't output anything at all
  4. Because the symbol was only erased when the logged message was reformatted, logging still looked like it worked
  5. The more we fixed T383448, the more logging looked like it didn't work
  6. Because the test was a unit test on the formatter and not an integration test on the entirety of Winston, it didn't catch it

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

[operations/deployment-charts@master] wikifunctions: Update evaluators from 2025-02-20-142923 to 2025-02-24-145135

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

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

[operations/deployment-charts@master] wikifunctions: Update orchestrator from 2025-02-20-140756 to 2025-02-25-210518

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

Change #1122962 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Update evaluators from 2025-02-20-142923 to 2025-02-24-145135

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

Change #1122963 merged by jenkins-bot:

[operations/deployment-charts@master] wikifunctions: Update orchestrator from 2025-02-20-140756 to 2025-02-25-210518

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

Huge thanks to @tchin for the fixes, they've helped lots, but I think there's still failures, probably at our end.

Update as of deployment just now:

  • Orchestrator now has http.request.id; evaluator has it there and also under http.request.headers.x-request-id. However, they don't seem to be shared UUIDs – searching for the value in the evaluator doesn't show the orchestrator call that commissioned it, let alone the MW originator.
  • No such field no longer warns about the 'info' key (or whatever severity level), success! The others are still warned about though, notably timestamp – do we want to fix that?
  • Loads of logs are now getting emitted in the orchestrator; for a single http.request.id value, we got: 84x function_duration_milliseconds for z881 (and an extra one with "implementation: undefined"), and 1x for Z6825 2x outgoing orchestrator response 1x for incoming orchestrator request, calling orchestrator..., ...finished calling orchestrator, ... orchestrator finish fetching wikidata entity <l2>
  • We're also still getting the general heap and "DURING orchestrate()" / "AFTER orchetrate()" logs there
  • In the evaluator, Incoming evaluator request logs are now present, but much more than calling executor in evaluator.../...finished calling executor in evaluator etc. (~100x vs. 4x?), and some logs are blank.

Is this good enough for sign-off? Over to @ecarg.

DSantamaria changed the task status from Open to In Progress.Feb 27 2025, 2:23 PM

thank you, everyone~