-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
log-vm: Adding grafana services and storing logs in log-vm
This patch will add promtail-agent service in `ghaf-host` and `gui-vm`. Also add loki service in log-vm. Signed-off-by: Vunny Sodhi <vunny.sodhi@unikie.com>
- Loading branch information
Showing
6 changed files
with
112 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
{pkgs, ...}: let | ||
server-ip-port = "192.168.101.66:3100"; | ||
in { | ||
environment.etc."promtail-local-config.yaml".text = '' | ||
server: | ||
http_listen_port: 9101 | ||
grpc_listen_port: 0 | ||
positions: | ||
filename: /tmp/positions.yaml | ||
client: | ||
url: http://${server-ip-port}/loki/api/v1/push | ||
scrape_configs: | ||
- job_name: journal | ||
journal: | ||
path: /var/log/journal | ||
labels: | ||
job: systemd-journal | ||
relabel_configs: | ||
- source_labels: ['__journal__systemd_unit'] | ||
target_label: 'unit' | ||
''; | ||
|
||
systemd.services.promtail = { | ||
description = "Service to upload journal logs"; | ||
enable = true; | ||
after = ["network-online.target"]; | ||
serviceConfig = { | ||
ExecStart = "${pkgs.grafana-loki}/bin/promtail -config.file=/etc/promtail-local-config.yaml"; | ||
Restart = "on-failure"; | ||
RestartSec = "1"; | ||
}; | ||
wantedBy = ["multi-user.target"]; | ||
}; | ||
} |
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
39 changes: 39 additions & 0 deletions
39
modules/microvm/virtualization/microvm/loki-local-config.yaml
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,39 @@ | ||
# Copyright 2022-2024 TII (SSRC) and the Ghaf contributors | ||
# SPDX-License-Identifier: Apache-2.0 | ||
auth_enabled: false | ||
|
||
server: | ||
http_listen_port: 3100 | ||
grpc_listen_port: 9096 | ||
|
||
common: | ||
instance_addr: 127.0.0.1 | ||
path_prefix: /tmp/loki | ||
storage: | ||
filesystem: | ||
chunks_directory: /tmp/loki/chunks | ||
rules_directory: /tmp/loki/rules | ||
replication_factor: 1 | ||
ring: | ||
kvstore: | ||
store: inmemory | ||
|
||
query_range: | ||
results_cache: | ||
cache: | ||
embedded_cache: | ||
enabled: true | ||
max_size_mb: 100 | ||
|
||
schema_config: | ||
configs: | ||
- from: 2020-10-24 | ||
store: tsdb | ||
object_store: filesystem | ||
schema: v13 | ||
index: | ||
prefix: index_ | ||
period: 24h | ||
|
||
ruler: | ||
alertmanager_url: http://localhost:9093 |
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