Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme for logs #1102

Merged

Conversation

Mixaster995
Copy link
Contributor

Signed-off-by: Mikhail Avramenko avramenkomihail15@gmail.com

Description

Added document with useful tips for analysing logs

Issue link

#1008

Types of changes

  • Bug fix
  • New functionallity
  • Documentation
  • Refactoring
  • CI

@@ -0,0 +1,34 @@
## Tips for reading and manipulating logs.

### Hot to understand logs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, fixed

1. Applied to folder containing resulting logs. It removes lines related to Jaeger and remove lines with just spans. Also it changes file extension to be suitable for highlighters
```bash
for filename in *.logs; do
cat "${filename}" | grep -v "Reporting span" | grep -v "Jaeger" | sed -E "s/^.*(Sep)/\1/g" > "$(echo "${filename}" | sed "s/\.logs/\.log/g")"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are no more using timestamps in k8s logs, so:

Suggested change
cat "${filename}" | grep -v "Reporting span" | grep -v "Jaeger" | sed -E "s/^.*(Sep)/\1/g" > "$(echo "${filename}" | sed "s/\.logs/\.log/g")"
cat "${filename}" | grep -v "Reporting span" | grep -v "Jaeger" > "$(echo "${filename}" | sed "s/\.logs/\.log/g")"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, done

@Mixaster995 Mixaster995 force-pushed the documentation/log-tips branch 2 times, most recently from ea93f2a to 48f3b1d Compare October 12, 2021 07:12
Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com>
@Mixaster995 Mixaster995 added this to Review in progress in Issue/PR tracking Oct 12, 2021
3. Most of the log lines contains `[id:'some value']` which is helpful when tracing request in application chain
4. It is useful to transform logs using `grep` utility to discard 'noise' logs that is not needed for analyzing(examples will be in section `Useful scripts`)
5. It is helpful to install plugin to IDE which is colorizing logs. (for example ANSI highlighter for Goland)
6. Message `an error during getting metadata from context: metadata is missed in ctx` - id a good criteria for separating ordinary request from refresh request(refresh do not have metadata)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... - is a good ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, done

2. It is useful to grep logs for extracting specific information that you want - by id, type, loglevel etc. For example:
- get only networkService type lines
```bash
grep -w grep -w type:networkService some_log_file.log > another_log_file.log

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it a duplucation?

Suggested change
grep -w grep -w type:networkService some_log_file.log > another_log_file.log
grep -w type:networkService some_log_file.log > another_log_file.log

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, fixed

Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com>
Copy link
Member

@denis-tingaikin denis-tingaikin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine as a first version

@denis-tingaikin denis-tingaikin merged commit f264fec into networkservicemesh:main Oct 14, 2021
Issue/PR tracking automation moved this from Review in progress to Done Oct 14, 2021
nsmbot pushed a commit to networkservicemesh/cmd-registry-memory that referenced this pull request Oct 14, 2021
…k@main

PR link: networkservicemesh/sdk#1102

Commit: f264fec
Author: Авраменко Михаил
Date: 2021-10-14 16:25:25 +0700
Message:
  - Readme for logs (#1102)
* added doc for logs

Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com>

* review fixes

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/sdk-kernel that referenced this pull request Oct 14, 2021
…k@main

PR link: networkservicemesh/sdk#1102

Commit: f264fec
Author: Авраменко Михаил
Date: 2021-10-14 16:25:25 +0700
Message:
  - Readme for logs (#1102)
* added doc for logs

Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com>

* review fixes

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nse-vfio that referenced this pull request Oct 14, 2021
…k@main

PR link: networkservicemesh/sdk#1102

Commit: f264fec
Author: Авраменко Михаил
Date: 2021-10-14 16:25:25 +0700
Message:
  - Readme for logs (#1102)
* added doc for logs

Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com>

* review fixes

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-registry-proxy-dns that referenced this pull request Oct 14, 2021
…k@main

PR link: networkservicemesh/sdk#1102

Commit: f264fec
Author: Авраменко Михаил
Date: 2021-10-14 16:25:25 +0700
Message:
  - Readme for logs (#1102)
* added doc for logs

Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com>

* review fixes

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsc-init that referenced this pull request Oct 14, 2021
…k@main

PR link: networkservicemesh/sdk#1102

Commit: f264fec
Author: Авраменко Михаил
Date: 2021-10-14 16:25:25 +0700
Message:
  - Readme for logs (#1102)
* added doc for logs

Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com>

* review fixes

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/sdk-k8s that referenced this pull request Oct 14, 2021
…k@main

PR link: networkservicemesh/sdk#1102

Commit: f264fec
Author: Авраменко Михаил
Date: 2021-10-14 16:25:25 +0700
Message:
  - Readme for logs (#1102)
* added doc for logs

Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com>

* review fixes

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
nsmbot pushed a commit to networkservicemesh/cmd-nsmgr-proxy that referenced this pull request Oct 14, 2021
…k@main

PR link: networkservicemesh/sdk#1102

Commit: f264fec
Author: Авраменко Михаил
Date: 2021-10-14 16:25:25 +0700
Message:
  - Readme for logs (#1102)
* added doc for logs

Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com>

* review fixes

Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
@Mixaster995 Mixaster995 deleted the documentation/log-tips branch October 15, 2021 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants