Skip to content

Comments

Only include detailed HTTP diagnostics in node health output when --verbose is set#358

Merged
nblumhardt merged 2 commits intodatalust:devfrom
nblumhardt:tidy-health-output
Jul 9, 2024
Merged

Only include detailed HTTP diagnostics in node health output when --verbose is set#358
nblumhardt merged 2 commits intodatalust:devfrom
nblumhardt:tidy-health-output

Conversation

@nblumhardt
Copy link
Member

@nblumhardt nblumhardt commented Jul 8, 2024

No --verbose flag - parseable JSON:

> seqcli -- node health
{"status":"The Seq node is in service."}

With the flag (similar output to today):

> seqcli node health --verbose
HTTP 1.1 200 OK
Date: Mon, 08 Jul 2024 04:16:13 GMT
Transfer-Encoding: chunked
Connection: keep-alive
Vary: Accept-Encoding
...
{"status":"The Seq node is in service."}

No --json flag is currently required - the output is always the literal response from the server, for easy diagnostics (e.g. when the actual response is some random HTML page from a proxy/gateway). Could reevaluate this down the track.

@KodrAus
Copy link
Member

KodrAus commented Jul 9, 2024

RUNNING NodeHealthTestCase                                
{"status": "The Seq node is in service."}
FAIL
Xunit.Sdk.StartsWithException: Assert.StartsWith() Failure: String start does not match
String:         "{"status": "The Seq node is in service."}"···
Expected start: "HTTP 1.1 200 OK"
   at Xunit.Assert.StartsWith(String expectedStartString, String actualString, StringComparison comparisonType) in /_/src/xunit.assert/Asserts/StringAsserts.cs:line 899
   at Xunit.Assert.StartsWith(String expectedStartString, String actualString) in /_/src/xunit.assert/Asserts/StringAsserts.cs:line 879
   at SeqCli.EndToEnd.Node.NodeHealthTestCase.ExecuteAsync(SeqConnection connection, ILogger logger, CliCommandRunner runner) in /home/appveyor/projects/seqcli/test/SeqCli.EndToEnd/Node/NodeHealthTestCase.cs:line 16
   at SeqCli.EndToEnd.Support.IsolatedTestCase.ExecuteTestCaseAsync() in /home/appveyor/projects/seqcli/test/SeqCli.EndToEnd/Support/IsolatedTestCase.cs:line 66
   at SeqCli.EndToEnd.Support.TestDriver.Run() in /home/appveyor/projects/seqcli/test/SeqCli.EndToEnd/Support/TestDriver.cs:line 52

@nblumhardt nblumhardt merged commit 13c8ae8 into datalust:dev Jul 9, 2024
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