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

can we record more information about slow_sql log #6898

Closed
kitdine opened this issue Jun 25, 2018 · 9 comments
Closed

can we record more information about slow_sql log #6898

kitdine opened this issue Jun 25, 2018 · 9 comments
Labels
duplicate Issues or pull requests already exists. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. sig/execution SIG execution

Comments

@kitdine
Copy link

kitdine commented Jun 25, 2018

Please answer these questions before submitting your issue. Thanks!

  1. What did you do?
    If possible, provide a recipe for reproducing the error.
    Now, in the slow_sql log file we just can see happening time, type,succ,connectionId,costTime,database,sql

  2. What did you expect to see?
    can we record the execute user and request ip address

  3. What did you see instead?

  4. What version of TiDB are you using (tidb-server -V or run select tidb_version(); on TiDB)?
    Release Version: v2.0.3-1-g98c480c
    Git Commit Hash: 98c480c
    Git Commit Branch: release-2.0
    UTC Build Time: 2018-06-03 03:09:10
    GoVersion: go version go1.10.2 linux/amd64
    TiKV Min Version: 2.0.0-rc.4.1

@tiancaiamao
Copy link
Contributor

That is a good suggestion, we'll take it into consideration. @kitdine

@zz-jason zz-jason added sig/execution SIG execution help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. labels Jun 26, 2018
@liuqian1990
Copy link

appname能记录吗

@tiancaiamao
Copy link
Contributor

No. appname belongs to the application's logic, not database's @liuqian1990

@lysu
Copy link
Contributor

lysu commented Jun 27, 2018

@kitdine user and ip is address in #6673 and #6748

@lysu
Copy link
Contributor

lysu commented Jun 27, 2018

@liuqian1990 In pratice, you can add appName or appId or traceid in sql as a sql comment, e.g.

/*appid:121, traceid:2134*/ select name from user where id = 1;

and you can union encapsulate this attach action in your data access layer or framework then you can see it in db log.

@lysu lysu added the duplicate Issues or pull requests already exists. label Jun 27, 2018
@kitdine
Copy link
Author

kitdine commented Jun 27, 2018

@lysu so which tidb version has this feature,I do not find it on the 2.0.3 version

@lysu
Copy link
Contributor

lysu commented Jun 27, 2018

@kitdine Sorry, let me see... it's in master and doesn't pick to 2.0.x now..

@kitdine
Copy link
Author

kitdine commented Jun 27, 2018

@lysu ok so when can we have a version that include this feature?

@lysu
Copy link
Contributor

lysu commented Jun 27, 2018

for current, you can use master code for test, and we will port this feature to 2.0.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues or pull requests already exists. help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. sig/execution SIG execution
Projects
None yet
Development

No branches or pull requests

6 participants