GitHub user mbode opened a pull request:
https://github.com/apache/flink/pull/4586
[FLINK-7502] [metrics] Improve PrometheusReporter
## What is the purpose of the change
*This pull request addresses several issues that came up when testing
PrometheusReporter in a YARN environment. Most significantly, it is now
possible to specify a port range similarly to how it is done for JmxReporter.*
## Brief change log
* Do not throw exception when same metric is added twice
* Add possibility to configure port range
* Bump prometheus.version 0.0.21 -> 0.0.26
* Use simpleclient_httpserver instead of nanohttpd
## Verifying this change
* The changed code is covered by existing test `PrometheusReporterTest`,
test cases for new functionality were added.
* Test building the jar and adding it to Flink lib directory. Then
configure Prometheus reporter and check endpoints in configured port range for
metrics. In particular, test case where JobManager and one TaskManager are
co-located â there now should be separately reported metrics endpoints.
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): **yes**, upgrade
prometheus client
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: **yes**, `PrometheusReporter` is `@PublicEvolving`, but it
has not been released as of now.
- The serializers: **no**
- The runtime per-record code paths (performance sensitive): **don't
know**
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Yarn/Mesos, ZooKeeper: **don't know**
## Documentation
- Does this pull request introduce a new feature? **yes**, configurable
port range
- If yes, how is the feature documented? **docs**
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/mbode/flink prometheus_reporter_improvements
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/4586.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #4586
----
commit ef4e1aa79db1dca361f2a7e274e2355008881cfe
Author: Maximilian Bode <[email protected]>
Date: 2017-08-24T13:59:24Z
[FLINK-7502] Improve PrometheusReporter
* Do not throw exception when same metric is added twice
* Add possibility to configure port range
* Bump prometheus.version 0.0.21 -> 0.0.26
* Use simpleclient_httpserver instead of nanohttpd
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---