jiangzho commented on code in PR #2:
URL: 
https://github.com/apache/spark-kubernetes-operator/pull/2#discussion_r1552634431


##########
spark-operator-docs/metrics_logging.md:
##########
@@ -0,0 +1,110 @@
+<!--
+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.
+-->
+
+# Metrics
+
+Spark operator,
+following [Apache 
Spark](https://spark.apache.org/docs/latest/monitoring.html#metrics),
+has a configurable metrics system based on
+the [Dropwizard Metrics Library](https://metrics.dropwizard.io/4.2.0/). Note 
that Spark Operator 

Review Comment:
   updated. as this only apply to the operator, we used the version that's 
align with Spark dependency



##########
spark-operator-docs/metrics_logging.md:
##########
@@ -0,0 +1,110 @@
+<!--
+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.
+-->
+
+# Metrics
+
+Spark operator,
+following [Apache 
Spark](https://spark.apache.org/docs/latest/monitoring.html#metrics),
+has a configurable metrics system based on
+the [Dropwizard Metrics Library](https://metrics.dropwizard.io/4.2.0/). Note 
that Spark Operator 
+does not have Spark UI, MetricsServlet 
+and PrometheusServlet from org.apache.spark.metrics.sink package are not 
supported. If you are 
+interested in Prometheus metrics exporting, please take a look at below 
section `Forward Metrics to Prometheus`
+
+## JVM Metrics
+
+Spark Operator collects JVM metrics
+via [Codahale JVM 
Metrics](https://javadoc.io/doc/com.codahale.metrics/metrics-jvm/latest/index.html)
+
+- BufferPoolMetricSet
+- FileDescriptorRatioGauge
+- GarbageCollectorMetricSet
+- MemoryUsageGaugeSet
+- ThreadStatesGaugeSet
+
+## Kubernetes Client Metrics
+
+| Metrics Name                                              | Type       | 
Description                                                                     
                                         |
+|-----------------------------------------------------------|------------|--------------------------------------------------------------------------------------------------------------------------|
+| kubernetes.client.http.request                            | Meter      | 
Tracking the rates of HTTP request sent to the Kubernetes API Server            
                                         |
+| kubernetes.client.http.response                           | Meter      | 
Tracking the rates of HTTP response from the Kubernetes API Server              
                                         |
+| kubernetes.client.http.response.failed                    | Meter      | 
Tracking the rates of HTTP requests which have no response from the Kubernetes 
API Server                                |
+| kubernetes.client.http.response.failed                    | Meter      | 
Tracking the rates of HTTP requests which have no response from the Kubernetes 
API Server                                |
+| kubernetes.client.http.response.failed                    | Meter      | 
Tracking the rates of HTTP requests which have no response from the Kubernetes 
API Server                                |
+| kubernetes.client.http.response.latency.nanos             | Histograms | 
Measures the statistical distribution of HTTP response latency from the 
Kubernetes API Server                            |
+| kubernetes.client.http.response.<ResponseCode>            | Meter      | 
Tracking the rates of HTTP response based on response code from the Kubernetes 
API Server                                |
+| kubernetes.client.http.request.<RequestMethod>            | Meter      | 
Tracking the rates of HTTP request based type of method to the Kubernetes API 
Server                                     |
+| kubernetes.client.http.response.1xx                       | Meter      | 
Tracking the rates of HTTP Code 1xx responses (informational) received from the 
Kubernetes API Server per response code. |
+| kubernetes.client.http.response.2xx                       | Meter      | 
Tracking the rates of HTTP Code 2xx responses (success) received from the 
Kubernetes API Server per response code.       |
+| kubernetes.client.http.response.3xx                       | Meter      | 
Tracking the rates of HTTP Code 3xx responses (redirection) received from the 
Kubernetes API Server per response code.   |
+| kubernetes.client.http.response.4xx                       | Meter      | 
Tracking the rates of HTTP Code 4xx responses (client error) received from the 
Kubernetes API Server per response code.  |
+| kubernetes.client.http.response.5xx                       | Meter      | 
Tracking the rates of HTTP Code 5xx responses (server error) received from the 
Kubernetes API Server per response code.  |
+| kubernetes.client.<ResourceName>.<Method>                 | Meter      | 
Tracking the rates of HTTP request for a combination of one Kubernetes resource 
and one http method                      |
+| kubernetes.client.<NamespaceName>.<ResourceName>.<Method> | Meter      | 
Tracking the rates of HTTP request for a combination of one namespace-scoped 
Kubernetes resource and one http method     |
+
+## Forward Metrics to Prometheus
+
+In this section, we will show you how to forward spark operator metrics
+to [Prometheus](https://prometheus.io).
+
+* Modify the
+  build-tools/helm/spark-kubernetes-operator/values.yaml file' s metrics 
properties section:
+
+```properties
+metrics.properties:|+
+  
spark.metrics.conf.operator.sink.mosaic.class=org.apache.spark.kubernetes.operator.metrics.sink.PrometheusPullModelSink

Review Comment:
   fixed typo



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to