Skip to content

Instantly share code, notes, and snippets.

View dkt26111's full-sized avatar

Duc Truong dkt26111

  • California
View GitHub Profile
@dkt26111
dkt26111 / create_senlin_receiver
Created June 6, 2019 21:17
Create Senlin receiver output
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| action | CLUSTER_SCALE_OUT |
| actor | { |
@dkt26111
dkt26111 / alertmanager.yml
Last active June 6, 2019 21:22
Alertmanager
global:
resolve_timeout: 5m
route:
group_by: ['alertname']
group_wait: 10s
group_interval: 10s
repeat_interval: 1h
routes:
- match:
alertname: HighUsage
@dkt26111
dkt26111 / alert.rules.yml
Created June 6, 2019 18:32
High CPU usage alert rule for Prometheus
groups:
- name: example
rules:
# Alert for any cluster that has average CPU idle < 50%
- alert: HighUsage
expr: avg(irate(node_cpu_seconds_total{mode="idle"}[1m]) * 100) < 50
for: 1m
annotations:
summary: "High usage on {{ $labels.instance }}"
description: "{{ $labels.instance }} has a average CPU idle (current value: {{ $value }}s)"
@dkt26111
dkt26111 / prometheus.yml
Last active June 6, 2019 22:15
Prometheus configuration file to scrape OpenStack instances that belong to Senlin clusters
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'prometheus'
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090']
# Scrape OpenStack instances
- job_name: 'openstack'
openstack_sd_configs:
@dkt26111
dkt26111 / node_exporter_profile.yaml
Created June 6, 2019 18:26
Senlin profile that installs and runs node_exporter
type: os.nova.server
version: 1.0
properties:
name: cirros_server
flavor: 1
image: "cirros-0.4.0-x86_64-disk"
networks:
- network: public
user_data: |
#!/bin/sh