-
Notifications
You must be signed in to change notification settings - Fork 70
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
[sc] Don't send sc. WARNING if too many metrics #73
Conversation
529d6a5
to
8b9de2d
Compare
Tell me if I'm missing something, but I think all we need to do is to remove this line: https://github.com/DataDog/jmxfetch/blob/master/src/main/java/org/datadog/jmxfetch/App.java#L199 What do you think? 😃 |
Indeed, that would have been faster but...
Oh and thanks a lot for your review btw. :) |
:) sometimes removing code is better. But yeah i agree, we still want the warning to be displayed in the info page (and sent as other agent check warnings in the infra overview if possible). |
8b9de2d
to
1e4e269
Compare
|
||
reportStatus(appConfig, reporter, instance, metrics.size(), instanceMessage, instanceStatus); | ||
this.reportStatus(appConfig, reporter, instance, metrics.size(), instanceMessage, instanceStatus); | ||
this.sendServiceCheck(reporter, instance, instanceMessage, scStatus); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we simplify (factorize) this block with something like :
while (it.hasNext()) {
String instanceStatus = Status.STATUS_OK;
String serviceCheckStatus = Status.STATUS_OK;
String message = null;
try {
// Instantiate instanceStatus, serviceCheckStatus, message
doSomething();
} catch (Exception) {
// Modify instanceStatus, serviceCheckStatus, message
handleException();
}
// Factorize instance status and service check report
this.reportStatus(appConfig, reporter, instance, metrics.size(), instanceMessage, instanceStatus);
this.sendServiceCheck(reporter, instance, instanceMessage, scStatus);
}
?
Thanks for tackling the issue @elafarge. While I think decoupling service checks and instance status is the right thing to do, I am a bit worried about the resulting code duplication. I added some suggestion to refactorize some code paths 🎨, please let me know what you think |
We were sending a service check warning for integrations with too many metrics which is not the behaviour we'd like to have. Even though there are too many metrics, the `can_connect` service check should be green. This was a good oppurtunity for a slight refactoring of `App.java` where service checks and statuses in the `datadog-agent info` page have been made completely independant.
1e4e269
to
57f067f
Compare
Thank you so much for you enlightening suggestions @yannmh . I took them into account and updated the PR. Let me know what you think about it ;-) |
Thanks @elafarge ! |
[sc] Don't send sc. WARNING if too many metrics
Do not send service check warnings on metric limit violation. See [#73](DataDog/jmxfetch#73). Update CHANGELOG to reflect changes.
Do not send service check warnings on metric limit violation. See [#73](DataDog/jmxfetch#73). Update CHANGELOG to reflect changes.
Do not send service check warnings on metric limit violation. See [DataDog#73](DataDog/jmxfetch#73). Update CHANGELOG to reflect changes.
We were sending a service check warning for integrations with too many
metrics which is not the behaviour we'd like to have. Even though there
are too many metrics, the
can_connect
service check should be green.