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

feat: add health check endpoint #3501

Merged
merged 23 commits into from
Oct 16, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
fd22534
feat: add healthcheck endpoint
vcrfxia Oct 7, 2019
6d10311
feat: switch to configexception
vcrfxia Oct 8, 2019
5abf820
feat: make healthcheck interval configurable
vcrfxia Oct 8, 2019
4cebe97
feat: update healthcheck response detail to be a class
vcrfxia Oct 8, 2019
34441bd
feat: healthcheck should not be authenticated
vcrfxia Oct 8, 2019
89297e6
Merge branch 'master' into healthcheck-endpoint
vcrfxia Oct 9, 2019
47818cf
refactor: split out KsqlTarget helper methods
vcrfxia Oct 9, 2019
d619f74
fix: use ServerInternalKsqlClient to get around auth issues
vcrfxia Oct 9, 2019
612f0c0
fix: make Check an interface
vcrfxia Oct 10, 2019
f795d34
fix: move cached response expiry into ResponseCache
vcrfxia Oct 10, 2019
5fa0002
docs: add java doc to ServerInternalKsqlClient
vcrfxia Oct 10, 2019
e8e0647
refactor: make health check two words
vcrfxia Oct 10, 2019
fc0bbba
docs: add docs for new endpoint
vcrfxia Oct 10, 2019
cae31e6
docs: jim's feedback
vcrfxia Oct 10, 2019
548ca3c
refactor: switch to Guava's cache implementation
vcrfxia Oct 14, 2019
3a754bd
fix: sergio's feedback
vcrfxia Oct 14, 2019
ef0797f
fix: checkstyle
vcrfxia Oct 14, 2019
2611061
fix: fix bug in getting entity from response. add integration test
vcrfxia Oct 15, 2019
6d2103b
test: vinoth's feedback
vcrfxia Oct 15, 2019
a678d9e
refactor: switch to LoadingCache
vcrfxia Oct 15, 2019
01cf409
style: checkstyle
vcrfxia Oct 15, 2019
8b176f3
fix: findbugs
vcrfxia Oct 15, 2019
0db13de
fix: make check names public so clients don't have to hardcode
vcrfxia Oct 16, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: make healthcheck interval configurable
  • Loading branch information
vcrfxia committed Oct 8, 2019
commit 5abf8204d1f7fa7192b6a65b1a6e9d519b9c7290
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,12 @@ public class KsqlRestConfig extends RestConfig {
"Whether or not to set KsqlUncaughtExceptionHandler as the UncaughtExceptionHandler "
+ "for all threads in the application (this can be overridden). Default is false.";

public static final String KSQL_HEALTHCHECK_INTERVAL_MS_CONFIG =
KSQL_CONFIG_PREFIX + "healthcheck.interval.ms";
private static final String KSQL_HEALTHCHECK_INTERVAL_MS_DOC =
"Minimum time between consecutive healthcheck evaluations. Healthcheck queries before "
+ "the interval has elapsed will receive cached responses.";

private static final ConfigDef CONFIG_DEF;

static {
Expand Down Expand Up @@ -102,14 +108,20 @@ public class KsqlRestConfig extends RestConfig {
KSQL_SERVER_PRECONDITIONS,
Type.LIST,
"",
Importance.LOW,
KSQL_SERVER_PRECONDITIONS_DOC
Importance.LOW,
KSQL_SERVER_PRECONDITIONS_DOC
).define(
KSQL_SERVER_ENABLE_UNCAUGHT_EXCEPTION_HANDLER,
ConfigDef.Type.BOOLEAN,
false,
Importance.LOW,
KSQL_SERVER_UNCAUGHT_EXCEPTION_HANDLER_DOC
).define(
KSQL_HEALTHCHECK_INTERVAL_MS_CONFIG,
Type.LONG,
5000L,
Importance.LOW,
KSQL_HEALTHCHECK_INTERVAL_MS_DOC
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public static HealthcheckResource create(
) {
return new HealthcheckResource(
new HealthcheckAgent(serviceContext, restConfig),
Duration.ofSeconds(15), // TODO: fetch from config
Duration.ofMillis(restConfig.getLong(KsqlRestConfig.KSQL_HEALTHCHECK_INTERVAL_MS_CONFIG)),
System::currentTimeMillis
);
}
Expand Down