Spark Operator supports different ways to configure the behavior:
To enable hot properties loading, update the helm chart values file with
operatorConfiguration: spark-operator.properties: |+ spark.operator.dynamic.config.enabled=true # ... all other config overides... dynamicConfig: create: true
Spark operator, following Apache Spark, has a configurable metrics system based on the Dropwizard Metrics Library. 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
Spark Operator collects JVM metrics via Codahale JVM 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.latency.nanos | Histograms | Measures the statistical distribution of HTTP response latency from the Kubernetes API Server |
kubernetes.client.http.response. | Meter | Tracking the rates of HTTP response based on response code from the Kubernetes API Server |
kubernetes.client.http.request. | 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.. | Meter | Tracking the rates of HTTP request for a combination of one Kubernetes resource and one http method |
kubernetes.client... | Meter | Tracking the rates of HTTP request for a combination of one namespace-scoped Kubernetes resource and one http method |
In this section, we will show you how to forward Spark Operator metrics to Prometheus.
build-tools/helm/spark-kubernetes-operator/values.yaml
:metrics.properties:|+ spark.metrics.conf.operator.sink.prometheus.class=org.apache.spark.kubernetes.operator.metrics. sink.PrometheusPullModelSink
helm install spark-kubernetes-operator -f build-tools/helm/spark-kubernetes-operator/values.yaml build-tools/helm/spark-kubernetes-operator/
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts helm install prometheus prometheus-community/prometheus
kubectl get pods -l app.kubernetes.io/name=spark-kubernetes-operator NAME READY STATUS RESTARTS AGE spark-kubernetes-operator-598cb5d569-bvvd2 1/1 Running 0 24m kubectl annotate pods spark-kubernetes-operator-598cb5d569-bvvd2 prometheus.io/scrape=true kubectl annotate pods spark-kubernetes-operator-598cb5d569-bvvd2 prometheus.io/path=/prometheus kubectl annotate pods spark-kubernetes-operator-598cb5d569-bvvd2 prometheus.io/port=19090
kubectl get pods | grep "prometheus-server" prometheus-server-654bc74fc9-8hgkb 2/2 Running 0 59m kubectl port-forward --address 0.0.0.0 pod/prometheus-server-654bc74fc9-8hgkb 8080:9090
open your browser with address localhost:8080
. Click on Status Targets tab, you should be able to find target as below.