Skip to content

Commit

Permalink
Docker prometheus and grafana
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartek-Figat committed Oct 12, 2023
1 parent 4a50419 commit 3675c66
Show file tree
Hide file tree
Showing 24 changed files with 3,624 additions and 141 deletions.
75 changes: 42 additions & 33 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,51 @@
version: "3.7"
version: "3.8"

services:
prometheus:
image: prom/prometheus
ports:
- 9090:9090
volumes:
- ./prometheus:/etc/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'

grafana:
image: grafana/grafana
container_name: grafana
restart: unless-stopped
ports:
- 3000:3000
volumes:
- ./grafana:/var/lib/grafana

backend:
container_name: API
container_name: backend
build:
dockerfile: Dockerfile
context: ./packages/backEnd
restart: always
cap_drop:
- ALL
cap_add:
- CHOWN
- SETGID
- SETUID
user: 1000:1000
resources:
limits:
cpus: '0.50'
memory: 50M
security_opt:
- no-new-privileges
context: ./packages/backEnd/
volumes:
- ./packages/backEnd:/app
- /app/node_modules
env_file:
- .env
networks:
- app-network
ports:
- "8080:8080"

frontend:
container_name: Client
build:
dockerfile: Dockerfile
context: ./packages/frontEnd
restart: on-failure
volumes:
- ./packages/frontEnd:/app
- /app/node_modules
networks:
- app-network
ports:
- "3000:3000"
- "3001:3001"
depends_on:
- backend
environment:
Expand All @@ -44,24 +54,23 @@ services:
nginx:
container_name: Nginx
image: nginx:latest
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
# volumes:
# - ./nginx/nginx.conf:/etc/nginx/nginx.conf
ports:
- 80:80
- 443:443

certbot:
container_name: Certbot
image: certbot/certbot
volumes:
- certbot-etc:/etc/letsencrypt
- certbot-var:/var/lib/letsencrypt
command: certonly --webroot --webroot-path=/var/www/html --email your-email@example.com --agree-tos --no-eff-email --force-renewal -d your-domain.com
# certbot:
# container_name: Certbot
# image: certbot/certbot
# volumes:
# - certbot-etc:/etc/letsencrypt
# - certbot-var:/var/lib/letsencrypt
# command: certonly --webroot --webroot-path=/var/www/html --email your-email@example.com --agree-tos --no-eff-email --force-renewal -d your-domain.com

networks:
app-network:
driver: bridge
certbot-data:
external: true
certbot-var:
external: true
# certbot-data:
# external: true
# certbot-var:
# external: true
53 changes: 53 additions & 0 deletions grafana/alerting/1/__default__.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

{{ define "__subject" }}[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ if gt (.Alerts.Resolved | len) 0 }}, RESOLVED:{{ .Alerts.Resolved | len }}{{ end }}{{ end }}] {{ .GroupLabels.SortedPairs.Values | join " " }} {{ if gt (len .CommonLabels) (len .GroupLabels) }}({{ with .CommonLabels.Remove .GroupLabels.Names }}{{ .Values | join " " }}{{ end }}){{ end }}{{ end }}

{{ define "__text_values_list" }}{{ if len .Values }}{{ $first := true }}{{ range $refID, $value := .Values -}}
{{ if $first }}{{ $first = false }}{{ else }}, {{ end }}{{ $refID }}={{ $value }}{{ end -}}
{{ else }}[no value]{{ end }}{{ end }}

{{ define "__text_alert_list" }}{{ range . }}
Value: {{ template "__text_values_list" . }}
Labels:
{{ range .Labels.SortedPairs }} - {{ .Name }} = {{ .Value }}
{{ end }}Annotations:
{{ range .Annotations.SortedPairs }} - {{ .Name }} = {{ .Value }}
{{ end }}{{ if gt (len .GeneratorURL) 0 }}Source: {{ .GeneratorURL }}
{{ end }}{{ if gt (len .SilenceURL) 0 }}Silence: {{ .SilenceURL }}
{{ end }}{{ if gt (len .DashboardURL) 0 }}Dashboard: {{ .DashboardURL }}
{{ end }}{{ if gt (len .PanelURL) 0 }}Panel: {{ .PanelURL }}
{{ end }}{{ end }}{{ end }}

{{ define "default.title" }}{{ template "__subject" . }}{{ end }}

{{ define "default.message" }}{{ if gt (len .Alerts.Firing) 0 }}**Firing**
{{ template "__text_alert_list" .Alerts.Firing }}{{ if gt (len .Alerts.Resolved) 0 }}

{{ end }}{{ end }}{{ if gt (len .Alerts.Resolved) 0 }}**Resolved**
{{ template "__text_alert_list" .Alerts.Resolved }}{{ end }}{{ end }}


{{ define "__teams_text_alert_list" }}{{ range . }}
Value: {{ template "__text_values_list" . }}
Labels:
{{ range .Labels.SortedPairs }} - {{ .Name }} = {{ .Value }}
{{ end }}
Annotations:
{{ range .Annotations.SortedPairs }} - {{ .Name }} = {{ .Value }}
{{ end }}
{{ if gt (len .GeneratorURL) 0 }}Source: [{{ .GeneratorURL }}]({{ .GeneratorURL }})

