Skip to content

Commit

Permalink
Integrate with MaxMind out of the box
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwhitacre committed Dec 9, 2020
1 parent f885ece commit ab60a98
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ x-sentry-defaults: &sentry_defaults
SENTRY_EVENT_RETENTION_DAYS:
volumes:
- 'sentry-data:/data'
- 'sentry-geoip:/geoip'
- './sentry:/etc/sentry'
x-snuba-defaults: &snuba_defaults
<< : *restart_policy
Expand Down Expand Up @@ -126,6 +127,18 @@ services:
# If you have high volume and your search return incomplete results
# You might want to change this to a higher value (and ensure your host has enough memory)
MAX_MEMORY_USAGE_RATIO: 0.3
geoipupdate:
<< : *restart_policy
image: 'maxmindinc/geoipupdate:latest'
environment:
GEOIPUPDATE_FREQUENCY: 168 # one week, in hours
GEOIPUPDATE_EDITION_IDS: GeoLite2-City
# Set the following (e.g., via docker-compose.override.yml) to enable IP geolocation.
# See https://develop.sentry.dev/self-hosted/geolocation/.
GEOIPUPDATE_ACCOUNT_ID:
GEOIPUPDATE_LICENSE_KEY:
volumes:
- 'sentry-geoip:/usr/share/GeoIP'
snuba-api:
<< : *snuba_defaults
# Kafka consumer responsible for feeding events into Clickhouse
Expand Down Expand Up @@ -233,6 +246,7 @@ services:
read_only: true
source: ./relay
target: /work/.relay
- 'sentry-geoip:/geoip'
depends_on:
- kafka
- redis
Expand All @@ -251,6 +265,8 @@ volumes:
external: true
sentry-symbolicator:
external: true
sentry-geoip:
external: true
sentry-secrets:
sentry-smtp:
sentry-zookeeper-log:
Expand Down
4 changes: 2 additions & 2 deletions nginx/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ http {
# it could be "close" to close a keepalive connection
proxy_set_header Connection '';
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Request-Id $request_id;
proxy_read_timeout 30s;
Expand Down
1 change: 1 addition & 0 deletions relay/config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ processing:
- {name: "bootstrap.servers", value: "kafka:9092"}
- {name: "message.max.bytes", value: 50000000} #50MB or bust
redis: redis://redis:6379
geoip_path: "/geoip/GeoIP2-City.mmdb"
6 changes: 6 additions & 0 deletions sentry/sentry.conf.example.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,12 @@ def get_internal_network():
}
)

#######################
# MaxMind Integration #
######################

GEOIP_PATH_MMDB = '/geoip/GeoIP2-City.mmdb'

#########################
# Bitbucket Integration #
########################
Expand Down

0 comments on commit ab60a98

Please sign in to comment.