Skip to content

Commit

Permalink
Merge pull request #223 from sysdiglabs/staging
Browse files Browse the repository at this point in the history
Staging Y22W23
  • Loading branch information
daviddetorres authored Jun 17, 2022
2 parents 217882e + 91348f3 commit 56d0c00
Show file tree
Hide file tree
Showing 26 changed files with 4,420 additions and 69 deletions.
1 change: 1 addition & 0 deletions apps/haproxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ keywords:
- Available
availableVersions:
- '2.1'
- '2.3'
shortDescription: "HAProxy is a free, open source load balancer"
description: |
HAProxy is free, open source software that provides a high availability load balancer and proxy server for TCP and HTTP-based applications that spreads requests across multiple servers.
Expand Down
5 changes: 5 additions & 0 deletions apps/images/PHP-FPM.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions apps/php-fpm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
apiVersion: v1
kind: App
name: "php-fpm"
keywords:
- PHP
- Available
availableVersions:
- '7.2'
shortDescription: "PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites."
description: |
PHP-FPM (FastCGI Process Manager) is an alternative PHP FastCGI implementation with some additional features useful for sites of any size, especially busier sites.
icon: https://raw.githubusercontent.com/sysdiglabs/promcat-resources/master/apps/images/PHP-FPM.svg
website: https://www.php.net/manual/en/book.fpm.php
available: true
2 changes: 1 addition & 1 deletion resources/cassandra/INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ spec:
spec:
containers:
- name: cassandra-exporter
image: gcr.io/mateo-burillo-ns/promcat-cassandra-exporter:latest
image: quay.io/sysdig/promcat-cassandra-exporter:v0.9.10
imagePullPolicy: Always
volumeMounts:
- mountPath: /var/lib/cassandra
Expand Down
2 changes: 1 addition & 1 deletion resources/cassandra/include/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
spec:
containers:
- name: cassandra-exporter
image: gcr.io/mateo-burillo-ns/promcat-cassandra-exporter:latest
image: quay.io/sysdig/promcat-cassandra-exporter:v0.9.10
imagePullPolicy: Always
volumeMounts:
- mountPath: /var/lib/cassandra
Expand Down
24 changes: 14 additions & 10 deletions resources/haproxy-ingress/ALERTS.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,25 @@
# Alerts
## UpTimeLessThan1Hour
This alert detects when all of the instances of the ingress controller have an uptime of less tha 1 hour.
## [Haproxy-Ingress] Uptime less than 1 hour
This alert detects when all of the instances of the ingress controller have an uptime of less than 1 hour.

## FrontendDown
## [Haproxy-Ingress] Frontend Down
This alert detects when a frontend has all of its instances down for more than 10 minutes.

## BackendDown
## [Haproxy-Ingress] Backend Down
This alert detects when a backend has all of its instances down for more than 10 minutes.

## HighSessionsUsage
## [Haproxy-Ingress] High Sessions Usage
This alert triggers when the backend sessions overpass the 85% of the sessions capacity for 10 minutes.

## HigErrorRate
This alert triggers when the is an error rate over 15% for over 10 minutes in a proxy.
## [Haproxy-Ingress] High Error Rate
This alert triggers when there is an error rate over 15% for over 10 minutes in a proxy.

## HighRequestDeniedRate and HighResponseDeniedRate
These alerts detect when there is a denied rate of requests or responses over 10% for over 10 minutes in a proxy.
## [Haproxy-Ingress] High Request Denied Rate
These alerts detect when there is a denied rate of requests over 10% for over 10 minutes in a proxy.

## HighResponseTime
## [Haproxy-Ingress] High Response Denied Rate
These alerts detect when there is a denied rate of responses over 10% for over 10 minutes in a proxy.

## [Haproxy-Ingress] High Response Rate
This alert triggers when a proxy has a mean response time higher than 250ms for over 10 minutes.

