Skip to content

🗡️💥 Example repo to test and demonstrate hofund tool set 💥🗡️

License

Notifications You must be signed in to change notification settings

logchange/hofund-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🗡️💥 hofund-example 💥🗡️

This project is used to demonstrate and test hofund - tool set to monitor applications, connections and discover current state of components of the system

Overview

This project contains following modules:

  • products
  • cart
  • payment
  • stats

Grafana Credentials

  • Grafana

  • Login: admin

  • Password: foobar

Prometheus

Nodes


sum(label_replace(label_replace(hofund_connection_status, "title", "$1", "target","(.+)"), "id", "$1", "title", "(.+)")) without (source, target, instance, job, type) or
sum(label_replace(label_replace(hofund_info_status, "title", "$1", "application_name","(.+)"), "subtitle", "$1", "application_version", "(.+)")) without (application_name, application_version, instance, job)

Edges

sum(label_replace(hofund_connection_status, "title", "$1", "target","(.+)")) without (source, target, instance, job, type)

nodes from last 7 days:

sum(0 * sum_over_time(hofund_node[7d])) by (id, title, subtitle, type)

% of time when node was up

sum(avg_over_time(( sum without() (hofund_info) or (0 * sum_over_time(hofund_info[7d])) )[7d:5m])) by (id)

Current state of nodes:

sum(sum without() (hofund_info) or (0 * sum_over_time(hofund_info[7d]))) by (id)

Some interesting query for nodes with mainstat

(sum(0 * sum_over_time(hofund_node[7d])) by (id, title, subtitle, type)) * on (id) group_left(mainstat) (count_values without() ("mainstat", sum(avg_over_time(( sum without() (hofund_info) or (0 * sum_over_time(hofund_info[7d])) )[7d:5m])) by (id)))

And one more


      (sum by (id, title, subtitle, type) (0 * sum_over_time(hofund_node[1w])))
    * on (id) group_left (mainstat)
      (
        count_values without () (
          "mainstat",
          sum by (id) (sum by (id) (sum without () (hofund_info) or (0 * sum_over_time(hofund_info[1w]))))
        )
      )
  * on (id) group_left (secondarystat)
    (
      count_values without () (
        "secondarystat",
        round(
          avg_over_time((sum without () (hofund_info) or (0 * sum_over_time(hofund_info[1w])))[1w:5m]),
          0.001
        )
      )
    )
or on (id)
  (sum by (id, title, subtitle, type) (0 * sum_over_time(hofund_node[1w])))

final nodes query??

      (sum by (id, title, subtitle, type) (0 * sum_over_time(hofund_node[1w])))
    * on (id) group_left (mainstat)
      (
        count_values without () (
          "mainstat",
          sum by (id) (sum by (id) (sum without () (hofund_info) or (0 * sum_over_time(hofund_info[1w]))))
        )
      )
  * on (id) group_left (secondarystat)
    (
      count_values without () (
        "secondarystat",
        round(avg_over_time((sum without () (hofund_info) or (0 * sum_over_time(hofund_info[1w])))[1w:5m]), 0.001)
      )
    )
  * on (id) group_left (arc__up)
      (
        count_values without () (
          "arc__up",
          sum by (id) (sum by (id) (sum without () (hofund_info) or (0 * sum_over_time(hofund_info[1w])))) * 0.999999
        )
      )
  * on (id) group_left (arc__down)
      (
        count_values without () (
          "arc__down",
          abs(sum by (id) (sum by (id) (sum without () (hofund_info) or (0 * sum_over_time(hofund_info[1w])))) - 1) * 0.999999
        )
      )
or on (id)
  (sum by (id, title, subtitle, type) (0 * sum_over_time(hofund_node[1w])) * on (id) group_left (arc__notfound)
      (
        count_values without () (
          "arc__notfound", (0 * sum_over_time(hofund_node[1w]) + 1) * 0.999999
        )
      ))

About

🗡️💥 Example repo to test and demonstrate hofund tool set 💥🗡️

Resources

License

Stars

Watchers

Forks