Someone contacted SAS Support recently asking for help with an issue in their SAS Viya platform running on Kubernetes. Support asked the customer to upload some logs from the relevant SAS Viya job to the support track. But this customer didn't have a way to get those logs. The job in question had ended, and the customer had no log (or metric) monitoring solution deployed or configured which had stored its log messages. The logs were gone.
This customer had no good way to access to their logs, except for the kubectl logs
command which, in the case of transient pods like those which run compute jobs, is really only useful for pods that are still running. It's unlikely to be helpful for pods which have finished. So, basically, until this customer deploys some kind of log monitoring solution, and while they are at it a metric monitoring solution too, it will be near impossible for Support to help them troubleshoot that issue.
This is not the ideal first experience when you have just deployed the current SAS Viya platform. Please, if you are a SAS Administrator you need both a log monitoring solution and a metric monitoring solution for your SAS Viya platform.
In A first look at logging in SAS Viya 4 | Global Enablement & Learning Blog back in May 2020, I explained that the way SAS Viya [platform] log messages are collected and made available to SAS administrators is very different from the way they were handled in SAS Viya 3 or SAS 9. In correctly designed Kubernetes applications, the app should not attempt to write to or manage log files. Instead, log messages are simply written to an output stream: stdout
and stderr
. Kubernetes picks up this output and stores it in pod logs.
Rudimentary log viewing tools such as kubectl logs
or a cloud service provider's Kubernetes web interface (which more or less offers the same functionality as kubectl logs in a web app) are good enough for simple use by e.g. a Kubernetes administrator and deployment consultants. But they don't offer long-term storage, aggregation over many pods, searching or much other functionality. In any case the SAS Administrators may not have access to them.
This means you need a log monitoring solution to capture SAS Viya log messages. The solution should store the log messages and their contextual information, and let you to chart, filter and search them.
While we're at it, you also need a metric monitoring solution, which will similarly capture and store metrics from your Kubernetes cluster and from your SAS Viya platform, store them, and let you chart, filter and explore them.
Plan to include both log and metric monitoring as part of your deployment. Add or enable both as soon as you can reasonably do so if you don't already have them! You may also want to ensure you have an alerting and at least a basic auditing capability. Collectively all these things fall under the category of observability tools.
There are several choices. None is terribly expensive, or very difficult to deploy or use, but some are definitely better than the others.
Our top recommendation for observing SAS Viya deployments is SAS Viya Monitoring for Kubernetes. It consists of a log monitoring stack, and a metric monitoring stack, and a set of samples. It is documented in SAS Help Center, and is open source, supported by SAS, regularly updated by SAS developers and available license free on GitHub. It runs and is supported on all the Kubernetes and Cloud Service providers that SAS Viya is supported on.
If you are willing to do a bit more work or sacrifice a bit of convenience and data richness for the sake of consistency with the observability tool a customer already uses for other Kubernetes applications, all the major cloud service providers offer their own observability tools:
The SAS Viya Monitoring for Kubernetes project even has samples for how to configure each to work with SAS Viya.
If you are using Upstream Open Source Kubernetes to deploy SAS Viya (one of our newest options), you'd probably choose to create your hosting infrastructure and Kubernetes environment using SAS Viya 4 Infrastructure as Code (IaC) for Open Source Kubernetes, which works with SAS Viya 4 Deployment project on GitHub. This in turn can deploy SAS Viya Monitoring for Kubernetes with its cluster-monitoring and viya-monitoring tasks.
If you already have Kubernetes and/or already have another observability solution with log and metric monitoring support, you could use that.
Just be aware that if you choose something other than SAS Viya Monitoring for Kubernetes, some work is going to be involved to get the same richness of information from SAS Viya platform logs and metrics that is available in SAS Viya Monitoring for Kubernetes, and to keep it up-to-date over time as you update to new versions Kubernetes and the SAS Viya platform.
But please, do set up log and metric monitoring. It's essential.
Learn more by reading my first look at logging in SAS Viya 4.
To see more recent versions of SAS Viya Monitoring for Kubernetes in action, watch:
Look for other posts on observability, logging and monitoring (or log monitoring and metric monitoring) here, including:
Find more articles from SAS Global Enablement and Learning here.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning and boost your career prospects.