You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2020/04/24 07:54:20 UTC
[GitHub] [skywalking] smartisanyyh opened a new issue #4700: 'Database topN records' doesn't work on oracle database
smartisanyyh opened a new issue #4700:
URL: https://github.com/apache/skywalking/issues/4700
Please answer these questions before submitting your issue.
- Why do you submit this issue?
- [ ] Question or discussion
- [x] Bug
- [ ] Requirement
- [ ] Feature or performance improvement
___
### Question
- What do you want to know?
Looks like that the feature 'Database topN records' doesn't work on oracle database
___
### Bug
- Which version of SkyWalking, OS and JRE?
7.0.0
- Which company or project?
- What happen?
If possible, provide a way for reproducing the error. e.g. demo application, component version.
___
### Requirement or improvement
- Please describe about your requirements or improvement suggestions.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] smartisanyyh commented on issue #4700: 'Database topN records' doesn't work on oracle database
Posted by GitBox <gi...@apache.org>.
smartisanyyh commented on issue #4700:
URL: https://github.com/apache/skywalking/issues/4700#issuecomment-619461514
Sorry,I thought this is a common question so I open an issue ,and I want to help the others who has the same issue ,I hope they can search this page when they encountered this problem,if I fix this problem I will feedback as soon as possible
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] smartisanyyh commented on issue #4700: 'Database topN records' doesn't work on oracle database
Posted by GitBox <gi...@apache.org>.
smartisanyyh commented on issue #4700:
URL: https://github.com/apache/skywalking/issues/4700#issuecomment-618945040
I uesd arthas to watch method `org.apache.skywalking.oap.server.receiver.trace.provider.DBLatencyThresholdsAndWatcher getThreshold`
ts=2020-04-24 18:29:55; [cost=0.037739ms] result=@ArrayList[
@Object[][
@String[sql],
],
@Integer[10000],
]
It's means threshold is 10000 but I never config that ,Why is this so
and why param 'type' is sql not oracle
and I don't know what diffrent between SpanTags.DB_STATEMENT and SpanTags.DB_TYPE
There is two reason for the question
1.SpanTags.DB_STATEMENT.equals(tag.getKey())
2.thresholds.getThreshold(dbType) returned value is 10000
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] wu-sheng commented on issue #4700: 'Database topN records' doesn't work on oracle database
Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #4700:
URL: https://github.com/apache/skywalking/issues/4700#issuecomment-618976568
> 1.SpanTags.DB_STATEMENT.equals(tag.getKey())
This means, you need the SQL statement, otherwise, slow SQL is pointless.
> 2.thresholds.getThreshold(dbType) returned value is 10000
This is an open-source project, DBLatencyThresholdsAndWatcher is also open source. You could simply debug or use a unit test to verify. Don't push all questions to the community. We are not providing commercial customer service.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] smartisanyyh commented on issue #4700: 'Database topN records' doesn't work on oracle database
Posted by GitBox <gi...@apache.org>.
smartisanyyh commented on issue #4700:
URL: https://github.com/apache/skywalking/issues/4700#issuecomment-618878223
Yes ,we have a lot of sql statment cost time more than 200ms(the default threshold value)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] wu-sheng commented on issue #4700: 'Database topN records' doesn't work on oracle database
Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #4700:
URL: https://github.com/apache/skywalking/issues/4700#issuecomment-618874091
Do they reach the slow SQL threshold?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [skywalking] wu-sheng commented on issue #4700: 'Database topN records' doesn't work on oracle database
Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #4700:
URL: https://github.com/apache/skywalking/issues/4700#issuecomment-618880000
This is the slow sql check codes, you could check whether your span matches it.
```java
for (KeyStringValuePair tag : span.getTagsList()) {
if (SpanTags.DB_STATEMENT.equals(tag.getKey())) {
String sqlStatement = tag.getValue();
if (StringUtil.isEmpty(sqlStatement)) {
statement.setStatement("[No statement]/" + sourceBuilder.getDestEndpointName());
} else if (sqlStatement.length() > config.getMaxSlowSQLLength()) {
statement.setStatement(sqlStatement.substring(0, config.getMaxSlowSQLLength()));
} else {
statement.setStatement(sqlStatement);
}
} else if (SpanTags.DB_TYPE.equals(tag.getKey())) {
String dbType = tag.getValue();
DBLatencyThresholdsAndWatcher thresholds = config.getDbLatencyThresholdsAndWatcher();
int threshold = thresholds.getThreshold(dbType);
if (sourceBuilder.getLatency() > threshold) {
isSlowDBAccess = true;
}
}
}
if (isSlowDBAccess) {
slowDatabaseAccesses.add(statement);
}
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org