File tree Expand file tree Collapse file tree 3 files changed +49
-2
lines changed Expand file tree Collapse file tree 3 files changed +49
-2
lines changed Original file line number Diff line number Diff line change 1
1
# -- coding: UTF-8 --
2
2
import os
3
+ import socket
3
4
4
5
worker_class = "gevent"
5
6
workers = int (os .getenv ("WORKERS" , "4" ))
9
10
loglevel = os .environ .get ("LOG_LEVEL" , "info" )
10
11
errorlog = os .environ .get ("ERROR_LOG" , "-" )
11
12
accesslog = os .environ .get ("ACCESS_LOG" , "-" )
13
+
14
+
15
+ _statsd_host = os .getenv ("STATSD_HOST" )
16
+ _statsd_port = os .getenv ("STATSD_PORT" )
17
+ if _statsd_host and _statsd_port :
18
+ statsd_host = f"{ _statsd_host } :{ _statsd_port } "
19
+ statsd_prefix = socket .gethostname ()
Original file line number Diff line number Diff line change @@ -7,30 +7,38 @@ services:
7
7
- POSTGRES_DB=sentry
8
8
- POSTGRES_USER=sentry
9
9
- POSTGRES_PASSWORD=sentry
10
+ profiles :
11
+ - data
10
12
ports :
11
13
- 5432:5432
12
14
volumes :
13
15
- " controllerdata:/var/lib/postgresql/data"
14
16
15
17
redis :
16
18
image : ' bitnami/redis:latest'
19
+ profiles :
20
+ - data
17
21
environment :
18
22
- ALLOW_EMPTY_PASSWORD=yes
19
23
ports :
20
24
- 6379:6379
21
25
22
26
static :
23
- image : spklabs/sentry-dynamic-sampling-controller-static:latest
27
+ image : spklabs/sentry-dynamic-sampling-controller-static:alpha
24
28
ports :
25
29
- 8081:80
30
+ profiles :
31
+ - app
26
32
app :
27
- image : spklabs/sentry-dynamic-sampling-controller:latest
33
+ image : spklabs/sentry-dynamic-sampling-controller:alpha
28
34
depends_on :
29
35
- postgres
30
36
- redis
31
37
- static
32
38
ports :
33
39
- 8080:8000
40
+ profiles :
41
+ - app
34
42
environment :
35
43
- ENV=debug
36
44
- SECRET_KEY="very_secret"
@@ -57,5 +65,17 @@ services:
57
65
- OIDC_RP_SIGN_ALGO=RS256
58
66
- STATIC_URL=http://localhost:8081/static
59
67
68
+ statsd-exporter :
69
+ image : prom/statsd-exporter:v0.23.0
70
+ ports :
71
+ - " 9125:9125/udp"
72
+ - " 9102:9102"
73
+ profiles :
74
+ - metrics
75
+ volumes :
76
+ - ./etc/statsd.conf:/statsd/statsd.conf
77
+ command :
78
+ - --statsd.mapping-config=/statsd/statsd.conf
79
+
60
80
volumes :
61
81
controllerdata :
Original file line number Diff line number Diff line change
1
+ mappings:
2
+ - match: "*.gunicorn.request.status.*"
3
+ help: "gunicorn response code"
4
+ name: "gunicorn_response_code"
5
+ labels:
6
+ app: "$1"
7
+ status: "$2"
8
+ - match: "*.gunicorn.workers"
9
+ name: "gunicorn_workers"
10
+ labels:
11
+ app: "$1"
12
+ - match: "*.gunicorn.requests"
13
+ name: "gunicorn_requests"
14
+ labels:
15
+ app: "$1"
16
+ - match: "*.gunicorn.request.duration"
17
+ name: "gunicorn_request_duration"
18
+ labels:
19
+ app: "$1"
You can’t perform that action at this time.
0 commit comments