Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions k8s/chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
49 changes: 49 additions & 0 deletions k8s/chart/values.yaml
Original file line number Diff line number Diff line change
@@ -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: []
4 changes: 3 additions & 1 deletion stubbornjava-webapp/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
<!-- The JSON appender is meant to be machine friendly for log parsing -->
<appender name="JSON" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.contrib.json.classic.JsonLayout">
<!-- This pushes all logs on a single line by default -->
<appendLineSeparator>true</appendLineSeparator>
<jsonFormatter
class="ch.qos.logback.contrib.jackson.JacksonJsonFormatter">
<prettyPrint>true</prettyPrint>
<prettyPrint>false</prettyPrint>
</jsonFormatter>
<timestampFormat>yyyy-MM-dd' 'HH:mm:ss.SSS</timestampFormat>
</layout>
Expand Down