diff --git a/k8s/chart/Chart.yaml b/k8s/chart/Chart.yaml index c9ca032..8eb595f 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/k8s/chart/values.yaml b/k8s/chart/values.yaml new file mode 100644 index 0000000..ea3578a --- /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: [] diff --git a/stubbornjava-webapp/src/main/resources/logback.xml b/stubbornjava-webapp/src/main/resources/logback.xml index a093887..3a190d4 100644 --- a/stubbornjava-webapp/src/main/resources/logback.xml +++ b/stubbornjava-webapp/src/main/resources/logback.xml @@ -14,9 +14,11 @@ + + true - true + false yyyy-MM-dd' 'HH:mm:ss.SSS