I’ve used the following simple script to capture Flink metrics by running:
        python -u ./statsd_server.py 9020 > statsd_server.log


>>> flink-conf.yaml
metrics.reporters: statsd_reporter
metrics.reporter.statsd_reporter.class: 
org.apache.flink.metrics.statsd.StatsDReporter
metrics.reporter.statsd_reporter.host: <JobManager IP>
metrics.reporter.statsd_reporter.port: 9020


>>> statsd_server.py
#!/usr/bin/env python

import socket
import sys
import time

if len(sys.argv) < 2:
  print('Usage {} <port>'.format(sys.argv[0]))
  sys.exit(-1)

UDP_IP = ''
UDP_PORT = int(sys.argv[1])

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind((UDP_IP, UDP_PORT))

while True:
    data, addr = sock.recvfrom(4096)
    print('{:.6f} {}'.format(time.time(), data))


> On Nov 5, 2017, at 4:40 AM, Jürgen Thomann <juergen.thom...@innogames.com> 
> wrote:
> 
> Can you use wget (curl will work as well)? You can find the taskmanagers with 
> wget -O - http://localhost:8081/taskmanagers
> and wget -O - http://localhost:8081/taskmanagers/<id from previous request> 
> to see detailed jvm
> memory stats. localhost:8081 is in my example the jobmanager.
> 
> 
> On 04.11.2017 16:19, AndreaKinn wrote:
>> Anyway, If I understood how system metrics works (the results seems to be
>> showed in browser) I can't use it because my cluster is accessible only with
>> terminal via ssh
>> 
>> 
>> 
>> --
>> Sent from: 
>> http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/

Reply via email to