Skip to content

Instantly share code, notes, and snippets.

@f41gh7
f41gh7 / README.md
Last active January 5, 2024 21:15
metricsql.py

python wrapper for metricsql expr validation.

usage:

  1. build shared lib: go build -buildmode=c-shared -o library.so main.go
  2. use it
python3 metricsql.py 'not_exist(up)'`
failed to parse expr: not_exist(up), error: unsupported function "not_exist"
@f41gh7
f41gh7 / README.md
Last active January 19, 2024 13:00
opentelemetry-collector and VM

How to use opentelemetry collector with VictoriaMetrics

requirements

Installation of VictoriaMetrics

In education purpose, I'll use single node version of VictoriaMetrics.

@f41gh7
f41gh7 / README.md
Last active January 30, 2023 16:54
multi level vmcluster with helm chart

Mutli level cluster setup

doc

Lets say we have 2 zones: zone-a and zone-b. Separate cluster must be deploy to the both zones with commands:

helm upgrade -i zone-a vm/victoria-metrics-cluster -f zone.yaml
@f41gh7
f41gh7 / README.md
Created August 16, 2022 12:44
Managed VictoriaMetrics solution. Register additional user for exist subscription

Additional user registration

  1. Log in into AWS Account, which was subscribed to the Managed solution
  2. Open AWS Market Place page with Product and click continue to subscribe:

Screenshot 2022-08-16 at 14 37 57

3) Click at `click here` link and you will be redirected with AWS token to the UI page, where you can register user account:

Screenshot 2022-08-16 at 14 38 45

4) Register account.
@f41gh7
f41gh7 / README.md
Last active January 19, 2024 17:24
VictoriaMetrics OTLP push

golang web app with opentelemetry metrics

Example of web-go application.

It could push collected metrics by http with opentelemetry insturmentation.

usage:

  1. build:
@f41gh7
f41gh7 / mimir_overrides.yaml
Last active May 9, 2022 16:21
mimir victoriametrics benchmark helm values
serviceMonitor:
enabled: true
alertmanager:
enabled: true
persistentVolume:
enabled: false
replicas: 1
resources:
limits:
@f41gh7
f41gh7 / README.md
Last active May 3, 2022 09:05
vmcluster tls kubernetes

generate self-signed ca with key

openssl req -x509 -sha256 -days 1825 -newkey rsa:2048 -keyout rootCA.key -out rootCA.crt -nodes

  • ca.default.svc.cluster.local - ou

generate storage node certificates

YOU HAVE TO USE extfile -> domain.ext

storage 0

ou - mtls-vmstorage-0.mtls-vmstorage.default.svc.cluster.local

openssl req -newkey rsa:2048 -nodes -keyout vmstorage_0.key -out vmstorage_0.csr

@f41gh7
f41gh7 / README.md
Last active April 21, 2022 09:34
vmagent k8s discovery timings

how to generate load on vmagent

requirements

  • golang
  • python3
  • git

starting

@f41gh7
f41gh7 / README.md
Last active April 28, 2024 14:29
vmbackup as kubernetes sidecar

Snippets show example how to use vmbackup as kubernetes sidecar

Build image with cron

# copy or download dockerfile
wget  https://gist.githubusercontent.com/f41gh7/98ad3323cbdd46476595b6a8b753cce9/raw/83df07d56bf36cdba019e6663ee77c1e1649a7a1/cron-vmbackup.Dockerfile

# edit args for your vmbackup config at docker file
version: '3.5'
services:
vminsert:
image: victoriametrics/vminsert:v1.60.0-cluster
command:
- '--storageNode=vmstorage-0:8400'
- '--storageNode=vmstorage-1:8400'
- '--storageNode=vmstorage-2:8400'
- '--storageNode=vmstorage-3:8400'
- '--storageNode=vmstorage-4:8400'