DataDog / dd-agent

Datadog Agent Version 5
https://docs.datadoghq.com/
Other
1.3k stars 812 forks source link

Service discovery: use jinja for templating #2615

Open awasilyev opened 8 years ago

awasilyev commented 8 years ago

instead of inventing another templating engie

remh commented 8 years ago

Thanks, that's a good suggestion. We are going to consider mustache https://mustache.github.io/ as it's more portable to other languages.

awasilyev commented 8 years ago

I am confused with mustache slogan - 'Logic-less templates.' - does this mean that condition operators - such as 'if' are unavailable in this templating engine?

remh commented 8 years ago

Yes they are unavailable, although workarounds do exist.

Could you describe your use case for if statements in those templates ? The set of variables that will be available for templating is likely going to stay small. But i'd be happy to hear more about your use case.

awasilyev commented 8 years ago

Maybe currently I can't give you a good example - but I am pretty sure that it is better to have capability rather than not to have it. The first - but maybe not the best thing that come to my mind - different set of jmx/jolokia metrics for different components, launched from the same docker image. They functionality are enabled/disabled/configured by env variables. From the other side - since dd-agent is written on python - why portability to many languages is important?