-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup New Relic log forwarding (#345)
* Remove BuildBuddy grpc client * setup arm exporter * updated tests * optionally start arm_exporter * setup cron for docker prune * setup cron for required reboot * setup log forwarding * setup containerName and env labels for docker containers for logs
- Loading branch information
Showing
28 changed files
with
192 additions
and
813 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"log-driver": "json-file", | ||
"log-opts": { | ||
"max-size": "10m", | ||
"max-file": "3", | ||
"labels": "containerName,env" | ||
} | ||
} |
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
27 changes: 27 additions & 0 deletions
27
provisioner/deploys/monitoring/files/docker-logs-fluentbit.conf
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,27 @@ | ||
[INPUT] | ||
Name tail | ||
Path /var/lib/docker/containers/*/*.log | ||
Buffer_Max_Size 128k | ||
Mem_Buf_Limit 16384k | ||
Skip_Long_Lines On | ||
Path_Key filePath | ||
Tag docker-logs | ||
DB /var/db/newrelic-infra/newrelic-integrations/logging/fb.db | ||
Parser docker | ||
|
||
[FILTER] | ||
Name record_modifier | ||
Match docker-logs | ||
Record fb.input tail | ||
|
||
[FILTER] | ||
Name nest | ||
Match docker-logs | ||
Operation lift | ||
Nested_under attrs | ||
|
||
# [OUTPUT] | ||
# Name file | ||
# Format out_file | ||
# Path /tmp/docker-logs | ||
# Match docker-logs |
5 changes: 5 additions & 0 deletions
5
provisioner/deploys/monitoring/files/docker-parser-fluentbit.conf
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,5 @@ | ||
[PARSER] | ||
Name docker | ||
Format json | ||
Time_Key time | ||
Time_Format %Y-%m-%dT%H:%M:%S.%L %z |
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,11 @@ | ||
logs: | ||
- name: docker-logs | ||
fluentbit: | ||
config_file: /etc/newrelic-infra/logging.d/docker-logs-fluentbit.conf | ||
parsers_file: /etc/newrelic-infra/logging.d/docker-parser-fluentbit.conf | ||
|
||
- name: system-logs | ||
file: /var/log/*/*.log | ||
|
||
- name: systemd-teleport | ||
systemd: teleport |
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,6 @@ | ||
#!/bin/sh | ||
|
||
# Copied from https://askubuntu.com/questions/829526/ubuntu-server-reboot-command-in-crontab-trigger-only-if-required | ||
if [ -f /var/run/reboot-required ]; then | ||
/sbin/shutdown -r now | ||
fi |
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
Oops, something went wrong.