Skip to content

Instantly share code, notes, and snippets.

View tcolgate's full-sized avatar

Tristan Colgate-McFarlane tcolgate

View GitHub Profile
# Example aliases
# alias zshconfig="mate ~/.zshrc"
# alias ohmyzsh="mate ~/.oh-my-zsh"
# Set to this to use case-sensitive completion
# CASE_SENSITIVE="true"
inhibit_rules:
- target_match_re:
severity: ".*-not-ooh"
source_match:
muter: "not-ooh"
- target_match_re:
severity: ".*-only-ooh"
source_match:
muter: "only-ooh"
# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.
# TYPE process_cpu_seconds_total counter
process_cpu_seconds_total 0.18
# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.
# TYPE process_start_time_seconds gauge
process_start_time_seconds 1474462831
# HELP nodejs_memory_rss_bytes V8 resident set size in bytes
# TYPE nodejs_memory_rss_bytes gauge
nodejs_memory_rss_bytes 34484224
# HELP nodejs_memory_heap_total_bytes the V8 heap total in bytes
global:
scrape_configs:
- job_name: 'valid'
static_configs:
- targets:
- "localhost:9100"
relabel_configs:
# Numeric prefix added
- source_labels: [job]
time_current_year = 1970 + round(vector(time()/ (86400 * 365.242196) -0.5))
time_start_current_year_seconds = round(vector(time() / (86400 * 365.242196) -0.5)) * (86400 * 365.242196)
time_end_of_current_day_seconds = 86400 - (time() % 86400)
time_current_day_remaining_seconds = time_end_of_current_day_seconds - time()
time_is_leap_year_bool = (time_current_year % 4 == bool 0 ) and ((time_current_year % 400 == bool 0 ) or (time_current_year % 100 != bool 0 ))
time_end_current_year_seconds = time_start_current_year_seconds + (365 * 86400) + (time_is_leap_year_bool * 86400)
task:cpu_user_seconds:rate1m =
rate(cpu_user_seconds_total[1m])
id:cpu_user_seconds:rate1m =
sum(task:cpu_user_seconds:rate1m{job="mesos-slave"}) by (id)
id_app:cpu_user_seconds:rate1m =
id:cpu_user_seconds:sum_rate1m * on (id) group_left count(up{job="marathon",app=~".+"}) by(id,app)
app:cpu_user_seconds:rate1m =
task:cpu_user_seconds:rate1m =
rate(cpu_user_seconds_total[1m])
id:cpu_user_seconds:rate1m =
sum(task:cpu_user_seconds:rate1m) by (id)
id_app:cpu_user_seconds:rate1m =
id:cpu_user_seconds:sum_rate1m * on (id) group_right count(up{app=~".+"}) by(id,app)
app:cpu_user_seconds:rate1m =
task:cpu_user_seconds:rate1m =
rate(cpu_user_seconds_total[1m])
id:cpu_user_seconds:sum_rate1m =
sum(task:cpu_user_seconds:rate1m) by (id)
app_id:cpu_user_seconds:sum_rate1m =
id:cpu_user_seconds:sum_rate1m * on (id) group_right count(up{app=~".+"}) by(id,app)
app:cpu_user_seconds:sum_rate1m =
relabel_configs:
# Drop anything with a promexclude label
- source_labels: ['__meta_marathon_app_label_promexclude']
regex: '(.+)'
action: drop
- source_labels: ['__meta_marathon_app']
regex: '(.*)'
replacement: '${1}'
target_label: 'app'
task:cpu_user_seconds:rate1m =
rate(cpu_user_seconds_total[1m])
id:cpu_user_seconds:sum_rate1m =
sum(task:cpu_user_seconds:rate1m) by (id)
app:cpu_user_seconds:sum_rate1m =
sum(id:cpu_user_seconds:sum_rate1m * on (id) group_right count(up{app=~".+"}) by(id,app)) by (app)
id:cpus_limit:sum =