Retrieving metric description


I added description on all my metrics in seed data.
Because the doc says it is translated by name I get the name instead of the description when I do
SimpleMetric.fetch({include: “description”}).

How can I actually get the description?



You have to add Translation data in your seed directory:

id,locale,key,value,en,data.SimpleMetric.MyMetricName.description,"Measures some data" 

Where the id is of the form
<locale id>.data.<type name>.<"translate by" field name value>.description

And key is of the form
data.<type name>.<"translate by" field name value>.description

For more information, see the Translation documentation article (/documentation/topic/Translation#section:1.2)


Is it MyMetricName or MyMetricId?

From the documentation it looks like I have to put the id of an object…


It should be MyMetricName.


It worked for simple metrics but not for compound metrics. I followed the same conventions. Did I miss anything?


@romain.juban Does the compound metric have different metric name and metric id? In general we set them same.


Yes They are the same. Do you have a working example I can check?