Github user stoader commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19775#discussion_r167357250
  
    --- Diff: 
core/src/main/scala/org/apache/spark/metrics/sink/PrometheusSink.scala ---
    @@ -0,0 +1,160 @@
    +/*
    + * 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.
    + */
    +
    +package org.apache.spark.metrics.sink
    +
    +import java.net.URI
    +import java.util
    +import java.util.Properties
    +import java.util.concurrent.TimeUnit
    +
    +import scala.collection.JavaConverters._
    +import scala.util.Try
    +
    +import com.codahale.metrics._
    +import io.prometheus.client.CollectorRegistry
    +import io.prometheus.client.dropwizard.DropwizardExports
    +
    +import org.apache.spark.{SecurityManager, SparkConf, SparkContext, 
SparkEnv}
    +import org.apache.spark.internal.Logging
    +import org.apache.spark.internal.config.METRICS_NAMESPACE
    +import org.apache.spark.metrics.MetricsSystem
    +import 
org.apache.spark.metrics.prometheus.client.exporter.PushGatewayWithTimestamp
    +
    +
    +private[spark] class PrometheusSink(
    +                                     val property: Properties,
    +                                     val registry: MetricRegistry,
    +                                     securityMgr: SecurityManager)
    --- End diff --
    
    The parameter list for a `Sink` is imposed by`MetricsSystem` which 
instantiates the configured sinks (see 
https://github.com/apache/spark/blob/master/core/src/main/scala/org/apache/spark/metrics/MetricsSystem.scala#L199).
 `PrometheusSink` doesn't need `SecurityManager` this is why `securityMgr` is 
not used.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to