These APIs provide endpoints for retrieving information that is Instana , as well as accessing usage statistics for the API and hosts. Users can retrieve usage data for specific days, months, and years
For more information regarding these APIs, click here.
To access the Instana APIs, user must provide two essential parameters:
-
base: Tenant unit's base URL, which is also the URL used to access the Instana user interface.
Instana deployments in OpenShift, if the Instana core is deployed onto the namespace Instana-core, use the following command to get the base URL -
oc get route -n instana-core)
-
apiToken: Requests made over the Instana API require valid API tokens. An initial API token can be created using the Instana UI. Any additional tokens can be generated for different permissions per consumer.
These tokens could be of two types:
a) uInstana group) in order to create or view these API tokens. Anyone with the proper permission can view and modify them.
Configuration: Settings -> Access control -> API tokens -> Add API Token
Give a name for your token and click the save button
b) Personal API tokens - Belong to a user and carry over the creator's permission. They are useful when individual responsibility and traceability are crucial, or when users prefer not to disclose their personal API tokens to others. Also, these tokens are deleted when the user is removed from the tenant
Configuration: Settings -> User settings -> Personal API tokens -> New Personal API Token
Provide a name for your personal token, and click the Save.
The Instana APIs come with GET, POST, PUT, DELETE & PATCH methods. Curl commands that are invoked using the command line can be used to access these APIs.
General syntax: curl [options] [URL...]
(Options - GET, POST, PUT, DELETE or PATCH)
(URL - base url + endpoint url)
Additionally, Instana APIs demand API tokens be be given as the authorisation header.
--header 'authorization: apiToken xxxxxxxxxxxxxxxx'
The various APIs and their associated methods can thus be used as follows:
--header 'authorization: apiToken xxxxxxxxxxxxxxxx'
e.g. Endpoint url: /api/instana/health
Command: curl --request GET \
--header 'authorization: apiToken xxxxxxxxxxxxxxxx'
The returned JSON object provides a `health` property that contains a simple traffic light.
curl --request method_name\
--header 'authorization: apiToken xxxxxxxxxxxxxxxx' \
--header 'content-type: application/json' \
--data '{"key1": "value1", "key2": "value2"}'
e.g. Endpoint url: api/application-monitoring/analyze/call-groups
Command: curl --request POST --url <URL> \
--header 'authorization: apiToken xxxxxxxxxxxxxxxx'\
--header 'content-type: application/json' \
"groupbyTag":"endpoint.name"
"name":"call.error.count",
"operator":"GREATER_THAN"
This command allows every call grouped by the endpoint name that has an error to count greater than zero.
--header 'authorization: apiToken xxxxxxxxxxxxxxxx'
e.g. Endpoint url : api/events/settings/alertingChannels/{channel_id}
Command: curl --request DELETE -k --url <URL> \
--header 'authorization: apiToken xxxxxxxxxxxxxxxx'
This command deletes the alerting channel of the given ID.
I hope this article serves as an introduction to using Instana APIs. By looking at these APIs, you can get a general idea on how to incorporate them into your own workflows for development and monitoring.