Observability
We successfully got our Function triggered. Now we would like to check its logs and metrics. To do that, we'll use the Grafana dashboard that comes with Kyma.
NOTE: See how to access logs from the Function's Pod via Kyma Dashboard and using kubectl.
NOTE: Prometheus and Grafana are deprecated and are planned to be removed. If you want to install a custom stack, take a look at Install a custom kube-prometheus-stack in Kyma.
Access Grafana
NOTE: See how to expose Grafana securely for easier access in the future.
- To access Grafana, forward a local port to the Service's port:Click to copykubectl -n kyma-system port-forward svc/monitoring-grafana 3000:80
- In your browser, go to
http://localhost:3000
to open Grafana dashboard.
View the logs
In the Grafana dashboard, use the left menu to navigate to Explore and choose Loki from the dropdown list.
NOTE: Loki is deprecated and is planned to be removed. If you want to install a custom Loki stack, take a look at Installing a custom Loki stack in Kyma.
Click on Log browser and select the following values:
- 1. Select labels to search in:
container
,function
- 2. Find values for the selected labels: for function choose
lastorder
, for container choosefunction
Click Show logs.
NOTE: Alternatively, type or paste the
{function="lastorder", container="function"}
query and pressShift
+Enter
or click on Run query.- 1. Select labels to search in:
You can now browse the logs.
NOTE: To learn about different ways to view logs (for example, in Kyma Dashboard or using
kubectl
), see Access Kyma application logs.
View the metrics
- In the Grafana dashboard, use the search tool from the left menu.
- Search for the
Kyma / Function
board and select it. - From the Function dropdown, select
lastorder
.
You can now view the metrics, such as success rate and resource consumption.
That's it!
Go ahead and dive a little deeper into the Kyma documentation for tutorials, operation guides, and technical references, as well as information on the main areas in Kyma. Happy Kyma-ing!