Skip to content

Instantly share code, notes, and snippets.

f41gh7 /
Last active January 5, 2024 21:15

python wrapper for metricsql expr validation.


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

How to use opentelemetry collector with VictoriaMetrics


Installation of VictoriaMetrics

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

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

Mutli level cluster setup


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 /
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 /
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.


  1. build:
f41gh7 / mimir_overrides.yaml
Last active May 9, 2022 16:21
mimir victoriametrics benchmark helm values
enabled: true
enabled: true
enabled: false
replicas: 1
f41gh7 /
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 /
Last active April 21, 2022 09:34
vmagent k8s discovery timings

how to generate load on vmagent


  • golang
  • python3
  • git


f41gh7 /
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

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