[ 
https://issues.apache.org/jira/browse/FLINK-9703?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16657772#comment-16657772
 ] 

ASF GitHub Bot commented on FLINK-9703:
---------------------------------------

GJL commented on a change in pull request #6288: [FLINK-9703] [flink-mesos] 
Expose Prometheus port for TM through Mesos
URL: https://github.com/apache/flink/pull/6288#discussion_r226262274
 
 

 ##########
 File path: 
flink-mesos/src/main/java/org/apache/flink/mesos/runtime/clusterframework/LaunchableMesosWorker.java
 ##########
 @@ -332,6 +334,27 @@ public String toString() {
                return taskInfo.build();
        }
 
+       /**
+        * Get the 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
+        * @param config
+        */
+       static Set<String> extractPortKeys(Configuration config) {
+               LinkedHashSet<String> tmPortKeys = new 
LinkedHashSet<>(Arrays.asList(TM_PORT_KEYS));
+
+               if (config.containsKey(PORT_ASSIGNMENT_KEY)) {
+                       String portAssignments = 
config.getString(PORT_ASSIGNMENT_KEY, "");
+                       Arrays.stream(portAssignments.split(","))
+                               .map(String::trim)
+                               .peek(key -> LOG.debug("Adding port key " + key 
+ " to mesos request"))
 
 Review comment:
   Slf4j placeholders should be preferred to avoid String concatenation, i.e., 
`LOG.debug("Adding port key {} to mesos request", key)`

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> Mesos does not expose TM Prometheus port
> ----------------------------------------
>
>                 Key: FLINK-9703
>                 URL: https://issues.apache.org/jira/browse/FLINK-9703
>             Project: Flink
>          Issue Type: Bug
>          Components: Mesos
>            Reporter: Rune Skou Larsen
>            Assignee: Rune Skou Larsen
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.6.0
>
>
> LaunchableMesosWorker makes Mesos expose these ports for a Task Manager:
> {{private static final String[] TM_PORT_KEYS = {}}
> {{ "taskmanager.rpc.port",}}
> {{ "taskmanager.data.port"};}}
> But when running Prometheus Exporter on a TM, another port needs to be 
> exposed to make Flink's Prometheos endpoint externally scrapable by the 
> Prometheus server. By default this is port 9249, but it is configurable 
> according to:
> [https://ci.apache.org/projects/flink/flink-docs-release-1.6/monitoring/metrics.html#prometheus-orgapacheflinkmetricsprometheusprometheusreporter]
>  
> My plan is to make a PR, that just adds another config option for mesos, to 
> enable custom ports to be exposed in the provisioned TMs.
> I considered carrying parts of the Metrics config into the Mesos code to 
> automatically map metrics ports in mesos. But making such a "shortcut" 
> between Flink's metrics and mesos modules would probably need some sort of 
> integration testing, so I prefer the simple solution of just adding another 
> Mesos config option. But comments are welcome.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to