Skip to content

Commit

Permalink
Merge pull request #6 from scalair/product-apache
Browse files Browse the repository at this point in the history
Add `apache` as product for tethys
  • Loading branch information
Xat59 authored May 6, 2021
2 parents 61ea70d + 3572579 commit c8cb1ef
Show file tree
Hide file tree
Showing 6 changed files with 850 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ Because metrics datas retrieved from federated prometheuses servers must have th
|cadvisor|Kubernetes|helm|<https://artifacthub.io/packages/helm/ckotzbauer/cadvisor>|Install cadvisor for in-depth metrics in Kubernetes workloads.|
|elasticsearch-exporter|VM, instances, etc.|ansible|<https://galaxy.ansible.com/lyr/elasticsearch_exporter>|Install elasticsearch-exporter on classic instance or virtual machines|
|elasticsearch-exporter|Kubernetes|helm|<https://artifacthub.io/packages/helm/prometheus-community/prometheus-elasticsearch-exporter>|Install elasticsearch-exporter within Kubernetes.|
|apache-exporter|VM, instances, etc.|ansible|<https://galaxy.ansible.com/idealista/apache_exporter-role>|Install apache-exporter on classic instance or virtual machines.|


## Variables

Expand All @@ -46,7 +48,7 @@ A list of clients to federate. Each client in `clients` has the following variab
- `username` : specify the username for basic_auth to request the endpoint.
- `password` : specify the password for basic_auth to request the endpoint.
- `kubernetes_hosted`: specify if the prometheus endpoint is hosted on Kubernetes. If `true`, then it will also retrieve metrics data and create dashboards for this Kubernetes cluster.
- `products`: a list of products the client has. It means the specified federated prometheus actually has metrics data for these products. For now, it only allows `node`, `kubernetes`, and `elasticsearch`.
- `products`: a list of products the client has. It means the specified federated prometheus actually has metrics data for these products. For now, it only allows `node`, `kubernetes`, `elasticsearch` and `apache`.
- `prometheus_rules`: a list of custom prometheus rules based on [Prometheus 2.0 documentation](https://prometheus.io/docs/prometheus/latest/configuration/template_examples/), to create for this client. Please note to use `!unsafe` keyword as prefix for every string that uses dollar sign `$` to avoid templating. By default, `prometheus_rules` is empty and [standard rules](https://github.com/scalair/tethys/blob/dev/templates/prometheus/client.rules.j2) will be automatically applied for each defined `products`.

_Example usage:_
Expand Down
8 changes: 8 additions & 0 deletions tasks/generate-dashboards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,11 @@
loop: "{{ client.prometheus_federation }}"
loop_control:
loop_var: clusterID

- name: generate-dashboards| apache
template:
src: dashboards/apache.json.j2
dest: "{{ tmpdir.path }}/grafana/{{ client.name }}-apache.json"
mode: 0640
when: "'apache' in client.products"

2 changes: 1 addition & 1 deletion tasks/generate-rules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
tags:
- generate-rules

- name: generate-rules| rules files directory
- name: generate-rules| show rules files directory
debug:
msg: "Prometheus rules directory : {{ tmpdir.path }}/prometheus/"
tags:
Expand Down
Loading

0 comments on commit c8cb1ef

Please sign in to comment.