You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@flink.apache.org by anaray <an...@gmail.com> on 2020/01/22 21:11:59 UTC

Custom label for Prometheus Exporter

Hi flink team,

Is there a way to add a custom label to flink metrics when using Prometheus
Exporter ? I need to add a label=<jobname> for the JobManager metrics. As of
now I see only host label 

for example

*flink_jobmanager_Status_JVM_Memory_Direct_Count{host="localhost",} 18.0*

This is not of big help if I deploy the service in k8s or swarm. I would
like associate a jobmanager with a jobname atleast in a JOB mode deployment.

Please let me know if there is any way to add a custom label by
cinfiguration?

Thanks,
anaray



--
Sent from: http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/

Re: Custom label for Prometheus Exporter

Posted by Austin Cawley-Edwards <au...@gmail.com>.
Following up, we deploy to K8s with one service per job manager and task
manager for metrics, and we add job-identifying labels to those. We also
use the Prometheus Operator which makes it easy to add those labels as
dimensions when scraping.

Best,
Austin

On Wed, Jan 22, 2020 at 7:21 PM Austin Cawley-Edwards <
austin.cawley@gmail.com> wrote:

> Hey Anaray,
>
> Have you checked out the “scope” configuration?[1]
>
> Best,
> Austin
>
>
> [1]:
>
> https://ci.apache.org/projects/flink/flink-docs-stable/monitoring/metrics.html#scope
>
> On Wed, Jan 22, 2020 at 4:09 PM anaray <an...@gmail.com> wrote:
>
>> Hi flink team,
>>
>> Is there a way to add a custom label to flink metrics when using
>> Prometheus
>> Exporter ? I need to add a label=<jobname> for the JobManager metrics. As
>> of
>> now I see only host label
>>
>> for example
>>
>> *flink_jobmanager_Status_JVM_Memory_Direct_Count{host="localhost",} 18.0*
>>
>> This is not of big help if I deploy the service in k8s or swarm. I would
>> like associate a jobmanager with a jobname atleast in a JOB mode
>> deployment.
>>
>> Please let me know if there is any way to add a custom label by
>> cinfiguration?
>>
>> Thanks,
>> anaray
>>
>>
>>
>> --
>> Sent from:
>> http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/
>>
>

Re: Custom label for Prometheus Exporter

Posted by Austin Cawley-Edwards <au...@gmail.com>.
Hey Anaray,

Have you checked out the “scope” configuration?[1]

Best,
Austin


[1]:
https://ci.apache.org/projects/flink/flink-docs-stable/monitoring/metrics.html#scope

On Wed, Jan 22, 2020 at 4:09 PM anaray <an...@gmail.com> wrote:

> Hi flink team,
>
> Is there a way to add a custom label to flink metrics when using Prometheus
> Exporter ? I need to add a label=<jobname> for the JobManager metrics. As
> of
> now I see only host label
>
> for example
>
> *flink_jobmanager_Status_JVM_Memory_Direct_Count{host="localhost",} 18.0*
>
> This is not of big help if I deploy the service in k8s or swarm. I would
> like associate a jobmanager with a jobname atleast in a JOB mode
> deployment.
>
> Please let me know if there is any way to add a custom label by
> cinfiguration?
>
> Thanks,
> anaray
>
>
>
> --
> Sent from:
> http://apache-flink-user-mailing-list-archive.2336050.n4.nabble.com/
>