cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynatrace V2 API - How to Call Kubernetes Metrics?? Any Examples??

louis_gallo
Helper

I am getting pretty proficient automating the pulling of metrics via the V2 API. My next challenge is how to create basic queries for statistics OpenShift pods from Kubernetes. I am totally stumped. 

 

Anyone have any good examples?

 

Lou

7 REPLIES 7

Julius_Loman
DynaMight Legend
DynaMight Legend

If there is a metric for that (Check it in the menu Metrics in UI), then you are able to pull it easily. Is there any specific metric you need to query?

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

ChadTurner
DynaMight Legend
DynaMight Legend

This is a great list of the metrics and metric keys that are in Dynatrace: https://www.dynatrace.com/support/help/how-to-use-dynatrace/metrics/built-in-metrics/saas/

-Chad

louis_gallo
Helper

So for example, I am trying to pull builtin:containers.cpu.usageMilliCores for an OpenShift entity. I can easily pull that with type(CONTAINER_GROUP_INSTANCE),entityName("my-app"). However I cannot seem to pull by tag that my-app belongs to.

Lou 

derija
Participant

Same here would like to be able to see what each container is using as a total for millicores

dynamic
Observer

i am working on automating the pulling of metrics via the V2 API , could you please help if you have any resources or steps? thank you

@dynamic  for pulling metrics, you need to use the Metrics API - Get metric data points. You need to supply parameters such as entitySelector and timeframe at least. Metric selector and entity selectors can be tricky for beginners, however for the new Unified Analysis Screens it's easy to show it in the data explorer:

Julius_Loman_0-1694501076472.png

And then you can just copy the metric selector from there or also use the filter part as entitySelector.

 

Certified Dynatrace Master | Alanata a.s., Slovakia, Dynatrace Master Partner

I can pull metrics from API, however, I need to automate the next page key to pull data in real-time. and then create a report based on that data.  is there an efficient way to do it? the goal is to connect to powerBi

Featured Posts