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

How to view TiDB slow log? #231

Closed
tennix opened this issue Dec 15, 2018 · 5 comments · Fixed by #290
Closed

How to view TiDB slow log? #231

tennix opened this issue Dec 15, 2018 · 5 comments · Fixed by #290
Labels
enhancement New feature or request good first issue Good for newcomers status/help-wanted Extra attention is needed

Comments

@tennix
Copy link
Member

tennix commented Dec 15, 2018

TiDB can output slow log to a separate log file. This makes it easy to view the slow logs. Otherwise, users have to grep slow log from all logs. However, users cannot view the slow logs by kubectl if TiDB pod emits logs to a separate log file.

Kubernetes documentation suggests using sidecar to support multiple log files. The sidecar container can only tails the log file to stdout, so the resources used is small:

order of couple of millicores for cpu and order of several megabytes for memory

So I think we should add sidecar container for TiDB pod for slow log.

@tennix tennix added enhancement New feature or request status/help-wanted Extra attention is needed labels Jan 2, 2019
@mlycore
Copy link

mlycore commented Feb 2, 2019

We could write our own Admission Controller plugin to inject the log sidecar just like what Istio does

@tennix
Copy link
Member Author

tennix commented Feb 3, 2019

Thanks for your suggestion, we'll investigate this approach.

@tennix tennix added the good first issue Good for newcomers label Feb 18, 2019
@tennix
Copy link
Member Author

tennix commented Feb 18, 2019

@mlycore Since the TiDB pods are created by TiDB StatefulSet, and the StatefulSet is created by TidbCluster, we can totally control how our pods look like. So there is no need to add another plugin to inject log sidecar.

@aylei
Copy link
Contributor

aylei commented Feb 25, 2019

I'd like to help with this issue if there is no ongoing development work.

@weekface
Copy link
Contributor

weekface commented Feb 25, 2019

@aylei Of course you can, thank you. Feel free to contact us if you have any problems.

yahonda pushed a commit that referenced this issue Dec 27, 2021
* en: fix a title in toc

* align doc titles with toc titles

Co-authored-by: DanielZhangQD <36026334+DanielZhangQD@users.noreply.github.com>
Co-authored-by: Lilian Lee <lilin@pingcap.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers status/help-wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants