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

    https://github.com/apache/flink/pull/6288#discussion_r201943310
  
    --- Diff: 
flink-mesos/src/main/java/org/apache/flink/mesos/runtime/clusterframework/LaunchableMesosWorker.java
 ---
    @@ -332,6 +334,22 @@ public String toString() {
                return taskInfo.build();
        }
     
    +   /**
    +    * Get port keys representing the TM's configured endpoints. This 
includes mandatory TM endpoints such as
    +    * data and rpc as well as optionally configured endpoints for services 
such as prometheus reporter
    +    *
    +    * @return A deterministicly ordered Set of port keys to expose from 
the TM container
    +    */
    +   private Set<String> getPortKeys() {
    +           LinkedHashSet<String> tmPortKeys = new 
LinkedHashSet<>(Arrays.asList(TM_PORT_KEYS));
    --- End diff --
    
    > So what we are doing is scanning the taskmanager config for port config 
options, gather the keys, and later these are overridden by mesos with some 
port?
    
    Yes.
    
    > In case of the PrometheusReporter this would imply that prometheus is 
always started after 
    > the TM, as we can't determine the port beforehand. Is that correct?
    
    No. Prometheus supports dynamicly reloading it's scrape configuration. So 
the other part of the monitoring solution is our Prometheus script, which 
periodically querries mesos to maintain an up-to-date list of active TM 
prometheus ports to scrape from. We're working with Mesosphere to open source 
this Prometheus scripting in DC/OS, but before that makes sense, we need Flink 
to let Mesos assign the scrape port to the TM container - hence this PR, which 
I hope will be quickly merged.


---

Reply via email to