In order to keep filters up to date, please use this repo.
| # Fancy welcome message | |
| emojis=("🎯" "🏹" "🚀") | |
| expressions=( | |
| "Arguing that you don't care about the right to privacy because you have nothing to hide is no different than saying you don't care about free speech because you have nothing to say." | |
| "Step by step." | |
| "Keep it simple." | |
| "It doesn't work? Come back to a working state." | |
| "Communication is the key.") | |
| RANDOM1=$$$(date +%s) | |
| RANDOM2=$$$(date +%s) |
A lot of people land when trying to find out how to calculate CPU usage metric correctly in prometheus, myself included! So I'll post what I eventually ended up using as I think it's still a little difficult trying to tie together all the snippets of info here and elsewhere.
This is specific to k8s and containers that have CPU limits set.
To show CPU usage as a percentage of the limit given to the container, this is the Prometheus query we used to create nice graphs in Grafana:
sum(rate(container_cpu_usage_seconds_total{name!~".*prometheus.*", image!="", container_name!="POD"}[5m])) by (pod_name, container_name) /
| set nocompatible " Use VIM settings instead of Vi. | |
| syntax enable " Enable syntax highlighting. | |
| so ~/.vim/plugins.vim " Load all plugins. | |
| "-------------Misc-------------" | |
| set backspace=indent,eol,start " Make backspace behave like every other editor. | |
| set tw=0 " Disable automatic linebreak. | |
| set noerrorbells visualbell t_vb= " No damn bells! | |
| set autowriteall " Automatically write the file when switching buffer. |
The best way to safely and securely use local domains pointing to 127.0.0.1 is to edit your local settings (/etc/hosts) and add your own settings. Keep in mind if you want to use subdomains, you need to enter all variations.
Example:
# Adding bottom of your current file /etc/hosts
################# MY LOCAL DOMAINS
127.0.0.1 local.com admin.local.com
127.0.0.1 domain1.comClick to toggle contents of `code`
CODE!
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
