Skip to content

Instantly share code, notes, and snippets.

@wardbekker
wardbekker / dashboard.json
Created June 11, 2020 19:34
Loki Nginx Web Analytics Dashboard
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@wardbekker
wardbekker / config.yaml
Created April 14, 2020 08:48
Promtail example configuration for Loki
scrape_configs:
- job_name: system
pipeline_stages:
static_configs:
- targets:
- localhost
labels:
job: varlogs
host: ward_workstation
agent: promtail
@wardbekker
wardbekker / fluent.conf
Created April 14, 2020 08:45
FluentD example for output to Loki
<source>
@type tail
format none
path /var/log/*.log
pos_file positions.pos
tag varlog.*
path_key filename
</source>
<match varlog.**>
@wardbekker
wardbekker / fluent-bit.conf
Created April 14, 2020 08:44
Fluent-Bit example configuration for Loki
[INPUT]
Name tail
Path /var/log/*.log
Path_Key filename
[Output]
Name loki
Match *
Url http://localhost:3100/loki/api/v1/push
BatchWait 1
@wardbekker
wardbekker / promtail.txt
Created March 6, 2020 19:45
Promtail command options
Usage of ./promtail-darwin-amd64:
-config.file string:
yaml file to load
-log.level value:
Only log messages with the given severity or above. Valid levels: [debug, info, warn, error] (default info)
-target.sync-period duration:
Period to resync directories being watched and files being tailed. (default 10s)
-version:
Print this builds version information (default false)
@wardbekker
wardbekker / promtail.yaml
Created December 20, 2019 14:26
Values file for Loki promtail helm chart
loki:
servicePort: 443
serviceScheme: https
serviceName: your_cluster.grafana.net
user: your_user_id
password: your_api_key
@wardbekker
wardbekker / prometheus.yaml
Created December 20, 2019 14:24
Values file for Prometheus Helm Chart
serverFiles:
prometheus.yml:
remote_write:
-
basic_auth:
password: your_api_key
username: your_username
url: "https://your_cluster.grafana.net/api/prom/push"
# To troubleshoot and get more log info enable ldap debug logging in grafana.ini
# [log]
# filters = ldap:debug
[[servers]]
# Ldap server host (specify multiple hosts space separated)
host = "ldap.forumsys.com"
# Default port is 389 or 636 if use_ssl = true
port = 389
# Set to true if ldap server supports TLS
@wardbekker
wardbekker / awesome_web_app_dashboard.json
Last active October 19, 2022 11:16
Demo dashboard for loki+prom example web app dashboard
{
"dashboard" : {
"annotations": {
"list": [
{
"datasource": "Loki",
"enable": true,
"expr": "{service=~\"[[service]]\"} Error",
"hide": false,
"iconColor": "rgba(255, 96, 96, 1)",
loki:
config:
auth_enabled: false
ingester:
lifecycler:
address: 127.0.0.1
ring:
kvstore:
store: inmemory
replication_factor: 1