Skip to content

Instantly share code, notes, and snippets.

View roidelapluie's full-sized avatar
🔥

Julien roidelapluie

🔥
  • O11y
View GitHub Profile
load 10s
foo 0 10 20 30 40 50 60
bar 0 10
eval instant at 1m rate(foo[1m])
{} 1
eval instant at 1m rate(bar[1m])
{} 1
goroutine profile: total 7614
2503 @ 0x431340 0x440e4b 0x707ce3 0x45f181
# 0x707ce2 net/http.(*persistConn).writeLoop+0x122 /usr/local/go/src/net/http/transport.go:2210
2502 @ 0x431340 0x42c0da 0x42b6a5 0x4cfb05 0x4d0a7f 0x4d0a61 0x519bdf 0x52dbc8 0x705595 0x5b9c33 0x5b9d9f 0x706246 0x45f181
# 0x42b6a4 internal/poll.runtime_pollWait+0x54 /usr/local/go/src/runtime/netpoll.go:184
# 0x4cfb04 internal/poll.(*pollDesc).wait+0x44 /usr/local/go/src/internal/poll/fd_poll_runtime.go:87
# 0x4d0a7e internal/poll.(*pollDesc).waitRead+0x1ce /usr/local/go/src/internal/poll/fd_poll_runtime.go:92
# 0x4d0a60 internal/poll.(*FD).Read+0x1b0 /usr/local/go/src/internal/poll/fd_unix.go:169
# 0x519bde net.(*netFD).Read+0x4e /usr/local/go/src/net/fd_unix.go:202
parser panic: interface conversion: interface is nil, not promql.Expr
goroutine 220 [running]:
github.com/prometheus/prometheus/promql.(*parser).recover(0xc000036000, 0xc0015d8f68)
/app/promql/parse.go:269 +0x122
panic(0x2165d80, 0xc0016a4e70)
/usr/local/go/src/runtime/panic.go:679 +0x1b2
github.com/prometheus/prometheus/promql.(*parser).newBinaryExpression(...)
/app/promql/parse.go:349
@roidelapluie
roidelapluie / haproxy.cfg
Created November 30, 2019 14:54
Simple HTTP Proxy with haproxy (POC - not recommended)
global
log stdout local0
defaults
log global
log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r %si:%sp"
frontend proxy
bind :3128
{
"__inputs": [],
"__requires": [
{
"type": "grafana",
"id": "grafana",
"name": "Grafana",
"version": "6.4.4"
},
{
groups:
- name: Easter Meeus/Jones/Butcher Algorithm
interval: 60s
rules:
- record: easter_y
expr: year(belgium_localtime)
- record: easter_a
expr: easter_y % 19
- record: easter_b
expr: floor(easter_y / 100)
@roidelapluie
roidelapluie / main.go
Created September 26, 2019 12:51
nflogerror_exporter
package main
import (
"encoding/json"
"errors"
"flag"
"fmt"
"hash/fnv"
"io"
"io/ioutil"
@roidelapluie
roidelapluie / main.go
Created September 26, 2019 08:21
Read Alertmanager NFLOG
package main
import (
"errors"
"flag"
"fmt"
"io"
"os"
"github.com/gogo/protobuf/jsonpb"
[C7.5.1804-base]
name=CentOS-7.5.1804 - Base
baseurl=http://vault.centos.org/7.5.1804/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
enabled=1
[C7.5.1804-updates]
name=CentOS-7.5.1804 - Updates
baseurl=http://vault.centos.org/7.5.1804/updates/$basearch/
groups:
- name: datetime
rules:
- record: daily_saving_time_belgium
expr: |
(vector(0) and (month() < 3 or month() > 10))
or
(vector(1) and (month() > 3 and month() < 10))
or
(