-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show example of using loki for logging
Store logs for the RQD, Cuebot and DB pod's in loki and make the datasource available in grafana.
- Loading branch information
Lars van der Bijl
committed
Feb 2, 2021
1 parent
bf128e4
commit 91d7169
Showing
5 changed files
with
153 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# config file version | ||
apiVersion: 1 | ||
|
||
deleteDatasources: | ||
- name: loki | ||
|
||
datasources: | ||
- name: loki | ||
type: loki | ||
access: proxy | ||
orgId: 1 | ||
url: http://loki:3100 | ||
basicAuth: false | ||
isDefault: true | ||
version: 1 | ||
editable: 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,54 @@ | ||
auth_enabled: false | ||
|
||
server: | ||
http_listen_port: 3100 | ||
|
||
ingester: | ||
lifecycler: | ||
address: 127.0.0.1 | ||
ring: | ||
kvstore: | ||
store: inmemory | ||
replication_factor: 1 | ||
final_sleep: 0s | ||
chunk_idle_period: 5m | ||
chunk_retain_period: 30s | ||
|
||
schema_config: | ||
configs: | ||
- from: 2020-01-20 | ||
store: boltdb | ||
object_store: filesystem | ||
schema: v9 | ||
index: | ||
prefix: index_ | ||
period: 168h | ||
|
||
storage_config: | ||
boltdb: | ||
directory: /tmp/loki/index | ||
|
||
filesystem: | ||
directory: /tmp/loki/chunks | ||
|
||
limits_config: | ||
enforce_metric_name: false | ||
reject_old_samples: true | ||
reject_old_samples_max_age: 168h | ||
|
||
chunk_store_config: | ||
max_look_back_period: 0 | ||
|
||
table_manager: | ||
chunk_tables_provisioning: | ||
inactive_read_throughput: 0 | ||
inactive_write_throughput: 0 | ||
provisioned_read_throughput: 0 | ||
provisioned_write_throughput: 0 | ||
index_tables_provisioning: | ||
inactive_read_throughput: 0 | ||
inactive_write_throughput: 0 | ||
provisioned_read_throughput: 0 | ||
provisioned_write_throughput: 0 | ||
retention_deletes_enabled: false | ||
retention_period: 0 |
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,53 @@ | ||
version: '3' | ||
|
||
services: | ||
db: | ||
logging: | ||
driver: loki | ||
options: | ||
loki-url: http://localhost:3100/loki/api/v1/push | ||
loki-external-labels: job=db | ||
|
||
cuebot: | ||
logging: | ||
driver: loki | ||
options: | ||
loki-url: http://localhost:3100/loki/api/v1/push | ||
loki-external-labels: job=cuebot | ||
|
||
rqd: | ||
logging: | ||
driver: loki | ||
options: | ||
loki-url: http://localhost:3100/loki/api/v1/push | ||
loki-external-labels: job=rqd | ||
|
||
metrics: | ||
build: | ||
context: ./ | ||
dockerfile: ./connectors/prometheus_metrics/Dockerfile | ||
environment: | ||
- CUEBOT_HOSTS=cuebot | ||
depends_on: | ||
- cuebot | ||
links: | ||
- cuebot | ||
ports: | ||
- "8302:8302" | ||
|
||
grafana: | ||
image: grafana/grafana:7.1.1 | ||
volumes: | ||
- ./sandbox/config/datasource.yml:/etc/grafana/provisioning/datasources/datasource.yml | ||
ports: | ||
- "3000:3000" | ||
|
||
loki: | ||
image: grafana/loki:v1.3.0 | ||
volumes: | ||
- ./sandbox/config/loki.yaml:/etc/config/loki.yaml | ||
entrypoint: | ||
- /usr/bin/loki | ||
- -config.file=/etc/config/loki.yaml | ||
ports: | ||
- "3100:3100" |
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