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.

  1. To access Grafana, forward a local port to the Service's port:
    Click to copy
    kubectl -n kyma-system port-forward svc/monitoring-grafana 3000:80
  2. In your browser, go to http://localhost:3000 to open Grafana dashboard.

View the logs

  1. 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.

  2. 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 choose function

    Click Show logs.

    NOTE: Alternatively, type or paste the {function="lastorder", container="function"} query and press Shift+Enter or click on Run query.

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

  1. In the Grafana dashboard, use the search tool from the left menu.
  2. Search for the Kyma / Function board and select it.
  3. 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!