Observability with Linkerd

Mesh Fission function and component pods with the Linkerd service mesh to view request rate, success rate, and latency in its dashboard.

Observability with Linkerd

Linkerd is a lightweight service mesh that works out of the box with Fission and adds request-level metrics to your functions and to Fission itself. This guide walks you through meshing function and Fission pods so you can view success rate, request rate, and latency in Linkerd’s dashboard.

Prerequisites

You need to install Fission and Linkerd in the cluster.

Deploy a function in Fission

  • Create a Fission environment:
fission env create --name node --image ghcr.io/fission/node-env
  • Create a file with function code:
module.exports = async function(context) {
    return {
        status: 200,
        body: "Hello, world!\n"
    };
}
  • Deploy the function
fission fn create --name hello --code hello.js --env node
  • Test the function
fission fn test --name hello

Linkerd Dashboard

  • Linkerd has an amazing dashboard which can be launched by:
linkerd dashboard &

Linkerd dashboard

  • Under namespaces, select default and check the existing deployments

Linkerd before mesh

Inject sidecar into deployments

Linkerd injects a side car proxy to add the deployment to it’s data plane. We can do this at namespace level so that all deployments in a namespace are meshed.

kubectl get deploy -o yaml \
| linkerd inject - \
| kubectl apply -f -

We can check if the deployment is “meshed” i.e if the side car proxy is injected within the dashboard

Linkerd after mesh

Notice the metrics like Request Per Second(RPS) and PX Latency

Generate traffic and view metrics

Let’s generate some traffic to the function by:

while true; do sleep 1; curl http://${FISSION_ROUTER}/hello; echo -e '\n\n\n\n'$(date);done 

We can now view the grafana dashboard near the deployments

Linkerd Grafana

We can now visualize success rate, rate per requests and latency of functions at one place

Observing Fission components

Similar to functions, we can also mesh the Fission namespace so that we can observe the Fission components. We can similarly use the Grafana dashboard to get details of other metrics.

kubectl get -n  fission deploy -o yaml \
| linkerd inject - \
| kubectl apply -f -

Fission Components