UI: show message when log collection is disabled #16986
Labels
good first issue
help-wanted
We encourage community PRs for these issues!
theme/logging
theme/ui
type/enhancement
In #16962 we introduced the ability to disable log collection by adding
enabled = false
to thelogs
block in the jobspec. If you use commands likenomad alloc logs
when logs are disabled, the API returns a 404 which gets surfaced to the end user. We documented this behavior, but afterwards I noticed the experience of this in the UI could be improved.Right now the user gets the 404 from the API but it's invisible in the web UI -- the user just sees an empty black box for the logs, as if the application weren't logging at all. Unlike the
nomad alloc logs
command, in the UI we know that the allocation exists, so we could detect that we've received a 404 and show a message like "Logs unavailable. Log collection may be disabled".Another alternative would be to look at the
LogConfig
object and simply not show the log tab in the UI if logs are disabled. But I would recommend against that mostly because we plan on extending this feature further in #15686 by letting cluster administrators disable log collection at the task driver level. At that point the only way to detect if log collection was disabled would be to query the allocation, find its node, and then dig around in the node attributes in hopes that the task driver fingerprints the capability. Acting on the 404 is a "feature detection" approach that will be more reliable as we iterate on this feature.Note that as the feature stands today, the user looking at the logs is likely the same person who disabled log collection, so this is a low priority QoL fit-and-finish issue, not something critical. I'll mark this as a help wanted / good-first-issue as well to see if someone who loves Javascript in the community wants to give it a try. 😀
The text was updated successfully, but these errors were encountered: