Skip to content

Instantly share code, notes, and snippets.

@f41gh7
f41gh7 / victoria_metrics_push_gw.py
Created January 17, 2021 02:08
VictoriaMetrics as push gateway.
from prometheus_client import Counter, start_http_server
from threading import Thread
import requests as re
import time
JOB_NAME = 'test'
INSTANCE = 'localhost'
def scrape_and_send(local_url: str, vm_url: str, scrape_interval: int):
@f41gh7
f41gh7 / api-server.yaml
Last active August 21, 2023 10:31
vm operator configuration examples
apiVersion: operator.victoriametrics.com/v1beta1
kind: VMServiceScrape
metadata:
name: apiserver
namespace: monitoring-system
spec:
endpoints:
- bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
bearerTokenSecret:
key: ""
@f41gh7
f41gh7 / gk.yaml
Last active February 24, 2021 19:26
demo
apiVersion: v1
kind: Service
metadata:
name: vm-demo-grafana
labels:
k8s-app: grafana
app.kubernetes.io/name: vm-demo
app.kubernetes.io/component: grafana
spec:
ports:
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'
@f41gh7
f41gh7 / README.md
Last active February 10, 2025 10:58
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
@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 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 / 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 August 12, 2024 18:18
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 / 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.