Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Promtail logging#489

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
billoneil wants to merge4 commits intomaster
base:master
Choose a base branch
Loading
frompromtail-k8s
Open
Show file tree
Hide file tree
Changes fromall 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 deletionsk8s/chart/Chart.yaml
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionsk8s/chart/values.yaml
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionstubbornjava-webapp/src/main/resources/logback.xml
View file
Open in desktop
Original file line numberDiff line numberDiff 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

[8]ページ先頭

©2009-2025 Movatter.jp