使用Prometheus監控Spark任務

2021-10-08 19:37:22 字數 2300 閱讀 1100

目前spark支援graphite打點,但是graphite缺省會為每個打點生成對應的檔案,直接只有兩個點資料,graphite生成的檔案也有200多k,對graphite造成很大的壓力。所以考慮使用prometheus來代替graphite。

prometheus的打點預設是pull模式,和graphite不同,而spark3.0 新加的打點方式也是k8s友好的。所以還是考慮 使用prometheus結合graphite exporter 的方式。:-

match

:name

labels

:: $1

qty: $2

-match

:'*.*.executor.filesystem.*.*'

name

labels

:: $1

executor_id

: $2

fs_type

: $3

qty: $4

-match

:'*.*.jvm.*.*'

name

labels

:: $1

executor_id

: $2

mem_type

: $3

qty: $4

-match

:'*.*.executormetrics.*'

name

labels

:: $1

executor_id

: $2

mem_type

: $3

-match

:'*.*.executor.jvmgctime.count'

name

labels

:: $1

executor_id

: $2

-match

:'*.*.jvm.pools.*.*'

name

labels

:: $1

executor_id

: $2

mem_type

: $3

qty: $4

-match

:'*.*.externalshuffle.shuffle-client.*'

name

labels

:: $1

executor_id

: $2

qty: $3

-match

:'*.*.executor.*.count'

name

labels

:: $1

executor_id

: $2

qty: $3

-match

:'*.*.executor.threadpool.*'

name

labels

:: $1

executor_id

: $2

qty: $3

-match

:'*.*.blockmanager.*.*'

name

labels

:: $1

executor_id

: $2

type

: $3

qty: $4

-match

:'*.*.dagscheduler.*.*'

name

labels

:: $1

executor_id

: $2

type

: $3

qty: $4

-match

:'*.*.codegenerator.*.*'

name

labels

:: $1

executor_id

: $2

type

: $3

qty: $4

-match

:'*.*.hiveexternalcatalog.*.*'

name

labels

:: $1

executor_id

: $2

type

: $3

qty: $4

-match

:'*.*.*.streamingmetrics.*.*'

name

labels

:: $1

executor_id

: $2

: $3

type

: $4

qty: $5

spark配置仍然採用graphite打點配置,只需要將埠改為 9109即可

K8s部署prometheus監控K8s細節

prometheus 一些配置檔案可以再github上找到。部署 root kube prometheus manifests 目錄下所有檔案 部署 root kube prometheus manifests setup 目錄下所有檔案 要注意的是自己要建立乙個工作空間 如果報錯執行下面語句 部署...

Prometheus 監控節點

tar xf node exporter 0.18.1.linux amd64.tar.gz cd node exporter 0.18.1.linux amd64 cp node exporter usr local bin 檢視版本 root server03 media prometheus ...

prometheus監控exporter部署

harbor exporter docker run d p 9107 9107 restart always network harbor harbor add host mec hub.21cn.com x.x.x.x e harbor username admin e harbor passw...