-
Notifications
You must be signed in to change notification settings - Fork 51
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: Loki Log Streaming #1385
base: main
Are you sure you want to change the base?
feat: Loki Log Streaming #1385
Changes from all commits
59cb815
61ee803
803955d
d43478b
bfddbb0
504056f
bbe6591
da4c622
19b03fc
592789b
86fb430
48818a4
8ba3e44
2a94893
f3729c7
200cdd5
57edbcf
155a340
2b6b472
2e3909f
96ab1cc
ffbb082
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -591,6 +591,18 @@ tenant_proxy: | |
## | ||
tolerations: [] | ||
|
||
## @section Loki configuration | ||
## | ||
loki: | ||
## Loki service configuration | ||
## | ||
service: | ||
## @param loki.service.type Kubernetes Service type | ||
## | ||
type: ClusterIP | ||
## @param loki.service.port Port to expose for http services | ||
port: 3100 | ||
|
||
Comment on lines
+594
to
+605
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we go with a "hard-coded" Loki url this should be able to go. |
||
## @section Tenant-UI Configuration | ||
## | ||
ui: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
server: | ||
http_listen_address: 0.0.0.0 | ||
http_listen_port: 9080 | ||
|
||
positions: | ||
filename: /tmp/positions.yaml | ||
|
||
clients: | ||
- url: http://loki:3100/loki/api/v1/push | ||
|
||
scrape_configs: | ||
- job_name: system | ||
static_configs: | ||
- targets: | ||
- localhost | ||
labels: | ||
job: varlogs | ||
__path__: /var/log/*log | ||
|
||
- job_name: journal | ||
journal: | ||
json: false | ||
max_age: 12h | ||
path: /var/log/journal | ||
# matches: _syslog_identifier=dockerd | ||
labels: | ||
job: systemd-journal | ||
relabel_configs: | ||
- source_labels: | ||
- __journal__systemd_unit | ||
target_label: systemd_unit | ||
- source_labels: | ||
- __journal__hostname | ||
target_label: hostname | ||
- source_labels: | ||
- __journal_syslog_identifier | ||
target_label: syslog_identifier | ||
- source_labels: | ||
- __journal__transport | ||
target_label: transport | ||
|
||
- job_name: containers | ||
static_configs: | ||
- targets: | ||
- localhost | ||
labels: | ||
job: containerlogs | ||
__path__: /var/lib/docker/containers/*/*log | ||
|
||
# --log-opt tag="{{.Name}}" | ||
pipeline_stages: | ||
|
||
- json: | ||
expressions: | ||
stream: stream | ||
attrs: attrs | ||
tag: attrs.tag | ||
|
||
- regex: | ||
expression: (?P<container_name>(?:[^|]*[^|])) | ||
source: "tag" | ||
|
||
- labels: | ||
tag: | ||
stream: | ||
container_name: | ||
|
||
- job_name: flog_scrape | ||
docker_sd_configs: | ||
- host: unix:///var/run/docker.sock | ||
refresh_interval: 5s | ||
filters: | ||
- name: name | ||
values: [flog] | ||
relabel_configs: | ||
- source_labels: ['__meta_docker_container_name'] | ||
regex: '/(.*)\.[0-9]\..*' | ||
target_label: 'name' | ||
- source_labels: ['__meta_docker_container_name'] | ||
regex: '/(.*)\.[0-9a-z]*\..*' | ||
target_label: 'name' | ||
- source_labels: ['__meta_docker_container_name'] | ||
regex: '/.*\.([0-9]{1,2})\..*' | ||
target_label: 'replica' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
version: "3.9" | ||
|
||
x-logging: &default-logging | ||
driver: loki | ||
options: | ||
loki-url: http://localhost:3100/loki/api/v1/push | ||
loki-retries: 5 | ||
loki-batch-size: 400 | ||
|
||
services: | ||
loki: | ||
image: grafana/loki:2.9.2 | ||
ports: | ||
- "3100:3100" | ||
command: -config.file=/etc/loki/local-config.yaml | ||
logging: *default-logging | ||
networks: | ||
- loki | ||
|
||
promtail: | ||
image: grafana/promtail:2.9.2 | ||
volumes: | ||
- /var/log:/var/log | ||
- /var/lib/docker/containers:/var/lib/docker/containers | ||
- ./configs/promtail.yml:/etc/promtail/config.yml | ||
command: -config.file=/etc/promtail/config.yml | ||
networks: | ||
- loki | ||
|
||
grafana: | ||
environment: | ||
- GF_PATHS_PROVISIONING=/etc/grafana/provisioning | ||
- GF_AUTH_ANONYMOUS_ENABLED=true | ||
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin | ||
logging: *default-logging | ||
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: false | ||
EOF | ||
/run.sh | ||
image: grafana/grafana:latest | ||
ports: | ||
- "3000:3000" | ||
networks: | ||
- loki | ||
|
||
networks: | ||
loki: |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
version: "3.12" | ||
x-logging: &default-logging | ||
driver: loki | ||
options: | ||
loki-url: http://localhost:3100/loki/api/v1/push | ||
loki-retries: 5 | ||
loki-batch-size: 400 | ||
|
||
services: | ||
ngrok-traction-agent: | ||
image: ngrok/ngrok | ||
logging: *default-logging | ||
environment: | ||
- NGROK_AUTHTOKEN=${NGROK_AUTHTOKEN} | ||
- TRACTION_ACAPY_HTTP_PORT=${TRACTION_ACAPY_HTTP_PORT} | ||
|
@@ -11,6 +19,7 @@ services: | |
|
||
traction-acapy-image-builder: | ||
pull_policy: missing | ||
logging: *default-logging | ||
build: | ||
context: ../plugins | ||
dockerfile: ./docker/Dockerfile | ||
|
@@ -24,6 +33,7 @@ services: | |
context: ../services/aca-py | ||
dockerfile: Dockerfile.acapy | ||
image: traction:traction-agent | ||
logging: *default-logging | ||
depends_on: | ||
traction-acapy-image-builder: | ||
condition: service_started | ||
|
@@ -95,6 +105,7 @@ services: | |
|
||
traction-db: | ||
image: "postgres:14.5" | ||
logging: *default-logging | ||
environment: | ||
- POSTGRES_USER=${POSTGRESQL_USER} | ||
- POSTGRES_PASSWORD=${POSTGRESQL_PASSWORD} | ||
|
@@ -113,6 +124,7 @@ services: | |
|
||
tenant-ui: | ||
pull_policy: missing | ||
logging: *default-logging | ||
build: | ||
context: ../services/tenant-ui | ||
dockerfile: Dockerfile | ||
|
@@ -122,7 +134,9 @@ services: | |
condition: service_started | ||
environment: | ||
- SERVER_TRACTION_URL=${SERVER_TRACTION_URL} | ||
- SERVER_LOKI_URL=${SERVER_LOKI_URL} | ||
- FRONTEND_TENANT_PROXY_URL=${FRONTEND_TENANT_PROXY_URL} | ||
- FRONTEND_LOG_STREAM_URL=${FRONTEND_LOG_STREAM_URL} | ||
Comment on lines
+137
to
+139
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See chart if its correct. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @esune can you confirm if the included chart changes look correct for these variables? |
||
- IMAGE_BUILDTIME=${IMAGE_BUILDTIME} | ||
- IMAGE_TAG=${IMAGE_TAG} | ||
- IMAGE_VERSION=${IMAGE_VERSION} | ||
|
@@ -146,6 +160,7 @@ services: | |
|
||
tenant-proxy: | ||
pull_policy: missing | ||
logging: *default-logging | ||
build: | ||
context: ../plugins | ||
dockerfile: ./docker/Dockerfile.tenant-proxy | ||
|
@@ -167,6 +182,7 @@ services: | |
depends_on: | ||
endorser-db: | ||
condition: service_healthy | ||
logging: *default-logging | ||
ports: | ||
- ${ACAPY_ENDORSER_ADMIN_PORT}:${ACAPY_ENDORSER_ADMIN_PORT} | ||
- ${ACAPY_ENDORSER_HTTP_PORT}:${ACAPY_ENDORSER_HTTP_PORT} | ||
|
@@ -205,6 +221,7 @@ services: | |
depends_on: | ||
endorser-db: | ||
condition: service_healthy | ||
logging: *default-logging | ||
ports: | ||
- ${ACAPY_ENDORSER_1_ADMIN_PORT}:${ACAPY_ENDORSER_1_ADMIN_PORT} | ||
- ${ACAPY_ENDORSER_1_HTTP_PORT}:${ACAPY_ENDORSER_1_HTTP_PORT} | ||
|
@@ -240,6 +257,7 @@ services: | |
|
||
endorser-db: | ||
image: "postgres:14.5" | ||
logging: *default-logging | ||
environment: | ||
- POSTGRES_USER=${POSTGRESQL_USER} | ||
- POSTGRES_PASSWORD=${POSTGRESQL_PASSWORD} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
loki.fullname
will not be available unless Loki is deployed at the same time as Traction.I think it might be best to just use a full URL from the values file in case Loki is not being deployed with the solution. Otherwise you'll have to add Loki as a dependent chart to Traction and handle on/off scenarios.