Yong,
The container_id can be accessed as
config['hostLevelParams']['container_id¹] in params.py. Take a look at
this for an example -
https://github.com/apache/incubator-slider/blob/develop/app-packages/comman
d-logger/slider-pkg/package/scripts/params.py


You should be able to use this to configure your metrics2 properties
template.

Let me know if it does not solve your problem.

-Gour

On 8/4/15, 2:41 PM, "Yong Feng" <[email protected]> wrote:

>Hi Slider Team,
>
>We are using Slider to manage long running service and ElasticSearch to
>maintain the collected metrics of those long running service. We also
>develop an elasticSearch sink of Hadoop Metric2. The collected metric
>includes AppName, ComponentName and HostName which are prepared by Slider
>and configured in appConfig. We could use those names to associate a
>metric
>record to an service instance.
>
>It works well if there is only one instance in each host. For some long
>running service, we may need start multiple instances in one host (just
>for
>future possibility :-)). If that is the case, the tuple of (AppName,
>ComponentName, Hostname) is not enough to identify an service instance
>uniquely.
>
>I am thinking can Slider support YARN ContainerID as Environment Variable
>for Slider Application Instance just like COMPONENT_NAME, so that user
>could configure CONTAINER_ID as configuration parameter for Metric2 sink.
>
>If it makes sense, I will long a JIRA and enhance Slider to support it.
>
>Thanks,
>
>Yong

Reply via email to