-
Notifications
You must be signed in to change notification settings - Fork 487
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
Use loki in k3d agent DS instead of promtail #406
Changes from all commits
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
local grafana_agent = import 'grafana-agent/v1/main.libsonnet'; | ||
|
||
grafana_agent.scrapeKubernetesLogs { | ||
local pipeline_stages = [ | ||
// k3d uses cri for logging | ||
{ cri: {} }, | ||
|
||
// Bad words metrics, used in Agent dashboard | ||
{ | ||
regex: { | ||
expression: '(?i)(?P<bad_words>panic:|core_dumped|failure|error|attack| bad |illegal |denied|refused|unauthorized|fatal|failed|Segmentation Fault|Corrupted)', | ||
}, | ||
}, | ||
{ | ||
metrics: { | ||
panic_total: { | ||
type: 'Counter', | ||
description: 'total count of panic: found in log lines', | ||
source: 'panic', | ||
config: { | ||
action: 'inc', | ||
}, | ||
}, | ||
bad_words_total: { | ||
type: 'Counter', | ||
description: 'total count of bad words found in log lines', | ||
source: 'bad_words', | ||
config: { | ||
action: 'inc', | ||
}, | ||
}, | ||
}, | ||
}, | ||
], | ||
|
||
scrape_configs: [ | ||
x { pipeline_stages: pipeline_stages } | ||
for x | ||
in super.scrape_configs | ||
], | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ k3d create \ | |
--name agent-k3d \ | ||
--publish 30080:30080 \ | ||
--api-port 50443 \ | ||
-v /var/lib/k3d/agent-k3d/storage/:/var/lib/rancher/k3s/storage/ | ||
-v /var/lib/k3d/agent-k3d/storage/:/var/lib/rancher/k3s/storage/ \ | ||
-v /etc/machine-id:/etc/machine-id | ||
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. This is needed for the Loki to work, where /etc/machine-id is bind-mounted. Promtail didn't need it unless you were reading from the systemd journal, but the Agent config always adds it. |
This file was deleted.
This file was deleted.
This file was deleted.
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.
This block was moved to loki_config.libsonnet.