-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #256 from bento-platform/feat/logs
feat: monitoring system
- Loading branch information
Showing
15 changed files
with
264 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# env: BENTO_MONITORING_ENABLED | ||
location /api/grafana { return 302 https://${BENTOV2_PORTAL_DOMAIN}/api/grafana/; } | ||
location /api/grafana/ { | ||
# Reverse proxy settings | ||
include /gateway/conf/proxy.conf; | ||
include /gateway/conf/proxy_extra.conf; | ||
# Immediate set/re-use means we don't get resolve errors if not up (as opposed to passing as a literal) | ||
set $upstream_grafana http://${BENTO_GRAFANA_CONTAINER_NAME}:3000; | ||
proxy_pass $upstream_grafana; | ||
error_log /var/log/bentov2_grafana_errors.log; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
services: | ||
grafana: | ||
image: ${BENTO_GRAFANA_IMAGE}:${BENTO_GRAFANA_IMAGE_VERSION} | ||
container_name: ${BENTO_GRAFANA_CONTAINER_NAME} | ||
environment: | ||
- GF_PATHS_PROVISIONING=/etc/grafana/provisioning | ||
- GF_SERVER_ROOT_URL=${BENTO_PRIVATE_GRAFANA_URL} | ||
- GF_SERVER_SERVE_FROM_SUB_PATH=true | ||
- GF_SECURITY_COOKIE_SAMESITE=none | ||
- GF_SECURITY_ALLOW_EMBEDDING=true | ||
- GF_LOG_LEVEL=debug | ||
- GF_SECURITY_DISABLE_INITIAL_ADMIN_CREATION=true | ||
- GF_AUTH_GENERIC_OAUTH_ENABLED=true | ||
- GF_AUTH_GENERIC_OAUTH_NAME=Keycloak-OAuth | ||
- GF_AUTH_GENERIC_OAUTH_ALLOW_SIGN_UP=true | ||
- GF_AUTH_GENERIC_OAUTH_CLIENT_ID=${BENTO_GRAFANA_CLIENT_ID} | ||
- GF_AUTH_GENERIC_OAUTH_CLIENT_SECRET=${BENTO_GRAFANA_CLIENT_SECRET} | ||
- GF_AUTH_GENERIC_OAUTH_SCOPES=openid profile offline_access roles | ||
- GF_AUTH_GENERIC_OAUTH_LOGIN_ATTRIBUTE_PATH=username | ||
- GF_AUTH_GENERIC_OAUTH_NAME_ATTRIBUTE_PATH=full_name | ||
- GF_AUTH_GENERIC_OAUTH_USE_PKCE=true | ||
- GF_AUTH_GENERIC_OAUTH_AUTH_URL=https://${BENTOV2_AUTH_DOMAIN}/realms/bentov2/protocol/openid-connect/auth | ||
- GF_AUTH_GENERIC_OAUTH_TOKEN_URL=https://${BENTOV2_AUTH_DOMAIN}/realms/bentov2/protocol/openid-connect/token | ||
- GF_AUTH_GENERIC_OAUTH_API_URL=https://${BENTOV2_AUTH_DOMAIN}/realms/bentov2/protocol/openid-connect/userinfo | ||
- GF_AUTH_GENERIC_OAUTH_ROLE_ATTRIBUTE_PATH='GrafanaAdmin' | ||
- GF_AUTH_ALLOW_ASSIGN_GRAFANA_ADMIN=true | ||
entrypoint: | ||
- sh | ||
- -euc | ||
- | | ||
mkdir -p /etc/grafana/provisioning/datasources | ||
cat <<EOF > /etc/grafana/provisioning/datasources/ds.yaml | ||
apiVersion: 1 | ||
datasources: | ||
- name: Loki | ||
type: loki | ||
access: proxy | ||
orgId: 1 | ||
url: http://loki:3100 | ||
basicAuth: false | ||
isDefault: true | ||
version: 1 | ||
editable: true | ||
EOF | ||
/run.sh | ||
user: | ||
${BENTO_UID} | ||
volumes: | ||
- ${BENTO_GRAFANA_LIB_DIR}:/var/lib/grafana | ||
expose: | ||
- 3000 | ||
healthcheck: | ||
test: [ "CMD", "curl", "-k", "https://localhost:3000"] | ||
timeout: 5s | ||
interval: 15s | ||
profiles: | ||
- monitoring | ||
networks: | ||
- monitoring-net | ||
|
||
loki: | ||
container_name: ${BENTO_LOKI_CONTAINER_NAME} | ||
image: ${BENTO_LOKI_IMAGE}:${BENTO_LOKI_IMAGE_VERSION} | ||
volumes: | ||
- ${BENTO_LOKI_TEMP_DIR}:/tmp/loki | ||
- ${PWD}/lib/logs/loki-config.yaml:/etc/loki/loki-config.yaml | ||
expose: | ||
- 3100 | ||
command: -config.file=/etc/loki/loki-config.yaml | ||
user: | ||
${BENTO_UID} | ||
networks: | ||
- monitoring-net | ||
profiles: | ||
- monitoring | ||
|
||
promtail: | ||
container_name: ${BENTO_PROMTAIL_CONTAINER_NAME} | ||
image: ${BENTO_PROMTAIL_IMAGE}:${BENTO_PROMTAIL_IMAGE_VERSION} | ||
volumes: | ||
- "/var/lib/docker/containers:/var/lib/docker/containers" | ||
- "/var/run/docker.sock:/var/run/docker.sock" | ||
- "${PWD}/lib/logs/promtail-config.yaml:/etc/promtail/config.yaml" | ||
command: "-config.file=/etc/promtail/config.yaml" | ||
networks: | ||
- monitoring-net | ||
profiles: | ||
- monitoring | ||
|
||
networks: | ||
monitoring-net: | ||
external: true | ||
name: ${BENTO_MONITORING_NETWORK} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
|
||
# This is a complete configuration to deploy Loki backed by the filesystem. | ||
# The index will be shipped to the storage via tsdb-shipper. | ||
|
||
auth_enabled: false | ||
|
||
server: | ||
http_listen_port: 3100 | ||
|
||
common: | ||
ring: | ||
instance_addr: 127.0.0.1 | ||
kvstore: | ||
store: inmemory | ||
replication_factor: 1 | ||
path_prefix: /tmp/loki | ||
|
||
schema_config: | ||
configs: | ||
- from: 2020-05-15 | ||
store: tsdb | ||
object_store: filesystem | ||
schema: v13 | ||
index: | ||
prefix: index_ | ||
period: 24h | ||
|
||
storage_config: | ||
filesystem: | ||
directory: /tmp/loki/chunks | ||
|
||
limits_config: | ||
reject_old_samples: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
server: | ||
http_listen_port: 9080 | ||
grpc_listen_port: 0 | ||
|
||
positions: | ||
filename: /tmp/positions.yaml | ||
|
||
clients: | ||
- url: http://loki:3100/loki/api/v1/push | ||
|
||
scrape_configs: | ||
- job_name: docker | ||
pipeline_stages: | ||
- static_labels: | ||
job: docker | ||
host: docker | ||
agent: promtail | ||
docker_sd_configs: | ||
- host: unix:///var/run/docker.sock | ||
refresh_interval: 5s | ||
relabel_configs: | ||
- source_labels: ['__meta_docker_container_name'] | ||
regex: '/(.*)' | ||
target_label: 'container' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters