OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Is there a good explanation of resource labels versus metric labels?

  • Thread starter Thread starter red888
  • Start date Start date
R

red888

Guest
When writing custom metrics you have resource labels and metric labels.

Resource labels are labels that are required by the resource. So if I choose the generic_task resource type and exclude the task_id resource label I get an error.

Metric labels seem to be arbitrary additional labels?

I can aggregate metrics by both resource and metric labels.

What is the point of having both? Is it merely to enforce consistency? So I can say generic_task and know for sure all metrics of that type have specific labels? And then if I still need more labels I use metric labels?

Is it a best practice to choose the best resource type and avoid metric labels were possible (for consistency)?

It seems to me like I should just always use the global type because it requires the least amount of labels which means I'm not spending money on dimensions I don't need.

Is there a cost difference or other operational difference between resource and metric labels?

I'm having trouble finding clear best practices in the google docs.
<p>When writing custom metrics you have resource labels and metric labels.</p>
<p>Resource labels are labels that are <em>required</em> by the resource. So if I choose the <code>generic_task</code> resource type and exclude the <code>task_id</code> resource label I get an error.</p>
<p>Metric labels seem to be arbitrary additional labels?</p>
<p>I can aggregate metrics by both resource and metric labels.</p>
<p>What is the point of having both? Is it merely to enforce consistency? So I can say <code>generic_task</code> and know for sure all metrics of that type have specific labels? And then if I still need more labels I use metric labels?</p>
<p>Is it a best practice to choose the best resource type and avoid metric labels were possible (for consistency)?</p>
<p>It seems to me like I should just always use the <code>global</code> type because it requires the least amount of labels which means I'm not spending money on dimensions I don't need.</p>
<p>Is there a cost difference or other operational difference between resource and metric labels?</p>
<p>I'm having trouble finding clear best practices in the google docs.</p>
Continue reading...
 

Latest posts

Top