32 changes: 32 additions & 0 deletions resources/haproxy-ingress/INSTALLv2.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Adding HAProxy Ingress
To install the HAProxy, you can use the [official Helm chart](https://github.com/haproxytech/helm-charts):
```sh
helm repo add haproxytech https://haproxytech.github.io/helm-charts
helm repo update
```

# Install k8s HAProxy ingress controller and configuring Prometheus metrics
This command will install haproxy-ingress helm chart with prometheus metrics and haproxy stats enabled
```
helm install haproxy-ingress haproxy-ingress/haproxy-ingress \
--set-string "controller.stats.enabled = true" \
--set-string "controller.metrics.enabled = true"
```

Metrics will be exposed via 9101 port and /metrics path

# Pod and metrics check

To get the pods of the ingress:
```
kubectl get pods -l app.kubernetes.io/instance=haproxy-ingress -n haproxy-ingress
```
Port forward 9101 to your localhost

```
kubectl port-forward -n haproxy-ingress pod-name 9101:9101
```
To count the metrics of a pod:
```
curl 'http://localhost:9101/metrics' | grep -v "# HELP\|# TYPE" | wc -l
```
123 changes: 66 additions & 57 deletions resources/haproxy-ingress/alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,66 +4,75 @@ app: HAProxy Ingress
version: 1.0.0
appVersion:
- '2.1'
- '2.3'
descriptionFile: ALERTS.md
configurations:
- kind: Prometheus
data: |
groups:
- name: HAProxy-Ingress
- name: Haproxy-Ingress
rules:
- alert: UpTimeLessThan1Hour
expr: max(time() - haproxy_process_start_time_seconds) < 3600
for: 10m
labels:
severity: page
annotations:
summary: Up Time of less than 1 hour
- alert: FrontendDown
expr: count by (proxy) (haproxy_frontend_status == 1) == 0
for: 10m
labels:
severity: page
annotations:
summary: Frontend down {{$labels.proxy}}
- alert: BackendDown
expr: sum by (proxy) (haproxy_backend_status==1) == 0
for: 10m
labels:
severity: page
annotations:
summary: No backend instances found for the proxy {{$labels.proxy}}
- alert: HighSessionsUsage
expr: max by (proxy)(rate(haproxy_backend_sessions_total[5m]) / haproxy_backend_limit_sessions) >0.85
for: 10m
labels:
severity: page
annotations:
summary: Low number of sessions available in proxy {{$labels.proxy}}
- alert: HigErrorRate
expr: sum by (proxy)(rate(haproxy_backend_http_responses_total{code!="2xx"}[5m])) / sum by (proxy)(rate(haproxy_backend_http_responses_total[5m])) > 0.15
for: 10m
labels:
severity: page
annotations:
summary: High HTTP error rate in proxy {{$labels.proxy}}
- alert: HighRequestDeniedRate
expr: sum by (proxy) (rate(haproxy_backend_requests_denied_total[5m])) / sum by (proxy)(rate(haproxy_backend_http_requests_total[5m])) > 0.15
for: 10m
labels:
severity: page
annotations:
summary: High request denied error rate in proxy {{$labels.proxy}}
- alert: HighResponseDeniedRate
expr: sum by (proxy) (rate(haproxy_backend_responses_denied_total[5m])) / sum by (proxy)(rate(haproxy_backend_http_responses_total[5m])) > 0.15
for: 10m
labels:
severity: page
annotations:
summary: High responses denied rate in proxy {{$labels.proxy}}
- alert: HighResponseTime
expr: max by (proxy) (haproxy_backend_response_time_average_seconds)> 0.25
for: 10m
labels:
severity: page
annotations:
summary: High response time in proxy {{$labels.proxy}}
- alert: '[Haproxy-Ingress] Uptime less than 1 hour'
expr: |
max(time() - haproxy_process_start_time_seconds) < 3600
for: 10m
labels:
severity: critical
annotations:
description: This alert detects when all of the instances of the ingress controller have an uptime of less than 1 hour.
- alert: '[Haproxy-Ingress] Frontend Down'
expr: |
count by (proxy) (haproxy_frontend_status == 1) == 0
for: 10m
labels:
severity: critical
annotations:
description: This alert detects when a frontend has all of its instances down for more than 10 minutes.
- alert: '[Haproxy-Ingress] Backend Down'
expr: |
sum by (proxy) (haproxy_backend_status == 1) == 0
for: 10m
labels:
severity: critical
annotations:
description: This alert detects when a backend has all of its instances down for more than 10 minutes.
- alert: '[Haproxy-Ingress] High Sessions Usage'
expr: |
max by (proxy)(rate(haproxy_backend_sessions_total[5m]) / haproxy_backend_limit_sessions) >0.85
for: 10m
labels:
severity: critical
annotations:
description: This alert triggers when the backend sessions overpass the 85% of the sessions capacity for 10 minutes.
- alert: '[Haproxy-Ingress] High Error Rate'
expr: |
sum by (proxy)(rate(haproxy_backend_http_responses_total{code!="2xx"}[5m])) / sum by (proxy)(rate(haproxy_backend_http_responses_total[5m])) > 0.15
for: 10m
labels:
severity: critical
annotations:
description: This alert triggers when there is an error rate over 15% for over 10 minutes in a proxy.
- alert: '[Haproxy-Ingress] High Request Denied Rate'
expr: |
sum by (proxy) (rate(haproxy_backend_requests_denied_total[5m])) / sum by (proxy)(rate(haproxy_backend_http_requests_total[5m])) > 0.15
for: 10m
labels:
severity: critical
annotations:
description: These alerts detect when there is a denied rate of requests over 10% for over 10 minutes in a proxy.
- alert: '[Haproxy-Ingress] High Response Denied Rate'
expr: |
sum by (proxy) (rate(haproxy_backend_responses_denied_total[5m])) / sum by (proxy)(rate(haproxy_backend_http_responses_total[5m])) > 0.15
for: 10m
labels:
severity: critical
annotations:
description: These alerts detect when there is a denied rate of responses over 10% for over 10 minutes in a proxy.
- alert: '[Haproxy-Ingress] High Response Rate'
expr: |
max by (proxy) (haproxy_backend_response_time_average_seconds)> 0.25
for: 10m
labels:
severity: critical
annotations:
description: This alert triggers when a proxy has a mean response time higher than 250ms for over 10 minutes.
50 changes: 50 additions & 0 deletions resources/haproxy-ingress/dashboardsv2.3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
apiVersion: v1
kind: Dashboard
app: HAProxy Ingress
version: 1.0.0
appVersion:
- '2.3'
configurations:
- name: HAProxy K8s Ingress Overview
kind: Sysdig
image: haproxy-ingress/images/haproxy-sysdig-ingress-overview-2.3.png
description: |
This dashboard offers information on:
* Up Time
* Instances
* Frontend OK
* Frontend FULL
* Frontend STOPPED
* Backend DOWN
* Connections and Sessions
* SSL Connections
* Active Jobs
* Request and Response Errors
* Tasks
* Active and Connected Peers
* Process Run Queue
* Connection ans Session Denied
* Frontend Bytes In
* Frontend Connections
* Frontend Bytes Out
* Frontend Requests (TCP and HTTP)
file: include/dashboard-Sysdig-HAProxy-K8s-Ingress-Overview-2.3.json
- name: HAProxy Proxy Golden Signals
kind: Sysdig
image: haproxy-ingress/images/haproxy-sysdig-proxy-golden-signals-2.3.png
description: |
This dashboard has the option to select a proxy and offers information on:
* Instances UP
* Instances Down
* Sessions Usage
* Queued Requests
* HTTP Error Rate
* Denial Rate
* HTTP Error by Code
* Data Transfers Aborted
* Mean Response Time
* Mean Connect and Queue Time
* Throughput
* IOPS
* Request and Response Size
file: include/dashboard-Sysdig-HAProxy-Proxy-Golden-Signals-2.3.json
1 change: 1 addition & 0 deletions resources/haproxy-ingress/description.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ app: HAProxy Ingress
version: 1.0.0
appVersion:
- '2.1'
- '2.3'
descriptionFile: README.md
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 56d0c00

Please sign in to comment.