logo
Use Loki to view logs from your infrastructure and application. If you don’t have a running Loki instance, you can use our starter kit to start it up - instructions below!

Setup

In order to enable Grafana Loki Provider in Fiberplane you need to either add it via direct access (for an openly accessible URL) or add it as a valid entry in the data_source.yaml configuration.
The data_sources.yaml format for adding a Loki Provider looks like this:
yaml
# data_sources.yaml # # Replace the following line with the name of the data source - name: loki-staging description: Loki (Staging) providerType: loki config: # Replace the following line with your Loki URL url: http://loki:3100 # If accessing your Grafana Loki requires authentication - add the token (Bearer or Basic) below token: <TOKEN>

Starter kit

If you don’t have a running Loki instance, you can use the guide below to spin up a simple instance in a locally running Docker machine.
The Loki starter-kit uses docker to run the following as docker containers:

Pre-requisites

docker and docker-compose - Installed and running. These are used to run containers locally.
Fiberplane CLI - Enables you to create & manage templates, notebooks, proxy API keys and more via cli.
Proxy API token - Can be created either on Fiberplabe Studio (UI) or via CLI.
It's possible to replace docker with podman when using our starter kits. If you wish to do so, we recommend installing podman-compose and replacing all docker-compose commands with podman-compose. All other aspects remain the same.

docker-compose

  • git clone https://github.com/fiberplane/quickstart.git
  • cd starter-kits/loki/docker-compose
  • Edit the .env file (vi .env) and add in the proxy API token generated in step 3 of the Pre-Requisites. eg : TOKEN=yourtokenhere
  • docker-compose up -d

Verifying the installation

Verify that the containers are running (run docker ps).
Here is a sample output of what you should see
Image without caption

Exploring the data on Fiberplane

Now that you have everything setup, you are ready to create your first notebook. We recommend following the instructions below to do so using our starter kit template.
  1. Get the templatecd ../ (loki directory)
  1. Add the template jsonnet file to Fiberplane: fp templates create --title="My loki template" fp-loki-starter-template.jsonnet >> Make a note of the template id.
  1. Now you can create a notebook using the template you just created. On Fiberplane studio, click on templates >> your template >> New notebook >> Create Notebook. This is also doable using CLI, just make sure you have the template id from step 2 - fp templates expand <templateid>
  1. Click the notebook link and you will have a notebook with few loki queries pre-populated. Select your datasource my Loki
Image without caption
  1. Now execute each query by hitting CTRL + ↩︎ (Mac: ⌘ + ↩︎) or by clicking the play button next to each query cell.

Helpful?