You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Chesnay Schepler (JIRA)" <ji...@apache.org> on 2018/05/10 11:53:00 UTC

[jira] [Closed] (FLINK-8284) Explicitly mention port conflicts in reporter docs

     [ https://issues.apache.org/jira/browse/FLINK-8284?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Chesnay Schepler closed FLINK-8284.
-----------------------------------
       Resolution: Fixed
    Fix Version/s: 1.4.3
                   1.5.0

master: 1bff3660c16e9fd114c4f3813111a19542f8ac83
1.5: 3c1e87496446e1374bc4dc39896b9496f8dc4703
1.4: 910d9d44c959d35a51379303f26df493b4e4c03d

> Explicitly mention port conflicts in reporter docs
> --------------------------------------------------
>
>                 Key: FLINK-8284
>                 URL: https://issues.apache.org/jira/browse/FLINK-8284
>             Project: Flink
>          Issue Type: Improvement
>          Components: Documentation, Metrics
>    Affects Versions: 1.4.0, 1.5.0
>         Environment: Linux/CentOS 7
>            Reporter: Julio Biason
>            Assignee: Chesnay Schepler
>            Priority: Major
>             Fix For: 1.5.0, 1.4.3
>
>
> Following the documentation, we changed our filter that removes events with missing fields to a RichFilterFunction, so we can capture metrics about such events:
> {code:scala}
> public class MissingClientFilter extends RichFilterFunction<LineData> {
> 	private transient Counter counter;
> 	@Override
> 	public void open(Configuration config) {
> 		this.counter = getRuntimeContext()
> 			.getMetricGroup()
> 			.addGroup("events")
> 			.counter("missingClient");
> 	}
> 	@Override
> 	public boolean filter(LineData line) {
> 		String client = line.get("client").toString();
> 		boolean missing = client.trim().equals("");
> 		if (!missing) {
> 			this.count();
> 		}
> 		return !missing;
> 	}
> 	private void count() {
> 		if (this.counter != null) {
> 			this.counter.inc();
> 		}
> 	}
> }
> {code}
> We also added Prometheus as our reporter:
> {noformat}
> metrics.reporters: prom
> metrics.reporter.prom.port: 9105
> metrics.reporter.prom.class: org.apache.flink.metrics.prometheus.PrometheusReporter
> {noformat}
> The problem is accessing port 9105 display all Flink metrics, but not ours.



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