From ff51994befab43f3c16903cc9f5c5a07e297d701 Mon Sep 17 00:00:00 2001 From: Bill O'Neil Date: Sat, 20 Nov 2021 08:17:31 -0500 Subject: [PATCH 1/4] Try no pretty printing? --- k8s/chart/Chart.yaml | 5 +++++ stubbornjava-webapp/src/main/resources/logback.xml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/k8s/chart/Chart.yaml b/k8s/chart/Chart.yaml index c9ca0329..8eb595f7 100644 --- a/k8s/chart/Chart.yaml +++ b/k8s/chart/Chart.yaml @@ -5,3 +5,8 @@ description: Helm chart to deploy StubbornJava type: application version: 0.1.0 appVersion: 1.0.0 + +dependencies: +- name: promtail + version: 3.8.2 + repository: https://grafana.github.io/helm-charts diff --git a/stubbornjava-webapp/src/main/resources/logback.xml b/stubbornjava-webapp/src/main/resources/logback.xml index a0938871..7c079678 100644 --- a/stubbornjava-webapp/src/main/resources/logback.xml +++ b/stubbornjava-webapp/src/main/resources/logback.xml @@ -16,7 +16,7 @@ - true + false yyyy-MM-dd' 'HH:mm:ss.SSS From 06ad3551c3e001e5cc246a22931ee10fd79ee207 Mon Sep 17 00:00:00 2001 From: Bill O'Neil Date: Sat, 20 Nov 2021 08:50:31 -0500 Subject: [PATCH 2/4] Add line separator --- stubbornjava-webapp/src/main/resources/logback.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/stubbornjava-webapp/src/main/resources/logback.xml b/stubbornjava-webapp/src/main/resources/logback.xml index 7c079678..9b2f0dca 100644 --- a/stubbornjava-webapp/src/main/resources/logback.xml +++ b/stubbornjava-webapp/src/main/resources/logback.xml @@ -17,6 +17,7 @@ false + true yyyy-MM-dd' 'HH:mm:ss.SSS From b078f735ad824c14f8a66aeb5048b255563e57b6 Mon Sep 17 00:00:00 2001 From: Bill O'Neil Date: Sat, 20 Nov 2021 09:00:56 -0500 Subject: [PATCH 3/4] fix lines again --- stubbornjava-webapp/src/main/resources/logback.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stubbornjava-webapp/src/main/resources/logback.xml b/stubbornjava-webapp/src/main/resources/logback.xml index 9b2f0dca..3a190d48 100644 --- a/stubbornjava-webapp/src/main/resources/logback.xml +++ b/stubbornjava-webapp/src/main/resources/logback.xml @@ -14,10 +14,11 @@ + + true false - true yyyy-MM-dd' 'HH:mm:ss.SSS From 1a7c4dbe2c3c5d8070ecbd9998e4d9fbbf122626 Mon Sep 17 00:00:00 2001 From: Bill O'Neil Date: Sat, 20 Nov 2021 09:24:34 -0500 Subject: [PATCH 4/4] Add chart values --- k8s/chart/values.yaml | 49 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 k8s/chart/values.yaml diff --git a/k8s/chart/values.yaml b/k8s/chart/values.yaml new file mode 100644 index 00000000..ea3578aa --- /dev/null +++ b/k8s/chart/values.yaml @@ -0,0 +1,49 @@ +promtail: + config: + # -- The log level of the Promtail server + # Must be reference in `config.file` to configure `server.log_level` + # See default config in `values.yaml` + logLevel: info + # -- The port of the Promtail server + # Must be reference in `config.file` to configure `server.http_listen_port` + # See default config in `values.yaml` + serverPort: 3101 + # -- The Loki address to post logs to. + # Must be reference in `config.file` to configure `client.url`. + # See default config in `values.yaml` + lokiAddress: https://{masked}@logs-prod-us-central1.grafana.net/api/prom/push + # -- A section of reusable snippets that can be reference in `config.file`. + # Custom snippets may be added in order to reduce redundancy. + # This is especially helpful when multiple `kubernetes_sd_configs` are use which usually have large parts in common. + # @default -- See `values.yaml` + snippets: + + # If set to true, adds an additional label for the scrape job. + # This helps debug the Promtail config. + addScrapeJobLabel: false + + # -- You can put here any keys that will be directly added to the config file's 'client' block. + # @default -- empty + extraClientConfigs: "" + + # Explicitly turn off the defaults for now. + # scrapeConfigs: "" + + # -- You can put here any additional scrape configs you want to add to the config file. + # @default -- empty + extraScrapeConfigs: | + - job_name: sj-web + pipeline_stages: + - match: + selector: '{app="sj-web"}' + stages: + - json: + expressions: + level: level + message: message + timestamp: timestamp + logger_name: logger_name + stack_trace: stack_trace + thread_name: thread_name + + extraRelabelConfigs: []