You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/06/27 07:50:00 UTC

[jira] [Commented] (FLINK-9665) PrometheusReporter does not properly unregister metrics

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

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

GitHub user jelmerk opened a pull request:

    https://github.com/apache/flink/pull/6211

    [FLINK-9665] PrometheusReporter does not properly unregister metrics

    ## What is the purpose of the change
    
    Prometheus metrics from canceled jobs are not always correctly cleaned up. This patch aims to remedy this
    
    ## Brief change log
    
    - always unregister childs from collectors in notifyOfRemovedMetric so that no metrics stay behind when a job gets canceled but the collector does not get unregistered
    
    ## Verifying this change
    
    I added a metricIsRemovedWhenCollectorIsNotUnregisteredYet test to PrometheusReporterTest
    
    ## Does this pull request potentially affect one of the following parts:
    
      - Dependencies (does it add or upgrade a dependency): no
      - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
      - The serializers: no
      - The runtime per-record code paths (performance sensitive): no
      - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Yarn/Mesos, ZooKeeper: no
      - The S3 file system connector: no
    
    ## Documentation
    
      - Does this pull request introduce a new feature?: no
      - If yes, how is the feature documented?: not applicable


You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jelmerk/flink FLINK_9665

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/6211.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 #6211
    
----
commit 1dc5eb1e3ee8a1a15ecb95e5084db37fe7298cf4
Author: Jelmer Kuperus <jk...@...>
Date:   2018-06-26T23:05:11Z

    [FLINK-9665] PrometheusReporter does not properly unregister metrics

----


> PrometheusReporter does not properly unregister metrics
> -------------------------------------------------------
>
>                 Key: FLINK-9665
>                 URL: https://issues.apache.org/jira/browse/FLINK-9665
>             Project: Flink
>          Issue Type: Bug
>          Components: Metrics
>    Affects Versions: 1.5.0, 1.4.2, 1.6.0
>            Reporter: Chesnay Schepler
>            Assignee: Chesnay Schepler
>            Priority: Major
>              Labels: pull-request-available
>
> The {{PrometheusReporter}} groups metrics with the same logical scope in a single {{Collector}} which are periodically polled by Prometheus.
> New metrics are added to an existing collector, and a reference count is maintained so we can eventually cleanup the {{Collector}} itself.
> For removed metrics we decrease the reference count, do not however remove the metrics that were added. As a result the collector will continue to expose metrics, as long as at least 1 metric exists with the same logical scope.
> If the collector is a {{io.prometheus.client.Gauge}} we can use the {{#remove()}} method. For histograms we will have to modify our {{HistogramSummaryProxy}} class to allow removing individual histograms.



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