-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #328 from stakater/few-fixes
update SD and remove invalid faqs
- Loading branch information
Showing
15 changed files
with
25 additions
and
256 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
Empty file.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,89 +1,10 @@ | ||
# Logging | ||
|
||
Stakater App Agility Platform uses EFK Stack (ElasticSearch, Fluentd and Kibana) to provide logging for applications. Fluentd daemonsets pick up the logs and send these to ElasticSearch. Kibana dashboards can be used to view/analyze logs | ||
|
||
![Logging](./images/logging.jpg) | ||
Stakater App Agility Platform (SAAP) uses Loki and Vector to provide logging for applications. | ||
|
||
## Components | ||
|
||
Here are the logging stack components: | ||
|
||
- Fluentd | ||
- ElasticSearch | ||
- Kibana | ||
- Event Router | ||
|
||
## Parse JSON Application Logs | ||
|
||
Logs are parsed by default if applications output logs in `JSON format` on stdout. Moreover one step nested JSON parsing is also supported additionally. | ||
|
||
Consider the following example of a one line event by a java application: | ||
|
||
```json | ||
{"timestamp":"2021-04-15 11:41:01.427","level":"WARN","thread":"http-nio-8080-exec-4","mdc":{"breadcrumbId":"441ce707-8096-4aba-a927-0afa8c34802b-by-BOKE","user":"service-account-boke"},"logger":"org.zalando.logbook.Logbook","message":"{\"origin\":\"local\",\"type\":\"response\",\"correlation\":\"ef4f3737f2bcf856\"}"} | ||
``` | ||
|
||
This will be parsed as follows: | ||
|
||
```json | ||
{ | ||
"timestamp":"2021-04-15 11:41:01.427", | ||
"level":"WARN", | ||
"thread":"http-nio-8080-exec-4", | ||
"mdc.breadcrumbId":"441ce707-8096-4aba-a927-0afa8c34802b-by-BOKE", | ||
"mdc.user":"service-account-boke", | ||
"logger":"org.zalando.logbook.Logbook", | ||
"message":"{\"origin\":\"local\",\"type\":\"response\",\"correlation\":\"ef4f3737f2bcf856\"}", | ||
"origin": "local", | ||
"type": "response", | ||
"correlation": "ef4f3737f2bcf856" | ||
} | ||
``` | ||
|
||
## Parse non JSON Application Logs | ||
|
||
Parsing application logs which are not in `JSON format` can be done as follows: | ||
|
||
Consider the following example of a one line event by a java application: | ||
|
||
```sh | ||
2019-11-27 11:04:12.682 INFO 1 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet' | ||
``` | ||
|
||
The configuration to parse/match/send logs can be specified in the [Application Chart](https://github.com/stakater-charts/application), by specifying regular expressions as described below: | ||
|
||
| Parameter | Description | | ||
|:---|:---| | ||
|.Values.deployment.fluentdConfigAnnotations.regexFirstLine|specify the regex to match the first line of the log| | ||
|.Values.deployment.fluentdConfigAnnotations.regex|specify the regex to parse the complete log entry| | ||
|.Values.deployment.fluentdConfigAnnotations.timeFormat|specify the regex to parse time| | ||
|
||
Use the following Configuration for parsing java springboot logs : | ||
|
||
```yaml | ||
deployment: | ||
fluentdConfigAnnotations: | ||
regex: /^(?<time>\\d+(?:-\\d+){2}\\s+\\d+(?::\\d+){2}\\.\\d+)\\s*(?<level>\\S+) | ||
(?<pid>\\d+) --- \\[(?<thread>[\\s\\S]*?)\\] (?<class>\\S+)\\s*:\\s*(?<message>[\\s\\S]*?)(?=\\g<time>|\\Z)/ | ||
regexFirstLine: /^\\d+(?:-\\d+){2}\\s+\\d+(?::\\d+){2}\\.\\d+/ | ||
timeFormat: "%Y-%m-%d %H:%M:%S.%L" | ||
``` | ||
This will be parsed as follows: | ||
```yaml | ||
time: 2019-11-27 11:04:12.682 | ||
level: INFO | ||
pid: 1 | ||
thread: nio-8080-exec-1 | ||
class: o.s.web.servlet.DispatcherServlet | ||
message: Initializing Servlet 'dispatcherServlet' | ||
``` | ||
## Log Retention | ||
By default Application logs are retained for 7 days. | ||
## Application alerting | ||
Alerts can be sent to Slack channels by matching a string against a particular field. e.g. Send an alert to Slack if `level`==`ERROR`. These alerts increase operational efficiency. See [Application log alerting](../monitoring-stack/log-alerts.md#Application-Logs-Alerting) on how to configure alerts | ||
- [Loki](https://github.com/grafana/loki) | ||
- [Vector](https://github.com/vectordotdev/vector) |
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