{{ end }}{{ if gt (len .SilenceURL) 0 }}Silence: [{{ .SilenceURL }}]({{ .SilenceURL }})

{{ end }}{{ if gt (len .DashboardURL) 0 }}Dashboard: [{{ .DashboardURL }}]({{ .DashboardURL }})

{{ end }}{{ if gt (len .PanelURL) 0 }}Panel: [{{ .PanelURL }}]({{ .PanelURL }})

{{ end }}
{{ end }}{{ end }}


{{ define "teams.default.message" }}{{ if gt (len .Alerts.Firing) 0 }}**Firing**
{{ template "__teams_text_alert_list" .Alerts.Firing }}{{ if gt (len .Alerts.Resolved) 0 }}

{{ end }}{{ end }}{{ if gt (len .Alerts.Resolved) 0 }}**Resolved**
{{ template "__teams_text_alert_list" .Alerts.Resolved }}{{ end }}{{ end }}
Binary file added grafana/grafana.db
Binary file not shown.
132 changes: 132 additions & 0 deletions grafana/plugins/grafana-github-datasource/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
# Change Log

## [1.5.1] - 2023-10-10

- **Feature** - Update configuration page
- **Chore** - Update feature tracking usage to improve performance

## [1.5.0] - 2023-09-13

- **Feature** - Issues Query: Allow repo to be optional

## [1.4.7] - 2023-08-03

- **Feature** - Add ability to query Workflow and Workflow usage

## [1.4.6] - 2023-07-14

- **Bugfix** - Fixed a bug where disabled queries were still being executed

## [1.4.5] - 2023-05-04

- **Chore** - Backend binaries are now compiled with golang 1.20.4

## [1.4.4] - 2023-04-19

- **Chore** - Updated go version to 1.20

## [1.4.3] - 2023-03-07

- **Chore** - Update grafana-plugin-sdk-go to v0.155.0 to fix `The content of this plugin does not match its signature` error

## [1.4.2] - 2023-03-06

- **Chore** - Migrate to create plugin and upgrade dependencies

## [1.4.1] - 2023-03-01

- **Feature** - Added `RepositoryVulnerabilityAlertState` field to `Vulnerabilities` query

## [1.4.0] - 2023-02-03

- **Feature** - Added stargazers query type
- **Chore** - Minor documentation updates

## [1.3.3] - 2023-01-09

- **Chore** - Removed angular dependency: migrated annotation editor

## [1.3.2] - next

- **Feature** Added `$__toDay()` macro support

## [1.3.1] 2022-12-21

- **Chore** - Updated go version to latest (1.19.4)
- **Chore** - Updated backend grafana dependencies
- **Chore** - Added spellcheck

## [1.3.0] 2022-11-3

- **Feature** - Github projects - query items, user projects
- **Chore** - Updated build to use go 1.19.3

## [1.2.0] 2022-10-20

- **Feature** - Github projects

## [1.1.0] - next

- Updated grafana minimum runtime required to 8.4.7

## [1.0.15] 2022-05-05

- Fix variable interpolation

## [1.0.14] 2022-04-25

- Added a `$__multiVar()` macro support

## [1.0.13] 2021-12-01

- Fixed a bug where dashboard variables could not be set properly

## [1.0.12] 2021-12-01

- Added refId in annotation queries

## [1.0.11] 2021-05-17

- Added repository fields to the responses

## [1.0.10] 2021-04-01

- Fixed issue where some time values were being rendered incorrectly

## [1.0.9] 2021-04-01

- Fixed issue where dashboard path was not incorrect

## [1.0.8] 2020-12-10

- Fixed issue where screenshots were not rendering on grafana.com (thanks [@mjseaman](https://github.com/mjseaman))

## [1.0.7] 2020-12-07

- Added Tags to the list of queryable resources in the AnnotationsQueryEditor (
thanks [@nazzzzz](https://github.com/nazzzzz))

## [1.0.6] 2020-09-24

- Added a message to the healthcheck success status (thanks [@vladimirdotk](https://github.com/vladimirdotk))
- Added URL option for GitHub Enterprise Users (thanks [@bmike78](https://github.com/bmike78))

## [1.0.5] 2020-09-15

- Added Pull Request ID (Number), URL, and Repository name to pull request responses ( fixes #60 )
- Added the ability to search for all Pull Requests in an organization using the org: search term ( fixes #61 )
- Removed limit from repository list ( fixes #59 )

## [1.0.3] 2020-09-11

- Add the ability to disable time field filtering for pull requests ( fixes #57 )

## [1.0.1] 2020-09-11

- Add the ability to query repositories for variables ( fixes #52 )
- Fix scoped variables for repeating panels ( fixes #51 )
- The default time field for pull requests (Closed At) is now being displayed instead of an empty dropdown

## [1.0.0] 2020-09-10

- Initial release
Loading

0 comments on commit 3675c66

Please sign in to comment.