Skip to content
Loki log provider for OpenFaaS
Go Makefile Smarty Dockerfile
Branch: master
Clone or download
LucasRoesler Improve readme install instructions
- Use `kubectl set env` to  make the install instructions more explicit

Signed-off-by: Lucas Roesler <>
Latest commit ff62ac4 Jul 23, 2019

OpenFaaS Loki

A Loki powered log provider for OpenFaaS

CircleCI Go Report Card Docker

OpenFaaS Loki implementes the new log provider interface from faas-provider. This means you can query Loki for your function logs with the faas-cli!

Limitations: This initial version does not support log tail streams. This means that faas-cli logs will alway behave as if --follow=false. Live tailing of the logs is currently being worked on.

All other OpenFaaS log behaviors should be fully supported. Issues are welcome if you notice a bug or room for improvement.

Install with Helm

  1. Clone this repo
  2. Determine the URL of your Loki installation, if you used the default Helm values to install Loki, this will be http://<service name>.<namespace>:3100
  3. Then install the openfaas-loki provider using Helm:
    helm upgrade --install ofloki ./deployment/openfaas-loki \
        --namespace openfaas \
        --set lokiURL=http://loki.monitoring:3100 \
        --set logLevel=DEBUG
  4. Then update the gateway with the environment variable described in the NOTES output of the helm install. Currently, this can be done using
    kubectl -n openfaas set env deployment/gateway -c gateway -e logs_provider_url=http://ofloki-openfaas-loki.openfaas:9191/
    The environment variable is only needed on the gateway container.
  5. Test the installation using
    faas-cli store deploy nodeinfo
    echo "" | faas-cli invoke nodeinfo
    faas-cli logs nodeinfo --tail=3

Development flow

OpenFaaS Loki is built with go 1.12+ and uses go modules and all of the development actions are currently defined through the Makefile

Run tests

make test

Local install

You can install using

make install

Check the installation using

openfaas-loki --version

Docker Build

To enable more efficient builds, the Dockerfile uses the experimental RUN syntax to support build-time caches. This requires enabling the "experimental" features in your Docker installation. This will enable using buildkit as the build engine

Build the Docker image and verify the build using

make build
docker run theaxer/openfaas-loki:dev --version
You can’t perform that action at this time.