Skip to content

Commit

Permalink
values tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
benc-uk committed Mar 21, 2021
1 parent c0fc143 commit fbc89bb
Show file tree
Hide file tree
Showing 6 changed files with 226 additions and 79 deletions.
18 changes: 5 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
name: Release Assets

# This is a generic release pipeline that assumes project is to be built as a container image
# This is triggered on a GitHub release
# Note. REGISTRY_PASSWORD secret must be set and change the IMAGE_NAME
name: Release Image

on:
# Workflow runs when a release is created in GitHub
Expand All @@ -11,26 +7,22 @@ on:

env:
IMAGE_REG: ghcr.io
IMAGE_NAME: __CHANGE_ME__
IMAGE_REPO: benc-uk/postman-prometheus

jobs:
release:
name: Release image
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

# Build image tagged with release tag name, should be a semver
- name: Build the container image
run: make image IMAGE_REPO=$GITHUB_ACTOR/$IMAGE_NAME IMAGE_TAG=${{ github.event.release.tag_name }}
run: make image IMAGE_TAG=${{ github.event.release.tag_name }}

# Then push image to registry
- name: Push to container registry
run: |
echo ${{ secrets.REGISTRY_PASSWORD }} | docker login $IMAGE_REG -u $GITHUB_ACTOR --password-stdin
make push IMAGE_REPO=$GITHUB_ACTOR/$IMAGE_NAME IMAGE_TAG=${{ github.event.release.tag_name }}
# Anything else here
- name: Other steps
run: echo "Not implemented yet!"
make push IMAGE_TAG=${{ github.event.release.tag_name }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
*.tmp.json
*.sample.*
deploy/prometheus-helm/*.yaml
!deploy/prometheus-helm/*.sample.yaml
5 changes: 3 additions & 2 deletions deploy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ spec:
value: 'false'
resources:
limits:
memory: '150Mi'
cpu: '100m'
# Why so high? well I think some of the post requests script use a lot of mem
memory: '300Mi'
cpu: '200m'
ports:
- containerPort: 8080
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ serverFiles:
groups:
- name: myalerts
rules:
# Sets up alert for any assertion fails
- alert: PostmanAssertionsFailed
expr: postman_stats_assertions_failed > 0
for: 1m
Expand All @@ -25,18 +26,19 @@ serverFiles:
annotations:
summary: Postman collection run, one or more requests failed

# Sets up alertmanager to use GMail for email alerts
alertmanagerFiles:
alertmanager.yml:
global: {}
receivers:
- name: email-me
email_configs:
- to: benc.uk@gmail.com
from: benc.uk@gmail.com
- to: __CHANGE_ME__@gmail.com
from: __CHANGE_ME__@gmail.com
smarthost: smtp.gmail.com:587
auth_username: 'benc.uk@gmail.com'
auth_identity: 'benc.uk@gmail.com'
auth_password: 'jaazstiqmzxadsrd'
auth_username: '__CHANGE_ME__@gmail.com'
auth_identity: '__CHANGE_ME__@gmail.com'
auth_password: '__CHANGE_ME__'
route:
group_by: [Alertname]
receiver: email-me
138 changes: 89 additions & 49 deletions grafana/Postman Monitoring.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
}
],
"__requires": [
{
"type": "panel",
"id": "bargauge",
"name": "Bar gauge",
"version": ""
},
{
"type": "panel",
"id": "gauge",
Expand Down Expand Up @@ -52,7 +58,6 @@
"gnetId": null,
"graphTooltip": 0,
"id": null,
"iteration": 1616174354701,
"links": [],
"panels": [
{
Expand All @@ -68,6 +73,7 @@
"dashLength": 10,
"dashes": false,
"datasource": "${DS_PROMETHEUS}",
"description": "",
"fieldConfig": {
"defaults": {
"color": {},
Expand All @@ -83,7 +89,7 @@
"fill": 1,
"fillGradient": 10,
"gridPos": {
"h": 14,
"h": 11,
"w": 24,
"x": 0,
"y": 0
Expand Down Expand Up @@ -118,20 +124,20 @@
"steppedLine": false,
"targets": [
{
"expr": "postman_timings_resp_avg",
"expr": "postman_stats_resp_avg",
"interval": "",
"legendFormat": "{{collection}} avg",
"refId": "A"
},
{
"expr": "postman_timings_resp_max",
"expr": "postman_stats_resp_max",
"hide": false,
"interval": "",
"legendFormat": "{{collection}} max",
"refId": "B"
},
{
"expr": "postman_timings_resp_min",
"expr": "postman_stats_resp_min",
"hide": false,
"interval": "",
"legendFormat": "{{collection}} min",
Expand All @@ -142,7 +148,7 @@
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Response Time",
"title": "Collection Response Time",
"tooltip": {
"shared": true,
"sort": 0,
Expand Down Expand Up @@ -212,10 +218,10 @@
"overrides": []
},
"gridPos": {
"h": 8,
"h": 6,
"w": 8,
"x": 0,
"y": 14
"y": 11
},
"id": 4,
"options": {
Expand Down Expand Up @@ -274,10 +280,10 @@
"overrides": []
},
"gridPos": {
"h": 8,
"h": 6,
"w": 8,
"x": 8,
"y": 14
"y": 11
},
"id": 5,
"options": {
Expand Down Expand Up @@ -336,10 +342,10 @@
"overrides": []
},
"gridPos": {
"h": 8,
"h": 6,
"w": 8,
"x": 16,
"y": 14
"y": 11
},
"id": 6,
"options": {
Expand Down Expand Up @@ -380,12 +386,12 @@
"overrides": []
},
"fill": 1,
"fillGradient": 0,
"fillGradient": 8,
"gridPos": {
"h": 6,
"w": 24,
"h": 10,
"w": 12,
"x": 0,
"y": 22
"y": 17
},
"hiddenSeries": false,
"id": 8,
Expand All @@ -399,7 +405,7 @@
"values": false
},
"lines": true,
"linewidth": 1,
"linewidth": 3,
"nullPointMode": "null",
"options": {
"alertThreshold": true
Expand All @@ -415,15 +421,17 @@
"steppedLine": false,
"targets": [
{
"expr": "rate(postman_lifetime_requests_total[2m])",
"expr": "avg by (request_name) (postman_request_resp_time)",
"interval": "",
"legendFormat": "{{collection}}",
"legendFormat": "{{request_name}}",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"title": "Request Rate",
"timeShift": null,
"title": "Request Times",
"tooltip": {
"shared": true,
"sort": 0,
Expand Down Expand Up @@ -461,42 +469,74 @@
"align": false,
"alignLevel": null
}
},
{
"datasource": "${DS_PROMETHEUS}",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "dark-red",
"value": null
},
{
"color": "dark-green",
"value": 0.00001
}
]
},
"unit": "percentunit"
},
"overrides": []
},
"gridPos": {
"h": 10,
"w": 12,
"x": 12,
"y": 17
},
"id": 9,
"options": {
"displayMode": "lcd",
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showUnfilled": false,
"text": {}
},
"pluginVersion": "7.4.2",
"targets": [
{
"expr": "min by (request_name) (postman_request_status_ok)",
"interval": "",
"legendFormat": "{{request_name}}",
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Request Status",
"type": "bargauge"
}
],
"refresh": "1m",
"schemaVersion": 27,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"allValue": null,
"current": {},
"datasource": "${DS_PROMETHEUS}",
"definition": "postman_stats_iterations_total",
"description": null,
"error": null,
"hide": 0,
"includeAll": false,
"label": "Collection",
"multi": false,
"name": "collection",
"options": [],
"query": {
"query": "postman_stats_iterations_total",
"refId": "StandardVariableQuery"
},
"refresh": 1,
"regex": "/.*collection=\"(.*?)\"/",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
"list": []
},
"time": {
"from": "now-15m",
Expand Down
Loading

0 comments on commit fbc89bb

Please sign in to comment.