diff --git a/packer/files/generate-dashboards.sh b/packer/files/generate-dashboards.sh deleted file mode 100755 index bfe750372..000000000 --- a/packer/files/generate-dashboards.sh +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env bash - -. versions.sh -VERSIONS=$DEFAULT_VERSION -FORMAT_COMAND="" -usage="$(basename "$0") [-h] [-v comma separated versions ] [-j additional dashboard to load to Grafana, multiple params are supported] [-M scylla-manager version ] [-t] -- Generates the grafana dashboards and their load files" - -while getopts ':htv:j:M:' option; do - case "$option" in - h) echo "$usage" - exit - ;; - t) TEST_ONLY=1 - ;; - v) VERSIONS=$OPTARG - FORMAT_COMAND="$FORMAT_COMAND -v $OPTARG" - ;; - M) MANAGER_VERSION=$OPTARG - FORMAT_COMAND="$FORMAT_COMAND -M $OPTARG" - ;; - j) GRAFANA_DASHBOARD_ARRAY+=("$OPTARG") - FORMAT_COMAND="$FORMAT_COMAND -j $OPTARG" - ;; - esac -done -if [[ -z "$TEST_ONLY" ]]; then - mkdir -p grafana/build -fi - -mkdir -p grafana/provisioning/dashboards -rm -f grafana/provisioning/dashboards/load.*.yaml - -function set_loader { - sed "s/NAME/$1/" grafana/load.yaml | sed "s/FOLDER/$2/" | sed "s/VERSION/$3/" > "grafana/provisioning/dashboards/load.$1.yaml" -} - -IFS=',' ;for v in $VERSIONS; do -VERDIR="grafana/build/ver_$v" -if [[ -z "$TEST_ONLY" ]]; then - mkdir -p $VERDIR -fi -set_loader $v $v "ver_$v" -for f in clusters-overview scylla-dash scylla-dash-per-server scylla-dash-io-per-server scylla-dash-cpu-per-server scylla-dash-per-machine scylla-cql-optimization; do - if [ -e grafana/$f.$v.template.json ] - then - if [ ! -f "$VERDIR/$f.$v.json" ] || [ "$VERDIR/$f.$v.json" -ot "grafana/$f.$v.template.json" ]; then - if [[ -z "$TEST_ONLY" ]]; then - echo "updating dashboard grafana/$f.$v.template.json" - ./make_dashboards.py -af $VERDIR -t grafana/types.json -d grafana/$f.$v.template.json - else - echo "notice: grafana/$f.$v.template.json was updated, run ./generate-dashboards.sh $FORMAT_COMAND" - fi - fi - else - if [ -f grafana/$f.$v.json ] - then - cp grafana/$f.$v.json $VERDIR - fi - fi -done -done - -if [ -e grafana/scylla-manager.$MANAGER_VERSION.template.json ] -then - VERDIR="grafana/build/manager_$MANAGER_VERSION" - mkdir -p $VERDIR - set_loader "manager_$MANAGER_VERSION" "manager_$MANAGER_VERSION" "manager_$MANAGER_VERSION" - if [ ! -f "$VERDIR/scylla-manager.$MANAGER_VERSION.json" ] || [ "$VERDIR/scylla-manager.$MANAGER_VERSION.json" -ot "grafana/scylla-manager.$MANAGER_VERSION.template.json" ] || [ "$VERDIR/scylla-manager.$MANAGER_VERSION.json" -ot "grafana/types.json" ]; then - if [[ -z "$TEST_ONLY" ]]; then - echo "updating grafana/scylla-manager.$MANAGER_VERSION.template.json" - ./make_dashboards.py -af $VERDIR -t grafana/types.json -d grafana/scylla-manager.$MANAGER_VERSION.template.json - else - echo "notice: grafana/scylla-manager.$MANAGER_VERSION.template.json was updated, run ./generate-dashboards.sh $FORMAT_COMAND" - fi - fi -fi - -for val in "${GRAFANA_DASHBOARD_ARRAY[@]}"; do - VERDIR="grafana/build/default" - set_loader "default" "" "default" - mkdir -p $VERDIR - if [[ $val == *".template.json" ]]; then - val1=${val::-14} - val1=${val1:8} - if [ ! -f $VERDIR/$val1.json ] || [ $VERDIR/$val1.json -ot $val ]; then - if [[ -z "$TEST_ONLY" ]]; then - echo "updating $val" - ./make_dashboards.py -af $VERDIR -t grafana/types.json -d $val - else - echo "notice: $val was updated, run ./generate-dashboards.sh $FORMAT_COMAND" - fi - fi - else - cp $val $VERDIR - fi -done - diff --git a/packer/files/node-exporter.service b/packer/files/node-exporter.service index 55451042c..bc808858f 100644 --- a/packer/files/node-exporter.service +++ b/packer/files/node-exporter.service @@ -2,7 +2,7 @@ Description=Node Exporter [Service] -ExecStart=/usr/bin/node_exporter --collector.interrupts +ExecStart=/usr/bin/node_exporter [Install] WantedBy=multi-user.target diff --git a/packer/files/prometheus.yml.template b/packer/files/prometheus.yml.template deleted file mode 100644 index 9e1da953a..000000000 --- a/packer/files/prometheus.yml.template +++ /dev/null @@ -1,171 +0,0 @@ -global: - scrape_interval: 20s # By default, scrape targets every 20 second. - scrape_timeout: 15s # Timeout before trying to scape a target again - evaluation_interval: 20s - - # Attach these labels to any time series or alerts when communicating with - # external systems (federation, remote storage, Alertmanager). - external_labels: - monitor: 'scylla-monitor' -rule_files: - - /etc/prometheus/prometheus.rules.yml - - /etc/prometheus/prom_rules/*.yml - - /etc/prometheus/prom_rules/*.yaml - # -# Alerting specifies settings related to the Alertmanager. -alerting: - # alert_relabel_configs: - # [ - ... ] - alertmanagers: - - static_configs: - - targets: - - AM_ADDRESS - -scrape_configs: -- job_name: scylla - honor_labels: false - file_sd_configs: - - files: - - /etc/scylla.d/prometheus/scylla_servers.yml - relabel_configs: - - source_labels: [__address__] - regex: '([^:]+)' - target_label: __address__ - replacement: '${1}:9180' - - - source_labels: [__address__] - regex: '(.*):.+' - target_label: instance - replacement: '${1}' - metric_relabel_configs: - - source_labels: [version] - regex: '(.+)' - target_label: CPU - replacement: 'cpu' - - source_labels: [version] - regex: '(.+)' - target_label: CQL - replacement: 'cql' - - source_labels: [version] - regex: '(.+)' - target_label: OS - replacement: 'os' - - source_labels: [version] - regex: '(.+)' - target_label: IO - replacement: 'io' - - source_labels: [version] - regex: '(.+)' - target_label: Errors - replacement: 'errors' - - regex: 'help|exported_instance' - action: labeldrop - - source_labels: [version] - regex: '([0-9]+\.[0-9]+)(\.?[0-9]*).*' - replacement: '$1$2' - target_label: svr - - source_labels: [__name__] - regex: '(scylla_cql.*|scylla_storage_proxy_coordinator_.*|scylla_database_total_.*|scylla_transport_.*)' - replacement: '1' - target_label: level - - source_labels: [__name__] - regex: '(scylla_node_operation_mode|scylla_cache_bytes_used|scylla_cache_row_.*|scylla_cdc_operations_total|scylla_commitlog_pending_allocations|scylla_commitlog_requests_blocked_memory|scylla_compaction_manager_compactions|scylla_database_active_reads|scylla_database_dropped_view_updates|scylla_database_queued_reads|scylla_database_requests_blocked_memory|scylla_database_requests_blocked_memory_current|scylla_database_view_update_backlog|scylla_hints_for_views_manager_sent|scylla_hints_manager_sent|scylla_hints_manager_written|scylla_lsa_non_lsa_used_space_bytes|scylla_lsa_total_space_bytes|scylla_query_processor_queries|scylla_reactor_utilization|scylla_scheduler_runtime_ms|scylla_scheduler_shares|scylla_sstables_cell_tombstone_writes|scylla_sstables_range_tombstone_reads|scylla_sstables_range_tombstone_writes|scylla_sstables_row_tombstone_reads|scylla_sstables_tombstone_writes)' - replacement: '1' - target_label: level - - source_labels: [le] - regex: '(.+)' - replacement: '' - target_label: level - - source_labels: [scheduling_group_name] - regex: '(atexit|gossip|mem_compaction|memtable|streaming|background_reclaim|compaction|main|memtable_to_cache)' - replacement: '' - target_label: level - - source_labels: [ __name__ ] - regex: '(scylla_storage_proxy_coordinator_cas.*)' - action: drop - - source_labels: [ __name__ ,scheduling_group_name] - regex: '(scylla_storage_proxy_coordinator_read_latency_bucket;(atexit|gossip|mem_compaction|memtable|streaming|background_reclaim|compaction|main|memtable_to_cache))' - action: drop - - source_labels: [ __name__ ,scheduling_group_name] - regex: '(scylla_storage_proxy_coordinator_write_latency_bucket;(atexit|gossip|mem_compaction|memtable|streaming|background_reclaim|compaction|main|memtable_to_cache))' - action: drop - -- job_name: node_exporter - honor_labels: false - scrape_interval: 1m # By default, scrape targets every 20 second. - scrape_timeout: 20s # Timeout before trying to scape a target again - file_sd_configs: - - files: - - /etc/scylla.d/prometheus/node_exporter_servers.yml - relabel_configs: - - source_labels: [__address__] - regex: '(.*):\d+' - target_label: instance - replacement: '${1}' - - source_labels: [__address__] - regex: '([^:]+)' - target_label: instance - replacement: '${1}' - - source_labels: [instance] - regex: '(.*)' - target_label: __address__ - replacement: '${1}:9100' - metric_relabel_configs: - - source_labels: [__name__] - regex: '(node_filesystem_size_bytes|node_filesystem_avail_bytes)' - replacement: '1' - target_label: level - -- job_name: manager_agent - honor_labels: false - file_sd_configs: - - files: - - /etc/scylla.d/prometheus/scylla_servers.yml - relabel_configs: - - source_labels: [__address__] - regex: '(.*):\d+' - target_label: instance - replacement: '${1}' - - source_labels: [__address__] - regex: '([^:]+)' - target_label: instance - replacement: '${1}' - - source_labels: [instance] - regex: '(.*)' - target_label: __address__ - replacement: '${1}:56090' - -- job_name: manager_agent1 - honor_labels: false - file_sd_configs: - - files: - - /etc/scylla.d/prometheus/scylla_servers.yml - relabel_configs: - - source_labels: [__address__] - regex: '(.*):\d+' - target_label: instance - replacement: '${1}' - - source_labels: [__address__] - regex: '([^:]+)' - target_label: instance - replacement: '${1}' - - source_labels: [instance] - regex: '(.*)' - target_label: __address__ - replacement: '${1}:5090' - -- job_name: scylla_manager - honor_labels: false - file_sd_configs: - - files: - - /etc/scylla.d/prometheus/scylla_manager_servers.yml - metric_relabel_configs: - - source_labels: [host] - target_label: instance - -- job_name: 'prometheus' - # Override the global default and scrape targets from this job every 5 seconds. - scrape_interval: 5s - static_configs: - - targets: - - localhost:9090 diff --git a/packer/files/versions.sh b/packer/files/versions.sh deleted file mode 100644 index ae601e095..000000000 --- a/packer/files/versions.sh +++ /dev/null @@ -1,2 +0,0 @@ -DEFAULT_VERSION="dbaas" -MANAGER_VERSION="dbaas"