##// END OF EJS Templates
stack: updated loki/grafana stacks...
super-admin -
Show More
@@ -0,0 +1,50 b''
1 auth_enabled: false
2
3 server:
4 http_listen_address: 0.0.0.0
5 grpc_listen_address: 0.0.0.0
6 http_listen_port: 3100
7 grpc_listen_port: 9095
8 log_level: info
9
10 common:
11 path_prefix: /tmp/loki
12 storage:
13 filesystem:
14 chunks_directory: /tmp/loki/chunks
15 rules_directory: /tmp/loki/rules
16 replication_factor: 1
17 ring:
18 instance_addr: 127.0.0.1
19 kvstore:
20 store: inmemory
21
22 schema_config:
23 configs:
24 - from: 2020-10-24
25 store: boltdb-shipper
26 object_store: filesystem
27 schema: v11
28 index:
29 prefix: index_
30 period: 24h
31
32 limits_config:
33 max_streams_per_user: 100000
34
35 ingestion_burst_size_mb: 64
36 ingestion_rate_mb: 512
37
38 per_stream_rate_limit: 512M
39 per_stream_rate_limit_burst: 1024M
40 max_entries_limit_per_query: 1000000
41 max_label_value_length: 20480
42 max_label_name_length: 10240
43
44 ruler:
45 alertmanager_url: http://localhost:9093
46
47 # If you would like to disable reporting, uncomment the following lines:
48 #analytics:
49 # reporting_enabled: false
50
@@ -0,0 +1,38 b''
1 server:
2 http_listen_port: 9080
3 grpc_listen_port: 0
4
5 # Describes how to save read file offsets to disk
6 positions:
7 filename: /tmp/positions.yaml
8
9 clients:
10 - url: http://loki:3100/loki/api/v1/push
11 tenant_id: docker
12
13 ## Definition to what to scrape
14 scrape_configs:
15
16 - job_name: scraping_nginx
17 static_configs:
18 - targets:
19 - localhost
20 labels:
21 __path__: /var/log_volume/nginx/rhodecode*
22 job: nginx
23
24 - job_name: scraping_vcsserver
25 static_configs:
26 - targets:
27 - localhost
28 labels:
29 __path__: /var/log_volume/apps/rhodecode*
30 job: rhodecode
31
32 - job_name: scraping_rhodecode
33 static_configs:
34 - targets:
35 - localhost
36 labels:
37 __path__: /var/log_volume/apps/vcsserver*
38 job: vcsserver No newline at end of file
@@ -0,0 +1,31 b''
1 defaults:
2 # metrics expiration
3 ttl: 48h
4
5 mappings:
6
7 - match: "*.histogram"
8 name: "${1}"
9 observer_type: histogram
10 histogram_options:
11 buckets: [.1, .25, .5, .75, 1, 1.5, 2, 5, 10]
12
13 - match: "*.slow_histogram"
14 name: "${1}"
15 observer_type: histogram
16 histogram_options:
17 buckets: [.1, .25, .5, 1, 2, 5, 10, 30, 60]
18
19 - match: "*.summary"
20 name: "${1}"
21 observer_type: summary
22 summary_options:
23 quantiles:
24 - quantile: 0.99
25 error: 0.001
26 - quantile: 0.95
27 error: 0.01
28 - quantile: 0.9
29 error: 0.05
30 - quantile: 0.5
31 error: 0.005
1 NO CONTENT: new file 100644
@@ -1,10 +1,17 b''
1 1 global:
2 scrape_interval: 10s
3 evaluation_interval: 10s
2 scrape_interval: 15s
3 evaluation_interval: 15s
4 4
5 5 scrape_configs:
6 # Scrape statsd exporter
6
7 # Scrape statsd exporter from RhodeCode
7 8 - job_name: "rhodecode_metrics"
8 9 metrics_path: "/metrics"
9 10 static_configs:
10 11 - targets: ["statsd-exporter:9102"]
12
13 # scrape node exporter
14 - job_name: node_metrics
15 metrics_path: "/metrics"
16 static_configs:
17 - targets: ["node-exporter:9100"]
@@ -8,6 +8,8 b' USER_GID=${USER_GID:-$CURRENT_USER_GID}'
8 8 CMD="docker-compose -f docker-compose.yml"
9 9 BUILD_CMD="docker-compose -f docker-compose.yaml -f docker-compose.source.yaml"
10 10 DEV_CMD="docker-compose -f docker-compose.yaml -f docker-compose.source.yaml -f docker-compose.dev.yaml"
11 DEV_CMD="docker-compose -f docker-compose.yaml -f docker-compose.source.yaml -f docker-compose.dev.yaml"
12 METRICS_CMD="docker-compose -f docker-compose-grafana.yaml"
11 13
12 14 usage="$(basename "$0") ./dev.sh <COMMAND> -- run docker command
13 15 where <COMMAND>:
@@ -21,19 +23,20 b' where <COMMAND>:'
21 23 dev-env -- run the dev stack required for development
22 24 redis -- run the redis CLI attached to rc_cluster_redis_1
23 25 db -- run the db bash attached to rc_cluster_database_1
26 [m]etrics -- run the metrics stack
24 27 run <cmd> -- run <cmd>"
25 28
26 29 case ${1:-} in
27 30 v|vcs )
28 eval "(docker stop vcsserver-dev || echo skip-stop ) && ${DEV_CMD} run --service-ports --rm --use-aliases --workdir="/home/rhodecode/rhodecode-vcsserver" --name="vcsserver-dev" vcsserver bash"
31 eval "(docker stop dev-vcsserver || echo skip-stop ) && ${DEV_CMD} run --service-ports --rm --use-aliases --workdir="/home/rhodecode/rhodecode-vcsserver" --name="dev-vcsserver" vcsserver bash"
29 32 exit
30 33 ;;
31 34 r|rc )
32 eval "(docker stop enterprise-ee-dev || echo skip-stop ) && ${DEV_CMD} run --publish 8080:8080 --rm --use-aliases --workdir="/home/rhodecode/rhodecode-enterprise-ee" --name="enterprise-ee-dev" rhodecode bash"
35 eval "(docker stop dev-enterprise-ee || echo skip-stop ) && ${DEV_CMD} run --publish 8080:8080 --rm --use-aliases --workdir="/home/rhodecode/rhodecode-enterprise-ee" --name="dev-enterprise-ee" rhodecode bash"
33 36 exit
34 37 ;;
35 38 ce )
36 eval "(docker stop enterprise-ce-dev || echo skip-stop ) && ${DEV_CMD} run --publish 8081:8080 --rm --use-aliases --workdir="/home/rhodecode/rhodecode-enterprise-ce" --name="enterprise-ce-dev" rhodecode bash"
39 eval "(docker stop dev-enterprise-ce || echo skip-stop ) && ${DEV_CMD} run --publish 8081:8080 --rm --use-aliases --workdir="/home/rhodecode/rhodecode-enterprise-ce" --name="dev-enterprise-ce" rhodecode bash"
37 40 exit
38 41 ;;
39 42 t|test|tests )
@@ -56,6 +59,10 b' case ${1:-} in'
56 59 eval "docker exec --interactive --tty rc_cluster_database_1 /bin/bash -c 'psql -U $$POSTGRES_USER' "
57 60 exit
58 61 ;;
62 m|metrics )
63 eval "${METRICS_CMD} up --detach"
64 exit
65 ;;
59 66 run )
60 67 command=${@:2}
61 68 eval "${DEV_CMD} run --rm rhodecode ${command}"
@@ -3,6 +3,12 b" version: '3.9'"
3 3 volumes:
4 4 prometheus_data: {}
5 5 grafana_data: {}
6 logvolume:
7 driver: local
8 driver_opts:
9 type: none
10 o: bind
11 device: $PWD/logs
6 12
7 13 networks:
8 14 rhodecode_network:
@@ -15,17 +21,37 b' services:'
15 21 image: prom/statsd-exporter:v0.22.8
16 22 restart: unless-stopped
17 23 command: [
18 '--statsd.mapping-config=/statsd/statsd.conf',
24 '--statsd.mapping-config=/statsd/statsd.yaml',
19 25 '--statsd.listen-udp=:9125',
20 26 '--web.listen-address=:9102'
21 27 ]
22 28 networks:
23 29 - rhodecode_network
24 30 ports:
25 - "9125:9125/udp"
26 - "9102:9102"
31 - "127.0.0.1:9125:9125/udp"
32 - "127.0.0.1:9102:9102"
27 33 volumes:
28 - ./config/statsd-exporter/statsd.conf:/statsd/statsd.conf
34 - ./config/statsd-exporter:/statsd
35
36 node-exporter:
37 image: prom/node-exporter:v1.4.0
38 command:
39 - "--path.procfs=/host/proc"
40 - "--path.rootfs=/rootfs"
41 - "--path.sysfs=/host/sys"
42 - "--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)"
43 - "--collector.systemd"
44 - "--collector.processes"
45 networks:
46 - rhodecode_network
47 pid: host
48 restart: unless-stopped
49 ports:
50 - "127.0.0.1:9100:9100"
51 volumes:
52 - "/proc:/host/proc:ro"
53 - "/sys:/host/sys:ro"
54 - "/:/rootfs:ro"
29 55
30 56 prometheus:
31 57 image: prom/prometheus:v2.39.1
@@ -38,7 +64,7 b' services:'
38 64 - "--storage.tsdb.retention.time=24h"
39 65 - "--web.enable-lifecycle"
40 66 ports:
41 - "9090:9090"
67 - "127.0.0.1:9090:9090"
42 68 networks:
43 69 - rhodecode_network
44 70 volumes:
@@ -46,13 +72,39 b' services:'
46 72 - prometheus_data:/prometheus
47 73
48 74 grafana:
49 image: grafana/grafana:9.1.8-ubuntu
75 image: grafana/grafana:9.2.1-ubuntu
50 76 restart: unless-stopped
51 77 env_file:
52 78 - ./config/grafana/grafana.env
53 79 ports:
54 - "3000:3000"
80 - "4000:3000"
55 81 volumes:
56 82 - grafana_data:/var/lib/grafana
57 83 networks:
58 84 - rhodecode_network
85
86 loki:
87 image: grafana/loki:2.6.1
88 restart: unless-stopped
89 ports:
90 - "127.0.0.1:3100:3100"
91 - "127.0.0.1:9095:9095"
92 command: [
93 "-config.file=/etc/loki/loki-config.yaml"
94 ]
95 networks:
96 - rhodecode_network
97 volumes:
98 - ./config/loki:/etc/loki
99
100 promtail:
101 image: grafana/promtail:latest
102 command: [
103 "-config.file=/etc/promtail/promtail-config.yaml"
104 ]
105 networks:
106 - rhodecode_network
107 volumes:
108 - /var/log:/var/log
109 - logvolume:/var/log_volume
110 - ./config/loki:/etc/promtail
@@ -430,27 +430,27 b" listen_addresses = '*'"
430 430
431 431 # - Where to Log -
432 432
433 #log_destination = 'stderr' # Valid values are combinations of
433 log_destination = 'stderr' # Valid values are combinations of
434 434 # stderr, csvlog, syslog, and eventlog,
435 435 # depending on platform. csvlog
436 436 # requires logging_collector to be on.
437 437
438 438 # This is used when logging to stderr:
439 #logging_collector = off # Enable capturing of stderr and csvlog
439 logging_collector = on # Enable capturing of stderr and csvlog
440 440 # into log files. Required to be on for
441 441 # csvlogs.
442 442 # (change requires restart)
443 443
444 444 # These are only used if logging_collector is on:
445 #log_directory = 'log' # directory where log files are written,
445 log_directory = '/var/log/rhodecode/postgres' # directory where log files are written,
446 446 # can be absolute or relative to PGDATA
447 #log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
447 log_filename = 'postgresql-%Y-%m-%d_%H%M%S.log' # log file name pattern,
448 448 # can include strftime() escapes
449 449 #log_file_mode = 0600 # creation mode for log files,
450 450 # begin with 0 to use octal notation
451 451 #log_rotation_age = 1d # Automatic rotation of logfiles will
452 452 # happen after that time. 0 disables.
453 #log_rotation_size = 10MB # Automatic rotation of logfiles will
453 log_rotation_size = 512MB # Automatic rotation of logfiles will
454 454 # happen after that much log output.
455 455 # 0 disables.
456 456 #log_truncate_on_rotation = off # If on, an existing log file with the
@@ -502,7 +502,7 b" listen_addresses = '*'"
502 502 # fatal
503 503 # panic (effectively off)
504 504
505 #log_min_duration_statement = -1 # -1 is disabled, 0 logs all statements
505 log_min_duration_statement = 1000 # -1 is disabled, 0 logs all statements
506 506 # and their durations, > 0 logs only
507 507 # statements running at least this number
508 508 # of milliseconds
@@ -35,12 +35,29 b' limit_req_zone $binary_remote_addr zone=http_req_limit:10m rate=1r/s;'
35 35 ## custom log format
36 36 log_format http_log_custom '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $upstream_response_time $pipe';
37 37
38 log_format json_log_custom escape=json
39 '{'
40 '"source":"nginx",'
41 '"remote_user":"$remote_user",'
42 '"time_local":"$time_local",'
43 '"remote_addr":"$remote_addr",'
44 '"request":"$request",'
45 '"status": "$status",'
46 '"request_method": "$request_method",'
47 '"body_bytes_sent":"$body_bytes_sent",'
48 '"request_time":"$request_time",'
49 '"upstream_response_time":"$upstream_response_time",'
50 '"http_referrer":"$http_referer",'
51 '"http_user_agent":"$http_user_agent"'
52 '}';
53
54
38 55 server {
39 56 listen 80 default;
40 57 # ensure we get the proper Docker DNS resolver for load balancing.
41 58 resolver 127.0.0.11 ipv6=off;
42 59 server_name localhost 127.0.0.1;
43 access_log /var/log/rhodecode/nginx/rhodecode.http.access.log http_log_custom;
60 access_log /var/log/rhodecode/nginx/rhodecode.http.access.log json_log_custom;
44 61 error_log /var/log/rhodecode/nginx/rhodecode.http.error.log;
45 62
46 63 # uncomment to redirect http traffic to https
@@ -1,5 +1,5 b''
1 FROM ubuntu:latest
2 # Using 20.04 LTS Release
1 FROM ubuntu:22.04
2 # Using 22.04 LTS Release
3 3 MAINTAINER RhodeCode Inc. <support@rhodecode.com>
4 4
5 5 ARG TZ="UTC"
@@ -1,14 +1,16 b''
1 FROM debian:buster
1 FROM ubuntu:22.04
2 # Using 22.04 LTS Release
2 3 MAINTAINER RhodeCode Inc. <support@rhodecode.com>
3 4
5
4 6 ENV \
5 7 RC_USER=rhodecode \
6 8 MOD_DAV_SVN_CONF_FILE=/etc/rhodecode/conf/svn/mod_dav_svn.conf
7 9
8 10 RUN \
9 11 echo "** install base svn packages **" && \
10 apk update && \
11 apk add --no-cache \
12 apt-get update && \
13 apt-get install --no-cache \
12 14 tini \
13 15 bash \
14 16 curl \
@@ -29,7 +31,7 b' echo "** Create system user $RC_USER **" && \\'
29 31
30 32 RUN \
31 33 echo "**** cleanup ****" && \
32 apk del tzdata python2 && \
34 apt-get purge tzdata python2 && \
33 35 rm -f /tmp/* && \
34 36 rm -rf /var/lib/apt/lists/* \
35 37 rm -rf /var/cache/apk/*
General Comments 0
You need to be logged in to leave comments. Login now