forked from apache/zeppelin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ZEPPELIN-4977] Metrics and healthcheck
### What is this PR for? This PR includes: - Configurable Prometheus monitoring with endpoint (`/metrics`) - Rewrite the JMX metric endpoint - two new Healthcheck endpoints (`/health/readiness`, `/health/liveness`) and a ping endpoint (`/ping`) - some default metrics (jetty, jvm, interpreter) ### What type of PR is it? - Improvement ### What is the Jira issue? * https://issues.apache.org/jira/browse/ZEPPELIN-4977 * https://issues.apache.org/jira/browse/ZEPPELIN-4976 ### How should this be tested? * Travic-CI: https://travis-ci.com/github/Reamer/zeppelin/builds/201787227 ### Questions: * Does the licenses files need update? Yes, included in PR * Is there breaking changes for older versions? Yes, the JMX output for metrics changes * Does this needs documentation? Yes, included in PR Author: Philipp Dallig <philipp.dallig@gmail.com> Closes apache#3971 from Reamer/metrics_and_healthcheck_micro and squashes the following commits: 6dd4113 [Philipp Dallig] Add cron properties in configuration.md eed7ff5 [Philipp Dallig] Add CronJobs metrics 103241a [Philipp Dallig] Rewrite JMX metric endpoint 282865d [Philipp Dallig] Add jetty metrics 6d81060 [Philipp Dallig] Add Interpreter metrics e075751 [Philipp Dallig] Add HDFS Healthcheck 91d735b [Philipp Dallig] Add Healthchecks with Dropwizard 14038c3 [Philipp Dallig] Add micrometer for metrics
- Loading branch information
Showing
22 changed files
with
653 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
layout: page | ||
title: "Apache Zeppelin Monitoring" | ||
description: "This page shows you the monitoring options you have in Apache Zeppelin" | ||
--- | ||
<!-- | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
--> | ||
# Apache Zeppelin Monitoring | ||
|
||
<div id="toc"></div> | ||
|
||
## Monitoring Options | ||
|
||
Apache Zeppelin is using [Micrometer](https://micrometer.io/) - a vendor-neutral application metrics facade. | ||
|
||
### Prometheus Monitoring | ||
|
||
[Prometheus](https://prometheus.io/) is the leading monitoring solution for [Kubernetes](https://kubernetes.io/). The Prometheus endpoint can be activated with the configuration property `zeppelin.metric.enable.prometheus`. The metrics are accessible via the unauthenticated endpoint `/metrics`. | ||
|
||
### JMX Monitoring | ||
|
||
[JMX](https://en.wikipedia.org/wiki/Java_Management_Extensions) is a general solution for monitoring Java applications. JMX can be activated with the configuration property `zeppelin.jmx.enable`. The default port 9996 can be changed with the configuration property `zeppelin.jmx.port`. | ||
|
||
## Healthcheck Probe | ||
|
||
Apache Zeppelin has two healthcheck related unauthenticated endpoints (`/health/readiness`, `/health/liveness`) that could be used for proxy and/or cloud setups. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
zeppelin-server/src/main/java/org/apache/zeppelin/metric/JVMInfoBinder.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.zeppelin.metric; | ||
|
||
import io.micrometer.core.instrument.Counter; | ||
import io.micrometer.core.instrument.MeterRegistry; | ||
import io.micrometer.core.instrument.binder.MeterBinder; | ||
|
||
public class JVMInfoBinder implements MeterBinder { | ||
private static final String UNKNOWN = "unknown"; | ||
|
||
@Override | ||
public void bindTo(MeterRegistry registry) { | ||
Counter.builder("jvm.info") | ||
.description("JVM version info") | ||
.tags("version", System.getProperty("java.runtime.version", UNKNOWN), | ||
"vendor", System.getProperty("java.vm.vendor", UNKNOWN), | ||
"runtime", System.getProperty("java.runtime.name", UNKNOWN)) | ||
.register(registry) | ||
.increment(); | ||
} | ||
} |
Oops, something went wrong.