Skip to content
This repository was archived by the owner on Jan 19, 2024. It is now read-only.

Commit de93089

Browse files
chore: update codeowners and readme (#221)
* chore: update codeowners and readme Signed-off-by: Christian Kreuzberger <[email protected]> * review Signed-off-by: Christian Kreuzberger <[email protected]> * review: typo Signed-off-by: Christian Kreuzberger <[email protected]>
1 parent 4a02e0b commit de93089

File tree

2 files changed

+76
-56
lines changed

2 files changed

+76
-56
lines changed

CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
# Each line is a file pattern followed by one or more owners.
33

44
# These owners will be the default owners for everything in the repo.
5-
@bacherfl
5+
* @christian-kreuzberger-dtx @bacherfl

README.md

Lines changed: 75 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,12 @@
11
# Prometheus Service
22
![GitHub release (latest by date)](https://img.shields.io/github/v/release/keptn-contrib/prometheus-service)
3-
[![Build Status](https://travis-ci.org/keptn-contrib/prometheus-service.svg?branch=master)](https://travis-ci.org/keptn-contrib/prometheus-service)
43
[![Go Report Card](https://goreportcard.com/badge/github.com/keptn-contrib/prometheus-service)](https://goreportcard.com/report/github.com/keptn-contrib/prometheus-service)
54

6-
The *prometheus-service* is a [Keptn](https://keptn.sh) service that is responsible for:
5+
The *prometheus-service* is a [Keptn](https://keptn.sh) integration responsible for:
76

8-
1. configuring Prometheus for monitoring services managed by Keptn, and
9-
2. receiving alerts from Prometheus Alertmanager and translating the alert payload to a cloud event that is sent to the Keptn API.
10-
3. It's used for retrieving Service Level Indicators (SLIs) from a Prometheus API endpoint. Per default, it fetches metrics from the prometheus instance set up by Keptn
11-
(`prometheus-service.monitoring.svc.cluster.local:8080`), but it can also be configured to use any reachable Prometheus endpoint using basic authentication by providing the credentials
12-
via a secret in the `keptn` namespace of the cluster.
13-
14-
The supported default SLIs are:
15-
16-
- throughput
17-
- error_rate
18-
- response_time_p50
19-
- response_time_p90
20-
- response_time_p95
21-
22-
The provided SLIs are based on the [RED metrics](https://grafana.com/files/grafanacon_eu_2018/Tom_Wilkie_GrafanaCon_EU_2018.pdf)
7+
1. configuring Prometheus for monitoring services managed by Keptn,
8+
2. receiving alerts (on port 8080) from Prometheus Alertmanager and translating the alert payload to a cloud event (remediation.triggered) that is sent to the Keptn API,
9+
3. retrieving Service Level Indicators (SLIs) from a Prometheus API endpoint.
2310

2411
## Compatibility Matrix
2512

@@ -43,11 +30,80 @@ Please always double-check the version of Keptn you are using compared to the ve
4330
| 0.9.0 - 0.9.2 | keptncontrib/prometheus-service:0.7.0 |
4431
| 0.10.0 | keptncontrib/prometheus-service:0.7.1 |
4532

46-
## Setup Prometheus Monitoring
33+
## Installation instructions
34+
35+
### Setup Prometheus Monitoring
4736

4837
Keptn does not install or manage Prometheus and its components. Users need to install Prometheus and Prometheus Alert manager as a prerequisite.
4938

50-
Some environment variables have to set up in the prometheus-service deployment
39+
The easiest way would be to setup Prometheus using helm, e.g.:
40+
```console
41+
kubectl create ns monitoring
42+
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
43+
helm install prometheus prometheus-community/prometheus --namespace monitoring
44+
```
45+
46+
### Install prometheus-service
47+
48+
Please replace the placeholders in the commands below. Examples are provided.
49+
50+
* `<VERSION>`: prometheus-service version, e.g., `0.7.1`
51+
* `<PROMETHEUS_NS>`: If prometheus is installed in the same Kubernetes cluster, the namespace needs to be provided, e.g., `monitoring`
52+
* `<PROMETHEUS_ENDPOINT>`: Endpoint for prometheus (primarily used for fetching metrics), e.g., `http://prometheus-server.monitoring.svc.cluster.local:80`
53+
* `<ALERT_MANAGER_NS>`: if prometheus alert manager is installed in the same Kubernetes cluster, the namespace needs to be provided, e.g., `monitoring`
54+
55+
56+
Once this is done, you can go ahead and install prometheus-service:
57+
58+
59+
* Install Keptn prometheus-service in Kubernetes using
60+
61+
```bash
62+
kubectl apply -f https://raw.githubusercontent.com/keptn-contrib/prometheus-service/release-<VERSION>/deploy/service.yaml
63+
```
64+
65+
* Install Role and RoleBinding to permit prometheus-service for performing operations in the Prometheus installed namespace:
66+
67+
```bash
68+
kubectl apply -f https://raw.githubusercontent.com/keptn-contrib/prometheus-service/release-<VERSION>/deploy/role.yaml -n <PROMETHEUS_NS>
69+
```
70+
71+
72+
* Replace the environment variable value according to the use case and apply the manifest:
73+
74+
```
75+
# Prometheus installed namespace
76+
kubectl set env deployment/prometheus-service -n keptn --containers="prometheus-service" PROMETHEUS_NS="<PROMETHEUS_NS>"
77+
78+
# Setup Prometheus Endpoint
79+
kubectl set env deployment/prometheus-service -n keptn --containers="prometheus-service" PROMETHEUS_ENDPOINT="<PROMETHEUS_ENDPOINT>"
80+
81+
# Alert Manager installed namespace
82+
kubectl set env deployment/prometheus-service -n keptn --containers="prometheus-service" ALERT_MANAGER_NS="<ALERT_MANAGER_NS>"
83+
```
84+
85+
86+
* Execute the following command to configure Prometheus and set up the rules for the *Prometheus Alerting Manager*:
87+
88+
```bash
89+
keptn configure monitoring prometheus --project=sockshop --service=carts
90+
```
91+
92+
### Optional: Verify Prometheus setup in your cluster
93+
94+
* To verify that the Prometheus scrape jobs are correctly set up, you can access Prometheus by enabling port-forwarding for the prometheus-server:
95+
96+
```bash
97+
kubectl port-forward svc/prometheus-server 8080:80 -n <PROMETHEUS_NS>
98+
```
99+
100+
Prometheus is then available on [localhost:8080/targets](http://localhost:8080/targets) where you can see the targets for the service.
101+
102+
103+
### Advanced Options
104+
105+
You can customize prometheus-service with the following environment variables:
106+
51107
```yaml
52108
# Prometheus installed namespace
53109
- name: PROMETHEUS_NS
@@ -78,42 +134,6 @@ Some environment variables have to set up in the prometheus-service deployment
78134
value: 'alertmanager-templates'
79135
```
80136
81-
### Execute the following steps to install prometheus-service
82-
83-
* Download the Keptn Prometheus service manifest:
84-
85-
```bash
86-
wget https://raw.githubusercontent.com/keptn-contrib/prometheus-service/release-0.7.0/deploy/service.yaml
87-
```
88-
89-
* Replace the environment variable value according to the use case and apply the manifest:
90-
91-
```bash
92-
kubectl apply -f service.yaml
93-
```
94-
95-
* Install Role and RoleBinding to permit prometheus-service for performing operations in the Prometheus installed namespace:
96-
97-
```bash
98-
kubectl apply -f https://raw.githubusercontent.com/keptn-contrib/prometheus-service/release-0.7.0/deploy/role.yaml -n <PROMETHEUS_NS>
99-
```
100-
101-
* Execute the following command to install Prometheus and set up the rules for the *Prometheus Alerting Manager*:
102-
103-
```bash
104-
keptn configure monitoring prometheus --project=sockshop --service=carts
105-
```
106-
107-
### Optional: Verify Prometheus setup in your cluster
108-
109-
* To verify that the Prometheus scrape jobs are correctly set up, you can access Prometheus by enabling port-forwarding for the prometheus-server:
110-
111-
```bash
112-
kubectl port-forward svc/prometheus-server 8080 -n <PROMETHEUS_NS>
113-
```
114-
115-
Prometheus is then available on [localhost:8080/targets](http://localhost:8080/targets) where you can see the targets for the service.
116-
117137
## Prometheus SLI provider
118138
119139
Per default, the service works with the following assumptions regarding the setup of the Prometheus instance:

0 commit comments

Comments
 (0)