Skip to content
Snippets Groups Projects
Commit b805dc58 authored by Markus Klose's avatar Markus Klose
Browse files

Erster Verusch mit Prometheus

parent 2e716dca
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ COPY ["package.json", "package-lock.json*", "./"] ...@@ -10,7 +10,7 @@ COPY ["package.json", "package-lock.json*", "./"]
RUN npm install RUN npm install
# Bundle app source code inside the Docker Image # Bundle app source code inside the Docker Image
COPY . .
EXPOSE 3000 EXPOSE 3000
CMD [ "npm", "start" ] CMD [ "npm", "start" ]
\ No newline at end of file
version: '3' version: '3'
services: services:
prometheus:
image: prom/prometheus:latest
container_name: prometheus
ports:
- "9090:9090"
volumes:
- /etc/prometheus:/etc/prometheus
restart: unless-stopped
command:
- "--config.file=/etc/prometheus/prometheus.yml"
grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- "3003:3003"
volumes:
- grafana-data:/var/lib/grafana
restart: unless-stopped
mongodb: mongodb:
image: mongo image: mongo
ports: ports:
- 27017:27017 - 27017:27017
volumes: volumes:
- mongodb:/data/db - mongodb:/data/db
node: node:
restart: always restart: always
build: . build: .
...@@ -21,3 +42,6 @@ services: ...@@ -21,3 +42,6 @@ services:
volumes: volumes:
mongodb: mongodb:
prometheus-data:
grafana-data:
global:
scrape_interval: 15s # By default, scrape targets every 15 seconds.
# Attach these labels to any time series or alerts when communicating with
# external systems (federation, remote storage, Alertmanager).
external_labels:
monitor: 'codelab-monitor'
# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
# The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
- job_name: 'prometheus'
# Override the global default and scrape targets from this job every 5 seconds.
scrape_interval: 5s
static_configs:
- targets: ['localhost:9090']
\ No newline at end of file
...@@ -49,7 +49,6 @@ router.post('/', async(req, res) => { ...@@ -49,7 +49,6 @@ router.post('/', async(req, res) => {
res.sendStatus(401); res.sendStatus(401);
} }
else { else {
console.log("Count is", count)
user.save() user.save()
.then(user => { .then(user => {
res.sendStatus(200); res.sendStatus(200);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment