Hi Jurgen,
I am from Instana dev team. I recently completed a feature where you can make an API call to retrieve all the Processes (with metrics) that are mapped to an application name or a service name. Here are sample curl commands.
Application Name -> Processes
curl -XPOST https://foo-bar.instana.rocks/api/infrastructure-monitoring/analyze/entities -H "Content-Type: application/json" -H "authorization: apiToken $apiToken" -d '{"timeFrame":{"to":1718895396498,"windowSize":3600000},"tagFilterExpression":{"type":"TAG_FILTER","name":"application.name","operator":"EQUALS","entity":"NOT_APPLICABLE","value":"team x","tagDefinition":{"name":"application.name","type":"STRING","path":[{"label":"Others"},{"label":"application"},{"label":"name"}]}},"pagination":{"retrievalSize":20},"type":"process","metrics":[{"metric":"cpu.user","aggregation":"MEAN","label":"CPU Usage (User)"},{"metric":"mem.virtual","aggregation":"MEAN","label":"Virtual Memory"}],"order":{"by":"label","direction":"ASC"}}'
Service Name -> Processes
curl -XPOST https://foo-bar.instana.rocks/api/infrastructure-monitoring/analyze/entities -H "Content-Type: application/json" -H "authorization: apiToken $apiToken" -d '{"timeFrame":{"to":1718895396498,"windowSize":3600000},"tagFilterExpression":{"type":"TAG_FILTER","name":"service.name","operator":"EQUALS","entity":"NOT_APPLICABLE","value":"cart","tagDefinition":{"name":"service.name","type":"STRING","path":[{"label":"Others"},{"label":"service"},{"label":"name"}]}},"pagination":{"retrievalSize":20},"type":"process","metrics":[{"metric":"cpu.user","aggregation":"MEAN","label":"CPU Usage (User)"},{"metric":"mem.virtual","aggregation":"MEAN","label":"Virtual Memory"}],"order":{"by":"label","direction":"ASC"}}'
This feature is currently behind a feature flag. Can you tell me what is your tenant unit? We can enable it for your TU so you can try it and provide feedback.
Thanks,
Albert
------------------------------
Albert Chung
------------------------------
Original Message:
Sent: Thu September 14, 2023 03:54 AM
From: Jurgen Roels
Subject: Get application stack through the API
Hi Tom,
Ok, that makes sense :) The goal is to execute this once a day or less. So the impact on the system should be limited.
I'll contact you via a direct message for more information, but a deeper converstation can always be interesting.
------------------------------
Kind regards,
Jurgen Roels
Brussels, Belgium
Original Message:
Sent: Wed September 13, 2023 10:56 AM
From: Tom Tammann
Subject: Get application stack through the API
Apologies for my flippant remark. My experience tells me that users are not always aware on the implications of their actions/request (nor should they be theoretically). Still, if you have a huge graph AND exported it every second, it WILL tax the system. Other vendors sometimes charge per query etc. Instana promotes "fair use". I hope that makes sense.
And cmdb makes total sense. Just for curiosity, will the further usage include security use cases and/or do you use ServiceNow? Should I connect you to a Product Manager for a deeper conversation?
Best regards
Tom
------------------------------
Tom Tammann
Original Message:
Sent: Wed September 13, 2023 02:14 AM
From: Jurgen Roels
Subject: Get application stack through the API
Thanks for the feedback @Tom Tammann!
I've created the feature request: https://automation-management.ideas.ibm.com/ideas/INSTANA-I-1840
In the meanwhile, I'll try to work with the workaround your colleague @Farhad Ferdowsian suggested.
------------------------------
Kind regards,
Jurgen Roels
Brussels, Belgium
Original Message:
Sent: Tue September 12, 2023 02:36 PM
From: Tom Tammann
Subject: Get application stack through the API
Hi Jurgen
my colleague @Farhad Ferdowsian made me aware of the following (rather hidden) functionality.
Use
/api/application-monitoring/applications/services?includeSnapshotIds=true
to get a list of Services AND their SnapshotIds, then loop through the Snapshots with
/api/infrastructure-monitoring/snapshots/:id
the response will contain "plugins" which reveal the infra entities.
And while a hidden feature, I could argue, that traversing the graph is rather expensive and a more "surgical" approach could be the right way, even if it takes a bit more effort...
Best regards
Tom
------------------------------
Tom Tammann
Original Message:
Sent: Mon September 11, 2023 03:33 AM
From: Jurgen Roels
Subject: Get application stack through the API
Hi all,
I'm trying to retrieve the whole application stack (AP > service > process > host) through the Instana API.
Currently I'm using the following API requests:
-
{{baseURL}}/api/application-monitoring/applications?nameFilter=xxx
-
{{baseURL}}/api/application-monitoring/topology/services?applicationId=xxx&applicationBoundaryScope=ALL
-
{{baseURL}}/api/infrastructure-monitoring/topology
With the result of the above API requests, I can retrieve all required entities. But I'm missing the link between service and process.
Does someone know which API endpoint can provide this missing link?
Thanks in advance!
------------------------------
Kind regards,
Jurgen Roels
Brussels, Belgium
------------------------------