Skip to content

Commit

Permalink
feat: Redirect grafana via the gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
whiterabbit1983 committed Oct 11, 2024
1 parent beb246a commit e9ba9d8
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
1 change: 1 addition & 0 deletions gateway/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ services:
- GATEWAY_PORT=80
- JWT_SHARED_KEY=${JWT_SHARED_KEY}
- AGENTS_API_URL=${AGENTS_API_URL:-http://agents-api-multi-tenant:8080}
- MONITOR_URL=${MONITOR_URL:-http://grafana:3000}
- AGENTS_API_KEY=${AGENTS_API_KEY}
- AGENTS_API_KEY_HEADER_NAME=${AGENTS_API_KEY_HEADER_NAME:-Authorization}
- TRAEFIK_LOG_LEVEL=${TRAEFIK_LOG_LEVEL:-INFO}
Expand Down
17 changes: 16 additions & 1 deletion gateway/traefik.yml.template
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ http:
service: service-agents-api
priority: 1

agents-monitor:
entryPoints:
- web
rule: Path(`/monitor{path:.*}`)
middlewares:
- corsHeaders
service: service-monitor
priority: 1

agents-api-docs:
entryPoints:
- web
Expand Down Expand Up @@ -99,7 +108,13 @@ http:
passHostHeader: false
servers:
- url: $AGENTS_API_URL


service-monitor:
loadBalancer:
passHostHeader: false
servers:
- url: $MONITOR_URL

experimental:
localPlugins:
jwt:
Expand Down
2 changes: 2 additions & 0 deletions grafana/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ services:
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD}
- GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER}
- GF_SERVER_ROOT_URL=%(protocol)s://%(domain)s:%(http_port)s/monitor/
- GF_SERVER_SERVE_FROM_SUB_PATH=true
container_name: grafana
ports:
- 3000:3000
Expand Down

0 comments on commit e9ba9d8

Please sign in to comment.