Skip to content

Instantly share code, notes, and snippets.

@2color
Last active October 30, 2017 10:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 2color/db4363fd79020342edea3d29be34caa2 to your computer and use it in GitHub Desktop.
Save 2color/db4363fd79020342edea3d29be34caa2 to your computer and use it in GitHub Desktop.
Prometheus Queries
  • Get rid of pushgateway
  • Saturation - Load testing to determine upper threshold (up 10 rq/sec)
  • Imminent
  • Should we use summeries
    • Historical
    • There might be situation where you don't care about aggregation
  • Historgrams
    • Use up to 10 bukcets
    • Some use cases if you don't know the
    • Aggregations, quantile, timewindow at query time
    • Problem is that you need to choose buckets up from with latency expectations
    • AppDex - Good latency, acceptanceable , bad latency aggregated
    • Even simpler, two buckets

USE - Utilization Saturation Errors RED - requests errors durations LEST - Latency Errors Saturation Traffic

  • List the number of timeseries per metric name/job sort_desc(count by (__name__, job) ({__name__=~".+"}) )

  • Sum the number of nginx connections per instances sum by (instance)(nginx_http_connections{instance=~"185.+"})

  • Rule for DST IF ( (month() => 3 and day_of_month() => 26) or (month() <= 10 and day_of_month() < 29) ) and hour() == 10 and minute() >= 35

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment