Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(infra): loki reconfiguration by seperating ports for each server #8

Merged
merged 6 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions grafana/Caddyfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
grafana.codedang.com {
handle /loki/* {
uri strip_prefix /loki
reverse_proxy 127.0.0.1:3200
handle /lokiaws/* {
uri strip_prefix /lokiaws
reverse_proxy 127.0.0.1:3100
}

handle /lokitest/* {
uri strip_prefix /lokitest
reverse_proxy 127.0.0.1:3199
}

handle {
Expand Down
18 changes: 15 additions & 3 deletions grafana/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
image: grafana/loki:2.9.0
container_name: loki-test
ports:
- "3100:3100"
- "3199:3100"
volumes:
- '$PWD/loki-config-test.yml:/etc/loki/loki-config.yml'
command: -config.file=/etc/loki/loki-config.yml
Expand All @@ -19,12 +19,24 @@ services:
image: grafana/loki:2.9.0
container_name: loki-stage
ports:
- "3200:3100"
- "3101:3100"
volumes:
- '$PWD/loki-config-stage.yml:/etc/loki/loki-config.yml'
command: -config.file=/etc/loki/loki-config.yml
networks:
- loki
- loki

loki-aws:
image: grafana/loki:2.9.0
container_name: loki-aws
ports:
- "3100:3100"
volumes:
- '$PWD/loki-config-aws.yml:/etc/loki/loki-config.yml'
command: -config.file=/etc/loki/loki-config.yml
networks:
- loki


grafana:
image: grafana/grafana:latest
Expand Down
50 changes: 50 additions & 0 deletions grafana/loki-config-aws.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
auth_enabled: false

server:
http_listen_port: 3100
grpc_listen_port: 9096

common:
instance_addr: 127.0.0.1
path_prefix: /tmp/loki
storage:
filesystem:
chunks_directory: /tmp/loki/chunks
rules_directory: /tmp/loki/rules
replication_factor: 1
ring:
kvstore:
store: inmemory

query_range:
results_cache:
cache:
embedded_cache:
enabled: true
max_size_mb: 100

schema_config:
configs:
- from: 2020-10-24
store: boltdb-shipper
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h

ruler:
alertmanager_url: http://localhost:9093

# By default, Loki will send anonymous, but uniquely-identifiable usage and configuration
# analytics to Grafana Labs. These statistics are sent to https://stats.grafana.org/
#
# Statistics help us better understand how Loki is used, and they show us performance
# levels for most users. This helps us prioritize features and documentation.
# For more information on what's sent, look at
# https://github.com/grafana/loki/blob/main/pkg/usagestats/stats.go
# Refer to the buildReport method to see what goes into a report.
#
# If you would like to disable reporting, uncomment the following lines:
#analytics:
# reporting_enabled: false