Skip to content

Commit

Permalink
Merge pull request #2346 from amnonh/rate_interval
Browse files Browse the repository at this point in the history
Rate interval
  • Loading branch information
amnonh authored Jul 7, 2024
2 parents 21ad701 + 277eb35 commit 24d6f13
Show file tree
Hide file tree
Showing 18 changed files with 309 additions and 255 deletions.
17 changes: 11 additions & 6 deletions docs/source/install/monitor-without-docker.rst
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ For example the scrape config for Scylla:
.. code-block:: shell
global:
scrape_interval: 5s # By default, scrape targets every 5 second.
scrape_timeout: 4s # Timeout before trying to scape a target again
scrape_interval: 20s # By default, scrape targets every 20s second.
scrape_timeout: 15s # Timeout before trying to scape a target again
# Attach these labels to any time series or alerts when communicating with
# external systems (federation, remote storage, Alertmanager).
Expand Down Expand Up @@ -308,6 +308,9 @@ For example the scrape config for Scylla:
target_label: by
replacement: 'instance,shard'
.. note::
You can change scrape_interval to a longer interval to save resources. If you do that, you must change the Grafan configuration to match it.

5. Create and set ``scylla_servers.yml`` file point to your Scylla nodes and ``scylla_manager_server.yml`` file to point to your Scylla Manager.

.. note::
Expand Down Expand Up @@ -490,6 +493,8 @@ For example
url: http://192.168.135.167:9090
access: proxy
basicAuth: false
jsonData:
timeInterval: '20s' # Must match prometheus gloabal scrape_interval
- name: alertmanager
type: camptocamp-prometheus-alertmanager-datasource
Expand All @@ -503,10 +508,10 @@ For example
basicAuth:
isDefault:
jsonData:
severity_critical: '4'
severity_high: '3'
severity_warning: '2'
severity_info: '1'
implementation: 'prometheus'
.. note::
The timeInterval parameter must match Prometheus scrape_interval config.

6. Start the Grafana service

Expand Down
12 changes: 7 additions & 5 deletions docs/source/install/start-all.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@ You cannot use port mapping when using the ``-l`` flag

**--compose** This is an experimental option. When set, it initiates a two-stage process. Firstly, a ``docker-compose.yml`` file is created along with an ``.env`` file. Following this, the script executes ``docker-compose up``. Please note that having docker-compose is a prerequisite.

**--scrap scrap-interval** Allows changing Prometheus scrap interval.

Grafana Related Commands
------------------------

**-G path/to/grafana data-dir** Use an external directory for the Grafana database.
This flag places the Grafana data directory outside of its container and, by doing that, makes it persistent.
This is only important if you are creating your own dashboards using the Grafana GUI and wish to keep them.
**-G path/to/grafana data-dir** Use an external directory for the Grafana database.
This flag places the Grafana data directory outside of its container and, by doing that, makes it persistent.
This is only important if you are creating your own dashboards using the Grafana GUI and wish to keep them.
If not used, each run of the containers will clear all of Grafana's information.

**-v comma-separated versions** Each Scylla version comes with its own set of dashboards. By default, Grafana starts with the two latest versions. The ``-v`` flag allows specifying a specific version or versions.
Expand Down Expand Up @@ -63,7 +65,7 @@ Prometheus Related Commands
**-d path/to/data-dir** Use an external directory for the Prometheus data directory.
This flag places the Prometheus data directory outside of its container and by doing that makes it persistent.

.. note:: Specifying an external directory is important for systems in production. Without it,
.. note:: Specifying an external directory is important for systems in production. Without it,
every restart of the monitoring stack will result in metrics lost.

**-p prometheus-port** Override the default Prometheus port, this is done using port mapping, note that port mapping does not work when using the host network.
Expand Down Expand Up @@ -95,7 +97,7 @@ Prometheus storage configuration is covered here_.

For example to set the retention time to 30 days add ``-b "--storage.tsdb.retention.time=30d"`` to the ``start-all.sh`` command

Alert Manager
Alert Manager
-------------

The Alertmanager handles the alerts and takes the following parameters:
Expand Down
6 changes: 6 additions & 0 deletions grafana-datasource.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ else
;;
s) BASE_DIR="grafana/stack/$OPTARG/provisioning/datasources"
;;
S) SCRAP_INTERVAL="$OPTARG"
;;
:) printf "missing argument for -%s\n" "$OPTARG" >&2
echo "$usage" >&2
exit 1
Expand All @@ -49,3 +51,7 @@ if [ -z "$SCYLLA_USER" ] || [ -z "$SCYLLA_PSSWD" ]; then
else
sed "s/SCYLLA_USER/$SCYLLA_USER/" grafana/datasource.psswd.scylla.yml |sed "s/SCYLLA_PSSWD/$SCYLLA_PSSWD/">$BASE_DIR/datasource.scylla.yml
fi

if [[ "$SCRAP_INTERVAL" != "" ]]; then
sed -i "s/ timeInterval: *'[[:digit:]]*.*/ timeInterval: '${SCRAP_INTERVAL}s'/g" $BASE_DIR/datasource.yaml
fi
Loading

0 comments on commit 24d6f13

Please sign in to comment.