Skip to content

Commit c9a198d

Browse files
authored
Merge pull request apache#4 from jahstreet/feature/ui-links-to-grafana
Fixed formatting generated links.
2 parents 6c05808 + 6afbc48 commit c9a198d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

server/src/main/scala/org/apache/livy/utils/SparkKubernetesApp.scala

+8-8
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,9 @@ class KubernetesAppReport(driver: Option[Pod], executors: Seq[Pod],
340340
val timeRange = livyConf.get(LivyConf.KUBERNETES_GRAFANA_TIME_RANGE)
341341
val lokiDatasource = livyConf.get(LivyConf.KUBERNETES_GRAFANA_LOKI_DATASOURCE)
342342
return Some(
343-
s"""$grafanaUrl/explore?left=["now-$timeRange","now","$lokiDatasource",
344-
|{"expr":"{job%3D\"$namespace%2F$driverPodName\"}"},
345-
|{"ui":[true,true,true,"none"]}]""".stripMargin
343+
s"""$grafanaUrl/explore?left=["now-$timeRange","now","$lokiDatasource",""" +
344+
s"""{"expr":"{job%3D\"$namespace%2F$driverPodName\"}"},""" +
345+
s"""{"ui":[true,true,true,"none"]}]"""
346346
)
347347
}
348348
}
@@ -361,11 +361,11 @@ class KubernetesAppReport(driver: Option[Pod], executors: Seq[Pod],
361361
val labels = e.getMetadata.getLabels
362362
val sparkAppTag = labels.get(SPARK_APP_TAG_LABEL)
363363
val sparkExecId = labels.get(SPARK_EXEC_ID_LABEL)
364-
s"""executor-$sparkExecId#
365-
|$grafanaUrl/explore?left=["now-$timeRange","now","$lokiDatasource",
366-
|{"expr":"{$sparkAppTagLogLabel%3D\"$sparkAppTag\",
367-
|$sparkExecIdLogLabel%3D\"$sparkExecId\"}"},
368-
|{"ui":[true,true,true,"none"]}]""".stripMargin
364+
s"executor-$sparkExecId#" +
365+
s"""$grafanaUrl/explore?left=["now-$timeRange","now","$lokiDatasource",""" +
366+
s"""{"expr":"{$sparkAppTagLogLabel%3D\"$sparkAppTag\",""" +
367+
s"""$sparkExecIdLogLabel%3D\"$sparkExecId\"}"},""" +
368+
s"""{"ui":[true,true,true,"none"]}]"""
369369
})
370370
if (urls.nonEmpty) return Some(urls.mkString(";"))
371371
}

0 commit comments

Comments
 (0)