Hi Bryan,

So it had to be known to substitute in "root" in the widgets file ahead of time

Yes. To create default widget that ships with the service, complete metric name 
is required to be known.


If you went into the UI to create a new widget is there a way to fill in a 
dynamic name?

This right now is not completely stack driven. For YARN Queue metrics, there is 
a dedicated UI code that looks at the regex and shows all the queue related 
metric names for all the queues that are present and being emitted on runtime.

Pointer to UI code: 
link?<https://github.com/apache/ambari/blob/trunk/ambari-web/app/controllers/main/service/widgets/create/wizard_controller.js#L278>



--Thanks

   Jaimin

________________________________
From: Bryan Bende <[email protected]>
Sent: Monday, August 17, 2015 1:25 PM
To: [email protected]
Subject: Re: Dynamic Metric Names

Sorry got cut short there...

Thanks Sid, I see what you are talking about with the YARN queue metrics.

It still seems to me like you need to know the dynamic values ahead of time. 
For example, take this metric:

"metrics/yarn/Queue/$1.replaceAll(\"([.])\",\"/\")/AllocatedMB": {
  "metric": "yarn.QueueMetrics.Queue=(.+).AllocatedMB",
 "pointInTime": false,
"temporal": true
}

Then in YARN_widgets.json:
"name": "yarn.QueueMetrics.Queue=root.AllocatedMB",
"metric_path": "metrics/yarn/Queue/root/AllocatedMB",

So it had to be known to substitute in "root" in the widgets file ahead of 
time, but what if you didn't know it was called root yet.

If you went into the UI to create a new widget is there a way to fill in a 
dynamic name?

Thanks,

Bryan

On Mon, Aug 17, 2015 at 4:22 PM, Bryan Bende 
<[email protected]<mailto:[email protected]>> wrote:
Thanks Sid, I see what you are talking about with the YARN queue metrics.

It still seems to me like you need to know the dynamic values ahead of time. 
For example, take this metric:

"metrics/yarn/Queue/$1.replaceAll(\"([.])\",\"/\")/AllocatedMB": {
  "metric": "yarn.QueueMetrics.Queue=(.+).AllocatedMB",
 "pointInTime": false,
"temporal": true
}

Then in YARN_widgets.json:



On Fri, Aug 14, 2015 at 6:11 PM, Siddharth Wagle 
<[email protected]<mailto:[email protected]>> wrote:

Hi Bryan,


Yes, we do have regex support in the declarative definition of the service. 
Unfortunately, it isn't documented at the moment.


Best Example: YARN Queue metrics. The queue name is substiuted by the UI, 
replaced by the MetricsPropertyProvider inside the actual metrics name before 
calling the AMS service.


Similar examples exist in Flume as well where the flume agent name is a runtime 
param.


-Sid


________________________________
From: Bryan Bende <[email protected]<mailto:[email protected]>>
Sent: Thursday, August 13, 2015 8:45 AM
To: [email protected]<mailto:[email protected]>
Subject: Dynamic Metric Names

Hello,

Is it possible to define metrics and have the name include some kind of 
parameter that would be determined later?

For example "my.metric.{id}" where id would be based on a value from the 
sending system that is not known until runtime.

There appears to be an example of this in the Kafka metrics.json:

"metrics/kafka/cluster/Partition/$1-UnderReplicated": {
              "metric": "kafka.cluster.Partition.(\\w+)-UnderReplicated",
              "pointInTime": true,
              "temporal": true
}

but how do you use this when adding a widget?

Thanks,

Bryan


Reply via email to