Page MenuHomePhabricator

[logs-cli,toolforge-cli] Add subcommand toolforge logs to query and retrieve the relevant logs, will have to design a minimal interface to filter by event/subsystem/time/etc.
Closed, ResolvedPublic

Description

To expose the newly stored system-level event logs, we will want to add a cli to retrieve them.

This task is to define the user experience around the cli, and implement it. Use cases that should be served are:

  • As a user, I want to see all the system-level event logs for my tool in real time
  • As a user, I want to see all the times my webservice was restarted
  • As a user, I want to see when my tool was deployed (triggered), and if it finished ok (deployment completed)
  • As a user, I want to see when my webservice was started or stopped and by who

Note: we already have different interfaces for accessing different types of logs; in the future, we want to unify them under a toolforge logs command, but this doesn't have to be done as part of this task (only if it's easy, otherwise should be separated into another task).

Implementation

We are using cli options, for example --since, in parallel to the options that the API allows for the logs endpoint (see https://api-docs.toolforge.org).

The options to implement are:

  • --since/--until
  • --job-names
  • --build-ids
  • --deployment-ids
  • --sources
  • --lines
  • --direction

We are going for parity with the API for this new cli: https://phabricator.wikimedia.org/T432572#12318897

Event Timeline

aputhin subscribed.

Please review the user interactions and how we might want to approach these interfaces.

dcaro moved this task from Todos to Ready for Review on the tools-platform-team board.
dcaro added a subscriber: CCiufo-WMF.

Change #1341237 had a related patch set uploaded (by David Caro; author: David Caro):

[cloud/wmcs-cookbooks@main] deploy,gitlab: add logs-cli

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

Depends on T434093.

We decided on the daily standup to go for now with api-cli prameter parity, this means implementing --direction=<oldest_first|newest_first> --since --until --lines

Change #1341719 had a related patch set uploaded (by David Caro; author: David Caro):

[operations/puppet@production] toolforge: add the logs-cli package

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

dcaro changed the task status from Open to In Progress.Tue, Sep 15, 4:03 PM
dcaro moved this task from Ready for Review to In progress on the tools-platform-team board.

Change #1341719 merged by David Caro:

[operations/puppet@production] toolforge: add the logs-cli package

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

Change #1341237 merged by jenkins-bot:

[cloud/wmcs-cookbooks@main] deploy,gitlab: add logs-cli

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

fnegri updated Other Assignee, added: fnegri.