Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ir,storage: Make healthcheck output visible in docker inspect #274

Closed
wants to merge 1 commit into from

Conversation

cthulhu-rider
Copy link
Contributor

@cthulhu-rider cthulhu-rider commented Aug 8, 2023

Healthcheck commands of ir and storage service containers execute neofs-cli control healthcheck. Previously, exec results were just grep-ed. If output didn't contain particular string, health state log exit code was 1 with empty output. This did not allow to find out what exactly was output by the command. To make it easier to detect problems, the output should be stored regardless of the return code.

$ docker inspect --format "{{json .State.Health }}" s01 | jq

Before:

{
  "Status": "unhealthy",
  "FailingStreak": 1,
  "Log": [
    {
      "Start": "2023-08-08T12:14:31.525815071+04:00",
      "End": "2023-08-08T12:14:33.074067267+04:00",
      "ExitCode": 1,
      "Output": ""
    }
  ]
}

Now:

{
  "Status": "unhealthy",
  "FailingStreak": 1,
  "Log": [
    {
      "Start": "2023-08-08T12:14:31.525815071+04:00",
      "End": "2023-08-08T12:14:33.074067267+04:00",
      "ExitCode": 1,
      "Output": "Network status: OFFLINE\nHealth status: STARTING\n"
    }
  ]
}

Healthcheck commands of `ir` and `storage` service containers execute
`neofs-cli control healthcheck`. Previously, exec results were just
grep-ed. If output didn't contain particular string, health state log
exit code was 1 with empty output. This did not allow to find out what
exactly was output by the command. To make it easier to detect problems,
the output should be stored regardless of the return code.

```
$ docker inspect --format "{{json .State.Health }}" s01 | jq
```
Before:
```json
{
  "Status": "unhealthy",
  "FailingStreak": 1,
  "Log": [
    {
      "Start": "2023-08-08T12:14:31.525815071+04:00",
      "End": "2023-08-08T12:14:33.074067267+04:00",
      "ExitCode": 1,
      "Output": ""
    }
  ]
}
```
Now:
```json
{
  "Status": "unhealthy",
  "FailingStreak": 1,
  "Log": [
    {
      "Start": "2023-08-08T12:14:31.525815071+04:00",
      "End": "2023-08-08T12:14:33.074067267+04:00",
      "ExitCode": 1,
      "Output": "Network status: OFFLINE\nHealth status: STARTING\n"
    }
  ]
}
```

Signed-off-by: Leonard Lyubich <leonard@morphbits.io>
@roman-khimov
Copy link
Member

I think it's irrelevant now with #272 merged.

@carpawell
Copy link
Member

So closing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants