Skip to content

Commit ebee7eb

Browse files
authored
Add grafana spark dashboard link (#114)
1 parent 2cf020d commit ebee7eb

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

service_configuration_lib/spark_config.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,6 +1255,16 @@ def compute_requested_memory_overhead(spark_opts: Mapping[str, str], executor_me
12551255
)
12561256

12571257

1258+
def get_grafana_url(spark_conf: Mapping[str, str]) -> str:
1259+
return (
1260+
'https://grafana.yelpcorp.com/d/b8f79180-bea8-4001-9d4a-94978b5a20b6/spark-on-paasta-job-status?orgId=1&'
1261+
f"var-paasta_cluster={spark_conf['spark.executorEnv.PAASTA_CLUSTER']}&"
1262+
f"var-service={spark_conf['spark.executorEnv.PAASTA_SERVICE']}&"
1263+
f"var-instance={spark_conf['spark.executorEnv.PAASTA_INSTANCE']}&"
1264+
'var-pod_name_spark=All'
1265+
)
1266+
1267+
12581268
def get_signalfx_url(spark_conf: Mapping[str, str]) -> str:
12591269
return (
12601270
'https://app.signalfx.com/#/dashboard/FOjL2yRAcAA?density=4'

tests/spark_config_test.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,6 +1515,21 @@ def test_parse_memory_string(memory_string, expected_output):
15151515
assert spark_config.parse_memory_string(memory_string) == expected_output
15161516

15171517

1518+
def test_get_grafana_url():
1519+
spark_conf = {
1520+
'spark.executorEnv.PAASTA_CLUSTER': 'test-cluster',
1521+
'spark.executorEnv.PAASTA_SERVICE': 'test-service',
1522+
'spark.executorEnv.PAASTA_INSTANCE': 'test-instance',
1523+
}
1524+
assert spark_config.get_grafana_url(spark_conf) == (
1525+
'https://grafana.yelpcorp.com/d/b8f79180-bea8-4001-9d4a-94978b5a20b6/spark-on-paasta-job-status?orgId=1&'
1526+
'var-paasta_cluster=test-cluster&'
1527+
'var-service=test-service&'
1528+
'var-instance=test-instance&'
1529+
'var-pod_name_spark=All'
1530+
)
1531+
1532+
15181533
def test_get_signalfx_url():
15191534
spark_conf = {
15201535
'spark.executorEnv.PAASTA_CLUSTER': 'test-cluster',

0 commit comments

Comments
 (0)