Skip to content

Commit

Permalink
add grafana and prometheus stack to quickstart (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekneg54 authored Oct 9, 2023
1 parent 4625899 commit 0b097f7
Show file tree
Hide file tree
Showing 7 changed files with 85 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

* `pre_detector` processor now adds the field `creation_timestamp` to pre-detections.
It contains the time at which a pre-detection was created by the processor.
* add `prometheus` and `grafana` to the quickstart setup to support development

### Bugfix

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,10 @@ Opensearch Dashboards. Following services are available after start up:
| Logprep metrics: | `localhost:8000` |
| Opensearch: | `localhost:9200` |
| Opensearch Dashboards: | `localhost:5601` |
| Grafana Dashboards: | `localhost:3000` |
| Prometheus: | `localhost:9090` |
The credentials for Grafana are `admin` and `admin`.
The example rules that are used in the docker instance of Logprep can be found
in `quickstart/exampledata/rules`.
Expand Down
18 changes: 18 additions & 0 deletions quickstart/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,23 @@ services:
- logprep
- /home/logprep/quickstart/exampledata/config/pipeline.yml

grafana:
image: bitnami/grafana:latest
container_name: grafana
expose:
- 3000
network_mode: host
volumes:
- ../quickstart/exampledata/config/grafana/datasources:/opt/bitnami/grafana/conf/provisioning/datasources
- ../quickstart/exampledata/config/grafana/dashboards:/opt/bitnami/grafana/conf/provisioning/dashboards
prometheus:
image: bitnami/prometheus:latest
container_name: prometheus
network_mode: host
expose:
- 9090
volumes:
- ../quickstart/exampledata/config/prometheus/prometheus.yml:/opt/bitnami/prometheus/conf/prometheus.yml

volumes:
data:
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: 1

providers:
- name: Logprep # A uniquely identifiable name for the provider
folder: Logprep # The folder where to place the dashboards
type: file
options:
path:
/opt/bitnami/grafana/conf/provisioning/dashboards/
# Default path for Windows: C:/Program Files/GrafanaLabs/grafana/public/dashboards
# Default path for Linux is: /var/lib/grafana/dashboards
16 changes: 16 additions & 0 deletions quickstart/exampledata/config/grafana/datasources/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: 1

datasources:
- name: Prometheus
type: prometheus
access: proxy
# Access mode - proxy (server in the UI) or direct (browser in the UI).
url: http://localhost:9090
uid: promz2394
jsonData:
httpMethod: POST
manageAlerts: true
prometheusType: Prometheus
cacheLevel: 'High'
disableRecordingRules: false
incrementalQueryOverlapWindow: 10m
3 changes: 3 additions & 0 deletions quickstart/exampledata/config/prometheus/logprep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- targets:
- '127.0.0.1:8000'
labels: []
32 changes: 32 additions & 0 deletions quickstart/exampledata/config/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# my global config
global:
scrape_interval: 5s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
# scrape_timeout is set to the global default (10s).

# Alertmanager configuration
alerting:
alertmanagers:
- static_configs:
- targets:
# - alertmanager:9093

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
# - "first_rules.yml"
# - "second_rules.yml"

# 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"

# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.

static_configs:
- targets: ["localhost:9090"]
- job_name: "logprep"
static_configs:
- targets: ["localhost:8000"]

0 comments on commit 0b097f7

Please sign in to comment.