openapi: 3.0.1 info: contact: email: support@instana.com name: © Instana url: http://instana.com termsOfService: https://www.instana.com/terms-of-use/ title: Instana REST API documentation Synthetic Metrics API version: 1.307.1417 x-ibm-ahub-try: true x-logo: altText: instana logo backgroundColor: '#FAFBFC' url: header-logo.svg description: "Searching for answers and best pratices? Check our [IBM Instana Community](https://community.ibm.com/community/user/aiops/communities/community-home?CommunityKey=58f324a3-3104-41be-9510-5b7c413cc48f).\n\n
\n \"info\n \n Our API documentation is moving to \n API Hub\n\t — please update your bookmarks now, as the current site will be deprecated after Release-306.\n \n
\n\n## Overview\nThe Instana REST API provides programmatic access to the Instana platform. It can be used to retrieve data available through the Instana UI Dashboard -- metrics, events, traces, etc -- and also to automate configuration tasks such as user management.\n\n### Navigating the API documentation\nThe API endpoints are grouped by product area and functionality. This generally maps to how our UI Dashboard is organized, hopefully making it easier to locate which endpoints you'd use to fetch the data you see visualized in our UI. The [UI sections](https://www.ibm.com/docs/en/instana-observability/current?topic=working-user-interface#navigation-menu) include:\n- Websites & Mobile Apps\n- Applications\n- Infrastructure\n- Synthetic Monitoring\n- Events\n- Automation\n- Service Levels\n- Settings\n- etc\n\n### Rate Limiting\nA rate limit is applied to API usage. Up to 5,000 calls per hour can be made. How many remaining calls can be made and when this call limit resets, can inspected via three headers that are part of the responses of the API server.\n\n- **X-RateLimit-Limit:** Shows the maximum number of calls that may be executed per hour.\n- **X-RateLimit-Remaining:** How many calls may still be executed within the current hour.\n- **X-RateLimit-Reset:** Time when the remaining calls will be reset to the limit. For compatibility reasons with other rate limited APIs, this date is not the date in milliseconds, but instead in seconds since 1970-01-01T00:00:00+00:00.\n\n### Further Reading\nWe provide additional documentation for our REST API in our [product documentation](https://www.ibm.com/docs/en/instana-observability/current?topic=apis-web-rest-api). Here you'll also find some common queries for retrieving data and configuring Instana.\n\n## Getting Started with the REST API\n\n### API base URL\nThe base URL for an specific instance of Instana can be determined using the tenant and unit information.\n- `base`: This is the base URL of a tenant unit, e.g. `https://test-example.instana.io`. This is the same URL that is used to access the Instana user interface.\n- `apiToken`: Requests against the Instana API require valid API tokens. An initial API token can be generated via the Instana user interface. Any additional API tokens can be generated via the API itself.\n\n### Curl Example\nHere is an Example to use the REST API with Curl. First lets get all the available metrics with possible aggregations with a GET call.\n\n```bash\ncurl --request GET \\\n --url https://test-instana.instana.io/api/application-monitoring/catalog/metrics \\\n --header 'authorization: apiToken xxxxxxxxxxxxxxxx'\n```\n\nNext we can get every call grouped by the endpoint name that has an error count greater then zero. As a metric we could get the mean error rate for example.\n\n```bash\ncurl --request POST \\\n --url https://test-instana.instana.io/api/application-monitoring/analyze/call-groups \\\n --header 'authorization: apiToken xxxxxxxxxxxxxxxx' \\\n --header 'content-type: application/json' \\\n --data '{\n \"group\":{\n \"groupbyTag\":\"endpoint.name\"\n },\n \"tagFilters\":[\n \t{\n \t\t\"name\":\"call.error.count\",\n \t\t\"value\":\"0\",\n \t\t\"operator\":\"GREATER_THAN\"\n \t}\n ],\n \"metrics\":[\n \t{\n \t\t\"metric\":\"errors\",\n \t\t\"aggregation\":\"MEAN\"\n \t}\n ]\n }'\n```\n\n### Generating REST API clients\n\nThe API is specified using the [OpenAPI v3](https://github.com/OAI/OpenAPI-Specification) (previously known as Swagger) format.\nYou can download the current specification at our [GitHub API documentation](https://instana.github.io/openapi/openapi.yaml).\n\nOpenAPI tries to solve the issue of ever-evolving APIs and clients lagging behind. Please make sure that you always use the latest version of the generator, as a number of improvements are regularly made.\nTo generate a client library for your language, you can use the [OpenAPI client generators](https://github.com/OpenAPITools/openapi-generator).\n\n#### Go\nFor example, to generate a client library for Go to interact with our backend, you can use the following script; mind replacing the values of the `UNIT_NAME` and `TENANT_NAME` environment variables using those for your tenant unit:\n\n```bash\n#!/bin/bash\n\n### This script assumes you have the `java` and `wget` commands on the path\n\nexport UNIT_NAME='myunit' # for example: prod\nexport TENANT_NAME='mytenant' # for example: awesomecompany\n\n//Download the generator to your current working directory:\nwget https://repo1.maven.org/maven2/org/openapitools/openapi-generator-cli/4.3.1/openapi-generator-cli-4.3.1.jar -O openapi-generator-cli.jar --server-variables \"tenant=${TENANT_NAME},unit=${UNIT_NAME}\"\n\n//generate a client library that you can vendor into your repository\njava -jar openapi-generator-cli.jar generate -i https://instana.github.io/openapi/openapi.yaml -g go \\\n -o pkg/instana/openapi \\\n --skip-validate-spec\n\n//(optional) format the Go code according to the Go code standard\ngofmt -s -w pkg/instana/openapi\n```\n\nThe generated clients contain comprehensive READMEs, and you can start right away using the client from the example above:\n\n```go\nimport instana \"./pkg/instana/openapi\"\n\n// readTags will read all available application monitoring tags along with their type and category\nfunc readTags() {\n\tconfiguration := instana.NewConfiguration()\n\tconfiguration.Host = \"tenant-unit.instana.io\"\n\tconfiguration.BasePath = \"https://tenant-unit.instana.io\"\n\n\tclient := instana.NewAPIClient(configuration)\n\tauth := context.WithValue(context.Background(), instana.ContextAPIKey, instana.APIKey{\n\t\tKey: apiKey,\n\t\tPrefix: \"apiToken\",\n\t})\n\n\ttags, _, err := client.ApplicationCatalogApi.GetApplicationTagCatalog(auth)\n\tif err != nil {\n\t\tfmt.Fatalf(\"Error calling the API, aborting.\")\n\t}\n\n\tfor _, tag := range tags {\n\t\tfmt.Printf(\"%s (%s): %s\\n\", tag.Category, tag.Type, tag.Name)\n\t}\n}\n```\n\n#### Java\nFollow the instructions provided in the official documentation from [OpenAPI Tools](https://github.com/OpenAPITools) to download the [openapi-generator-cli.jar](https://github.com/OpenAPITools/openapi-generator?tab=readme-ov-file#13---download-jar).\n\nDepending on your environment, use one of the following java http client implementations which will create a valid client for our OpenAPI specification:\n```\n//Nativ Java HTTP Client\njava -jar openapi-generator-cli.jar generate -i https://instana.github.io/openapi/openapi.yaml -g java -o pkg/instana/openapi --skip-validate-spec -p dateLibrary=java8 --library native\n\n//Spring WebClient\njava -jar openapi-generator-cli.jar generate -i https://instana.github.io/openapi/openapi.yaml -g java -o pkg/instana/openapi --skip-validate-spec -p dateLibrary=java8,hideGenerationTimestamp=true --library webclient\n\n//Spring RestTemplate\njava -jar openapi-generator-cli.jar generate -i https://instana.github.io/openapi/openapi.yaml -g java -o pkg/instana/openapi --skip-validate-spec -p dateLibrary=java8,hideGenerationTimestamp=true --library resttemplate\n\n```\n" servers: - description: Instana Backend url: https://{unit}-{tenant}.instana.io variables: tenant: default: tenant description: Customer tenant unit unit: default: unit description: Customer tenant name - description: Instana Self-Hosted Backend url: https://{domain} variables: domain: default: example.com description: Customer Self-Hosted domain tags: - name: Synthetic Metrics description: "The endpoints of this group retrieve metrics for Synthetic test results.\n### Mandatory Parameters\n\n**metrics** A list of metric objects that define which metric should be returned, with the defined aggregation. Each metrics objects consists of minimum two items:\n1. *metric* select a particular metric. This is the list of available metrics for all types of Synthetic Tests:\n synthetic.metricsResponseTime (ms), synthetic.metricsResponseSize (bytes), synthetic.metricsStatusCode (an integer represents an HTTP response code, e.g., 200, 401, 500), synthetic.metricsRequestSize (bytes),\n synthetic.metricsUploadSpeed (bytes per second), synthetic.metricsDownloadSpeed (bytes per second),\n synthetic.metricsRedirectTime (ms), synthetic.metricsRedirectCount, synthetic.metricsConnectCount, synthetic.metricsStatus (an integer, 1-success or 0-failure), synthetic.successRate, and synthetic.tags (list of custom properties and values).\n\n The following metrics are only available for the HTTPAction type Synthetic Tests: synthetic.metricsBlocking (bytes), synthetic.metricsDns (bytes), synthetic.metricsConnect (bytes), synthetic.metricsSsl (bytes),\n synthetic.metricsSending (bytes), synthetic.metricsWaiting (bytes), and synthetic.metricsReceiving (bytes).\n\n The metric synthetic.customMetrics (list of custom metrics and values) is only available for SSLCertificate and DNS tests. For SSLCertificate, the custom metrics are returned as metrics. For DNS, the custom metrics are returned in the *ismDetails* field.\n\n The metric synthetic.tags adds the latest list of custom properties to the response.\n\n2. *aggregation* Depending on the selected metric, different aggregations are available e.g., SUM, MEAN, P90 (90th percentile), DISTINCT_COUNT, and MAX. MAX is only allowed for synthetic.tags. Metric synthetic.successRate only accepts MEAN.\n\n**timeFrame** As in our UI you can specify the timeframe for metrics retrieval.\n```\n windowSize to\n (ms) (unix-timestamp)\n<----------------------|\n```\nThe timeFrame might be adjusted to fit the metric granularity so that there is no partial bucket. For example, if the query timeFrame is 08:02 - 09:02 and the metric granularity is 5 minutes, the timeFrame will be adjusted to 08:05 - 09:00. The adjusted timeFrame will be returned in the response payload. If the query does not have any metric with granularity, a default granularity will be used for adjustment. \n\nIf **groups** includes a groupbyTag that is an array, such as synthetic.tags, the maximum windowSize is *3600000* (1 hour).\n\n### Optional Parameters\n\n**metrics** By default you will get an aggregated metric for the selected timeframe\n\n* *granularity*\n * If it is not set you will get an aggregated value for the selected timeframe\n * If the granularity is set you will get data points with the specified granularity **in seconds**\n * The granularity should not be greater than the `windowSize` (important: `windowSize` is expressed in **milliseconds**)\n * The granularity should not be set too small relative to the `windowSize` to avoid creating an excessively large number of data points (max 600)\n * The granularity values are the same for all metrics\n\n**pagination** if you use pagination, fix the timeFrame for the retrieved metrics\n1. *page* select the page number you want to retrieve\n2. *pageSize* set the number of Synthetic test results you want to return with one query\n\n**groups** You can group test results by one or more tags.\n1. *groupbyTag* use the metric or tag name, e.g. \"synthetic.applicationId\", to group by its value\n2. *groupbyTagSecondLevelTag* is optional. It is used to further qualify values when the *groupbyTag* is an array of key/value pairs, such as \"synthetic.tags\".\n3. *groupbyTagEntity* is ignored and therefore does not need to be specified.\n\nIf *groups* is not specified, the default grouping is *synthetic.testId*.\n\nAn example of grouping by the custom property \"region\":\n```\n \"groups\": [\n {\n \"groupbyTag\": \"synthetic.tags\",\n \"groupbyTagSecondLevelTag\": \"region\"\n }\n ]\n```\n\n**includeAggregatedTestIds** Optionally used when not grouping by testId. Specifying *true* will return a list of tests that were included in the aggregated result for each row returned.\n\n**tagFilterExpression** It serves as a filter to narrow down return results. Its type can be either EXPRESSION or TAG_FILTER with\nlogical operators \"AND\" or \"OR\".\n\nA tagFilterExpression can specify a custom property by its key and value.\n```\n \"tagFilterExpression\": {\n \"type\": \"EXPRESSION\",\n \"logicalOperator\": \"AND\",\n \"elements\": [\n {\n \"name\": \"synthetic.tags\",\n \"key\": \"region\",\n \"value\": \"Denver\",\n \"operator\": \"EQUALS\"\n },\n {\n \"name\": \"synthetic.locationId\",\n \"operator\": \"EQUALS\",\n \"stringValue\": \"abcdefgXSJmQsehOWg1S\"\n }\n ]\n }\n```\n\n### Defaults\n\n**groups**\n```\n \"groups\": [\n \"groupbyTag\": \"synthetic.testId\"\n ]\n```\n\n**includeAggregatedTestIds**\n* *includeAggregatedTestIds:* *true* when grouping by synthetic.testId, otherwise *false*.\n\n**metrics**\n* *granularity:* 0\n\n**pagination**\n* If **pagination** is not specified, the entire result set is returned.\n\n**timeFrame**\n```\n \"timeFrame\": {\n \"to\": {current timestamp},\n \"windowSize\": 60000\n }\n```\n\n### Sample payload to get the mean synthetic.metricsResponseTIme for each Synthetic test within the specified timeFrame\n```json\n{\n \"metrics\": [\n {\n \"aggregation\": \"MEAN\",\n \"metric\": \"synthetic.metricsResponseTime\"\n }],\n \"timeFrame\": {\n \"to\": 0,\n \"windowSize\": 1800000 \n }\n} \n```\n\n### Sample payload to get the mean synthetic.metricsResponseTIme for each Synthetic test within the specified timeFrame grouped by applicationId\n```json\n{\n \"metrics\": [\n {\n \"aggregation\": \"MEAN\",\n \"metric\": \"synthetic.metricsResponseTime\"\n }],\n \"timeFrame\": {\n \"to\": 0,\n \"windowSize\": 1800000 \n },\n \"groups\": [{\n \"groupbyTag\": \"synthetic.applicationId\"\n }]\n} \n```\n\n### Sample payload to get the synthetic.successRate for the Synthetic tests within the specified timeFrame grouped by the two custom properties region and cluster.\n```json\n{\n \"metrics\": [\n {\n \"aggregation\": \"MEAN\",\n \"metric\": \"synthetic.successRate\"\n }],\n \"timeFrame\": {\n \"to\": 0,\n \"windowSize\": 1800000\n },\n \"groups\": [\n {\n \"groupbyTag\": \"synthetic.tags\",\n \"groupbyTagSecondLevelKey\": \"region\"\n },\n {\n \"groupbyTag\": \"synthetic.tags\",\n \"groupbyTagSecondLevelKey\": \"cluster\"\n }]\n}\n```\n" paths: /api/synthetics/metrics: post: description: 'API request to retrieve Synthetic Metrics. For more information on Synthetic Metrics please access the https://developer.ibm.com/apis/catalog/instana--instana-rest-api/Synthetic+Monitoring#synthetic-metrics.' operationId: getMetricsResult requestBody: content: application/json: example: pagination: page: 1 pageSize: 3 metrics: - metric: synthetic.metricsResponseTime aggregation: SUM timeFrame: to: 0 windowSize: 3600000 groups: - groupbyTag: synthetic.applicationId - groupbyTag: synthetic.tags groupbyTagSecondLevelTag: region schema: $ref: '#/components/schemas/GetMetricsResult' responses: '200': content: application/json: example: metricsResult: - tests: - testId: 6GwdCuiMjGdMrtz8THjo testName: rumattach-BasicNavTest locationId: - f7cEoG61DJfVyWcDnWsc applicationId: application1 serviceId: serviceId1 metrics: - synthetic.metricsResponseTime: 1276 customMetrics: - region: region1 - tests: - testId: OCnmrLSlNgzntI68094j testName: test-javascript-bundled locationId: - wHICfVoIpiHbwawo5xQ6 applicationId: application2 serviceId: serviceId2 metrics: - synthetic.metricsResponseTime: 14 customMetrics: - location: location1 region: region2 - tests: - testId: 9i6gpys6whaYtN5k9VeD testName: My_Test_ReadFile locationId: - DemoPoP1_saas_instana_test applicationId: application3 serviceId: serviceid3 metrics: - synthetic.metricsResponseTime: 7 customMetrics: - location: location3 region: region3 page: 1 pageSize: 3 totalHits: 2212 schema: $ref: '#/components/schemas/MetricsResult' description: OK '400': description: Bad request. '401': description: Unauthorized access - requires user authentication. '500': description: Internal server error. security: - ApiKeyAuth: - Default summary: Get Synthetic Metrics tags: - Synthetic Metrics x-ibm-ahub-byok: true components: schemas: SyntheticMetricConfiguration: type: object properties: aggregation: type: string description: 'Set aggregation that can be applied to a series of values. Eg: `MEAN`.' enum: - SUM - MEAN - MAX - MIN - P25 - P50 - P75 - P90 - P95 - P98 - P99 - P99_9 - P99_99 - DISTINCT_COUNT - SUM_POSITIVE - PER_SECOND - INCREASE granularity: type: integer format: int32 description: 'If the granularity is set you will get data points with the specified granularity in seconds. Default: `1000` milliseconds' metric: type: string description: 'Set a particular metric, eg: `latency`.' required: - aggregation - metric MetricsResult: type: object properties: metricsResult: type: array items: $ref: '#/components/schemas/MetricsResultItem' required: - metricsResult SyntheticMetricTagGroup: type: object description: ' Grouping of data under `groupbyTag`, where `groupbyTagEntity` and `groupbyTagSecondLevelKey` are aspects of `groupbyTag`.' properties: groupbyTag: type: string description: The name of the group tag (e.g. `agent.tag` or `docker.label`). maxLength: 256 minLength: 0 groupbyTagEntity: type: string description: 'The entity by which the data should be grouped. This field supports three possible values: `NOT_APPLICABLE`, `DESTINATION`, and `SOURCE`. `SOURCE`: the tag filter should apply to the source entity. `DESTINATION`: the tag filter should apply to the destination entity. `NOT_APPLICABLE`: some tags are independent of source or destination, such as tags on the call itself, log tags or trace tags (only destination makes sense because the source is unknown for the root call). ' enum: - NOT_APPLICABLE - DESTINATION - SOURCE groupbyTagSecondLevelKey: type: string description: If present, it's the 2nd level key part (e.g. `customKey` on `docker.label.customKey`) maxLength: 256 minLength: 0 required: - groupbyTag - groupbyTagEntity Pagination: type: object properties: page: type: integer format: int32 description: Page number for a specific page in the results. For example, if you'd like to retrieve the 5th page out of 10 pages, the value would be 5. minimum: 1 pageSize: type: integer format: int32 description: 'Set the number of items you want to return with one query. Eg: if you want to retrieve 10 items, the value would be 10.' maximum: 200 minimum: 1 MetricsTestResultItem: type: object description: A description of the Synthetic test associated with the result item. This information will be included if the request was grouped by synthetic.testId or if includeAggregatedTestId was true on the request. properties: applicationId: type: string description: An identifier of an application associated with the Synthetic test. This field is deprecated and will be replace by the applicationIds field. applicationIds: type: array description: A list of the applications associated with the Synthetic test. items: type: string description: A list of the applications associated with the Synthetic test. locationId: type: array description: A list of the locations associated with the Synthetic test. items: type: string description: A list of the locations associated with the Synthetic test. mobileApplicationIds: type: array description: A list of the mobile applications associated with the Synthetic test. items: type: string description: A list of the mobile applications associated with the Synthetic test. serviceId: type: string description: A service associated with the Synthetic test. testId: type: string description: The testId for the Synthetic test. testName: type: string description: The Synthetic test's name. websiteIds: type: array description: A list of the websites associated with the Synthetic test. items: type: string description: A list of the websites associated with the Synthetic test. required: - testId MetricsResultItem: type: object properties: customTags: type: object additionalProperties: type: string description: A map of custom properties composed of the custom property name and its value. This information will be included if the custom properties were requested or if the query was grouped and the grouping included one or more custom properties. description: A map of custom properties composed of the custom property name and its value. This information will be included if the custom properties were requested or if the query was grouped and the grouping included one or more custom properties. metrics: type: array description: A map of the requested metrics, composed of the metric name and its value. items: type: object additionalProperties: type: object description: A map of the requested metrics, composed of the metric name and its value. description: A map of the requested metrics, composed of the metric name and its value. runType: type: string description: Indicates whether the test was scheduled to run or run now tests: type: array description: A description of the Synthetic test associated with the result item. This information will be included if the request was grouped by synthetic.testId or if includeAggregatedTestId was true on the request. items: $ref: '#/components/schemas/MetricsTestResultItem' required: - metrics TagFilterExpressionElement: type: object description: Boolean expression of tag filters to define the scope of relevant calls. discriminator: mapping: EXPRESSION: '#/components/schemas/TagFilterExpression' TAG_FILTER: '#/components/schemas/TagFilter' propertyName: type properties: type: type: string required: - type TimeFrame: type: object description: Time range for which the data should be retrieved. properties: to: type: integer format: int64 description: 'end of timeframe expressed as the Unix epoch time in milliseconds. Eg: `ISO 8601` standard time `2024-06-27T05:05:55.615Z` can be represented as `1719464755615` in Unix epoch time in milliseconds.' windowSize: type: integer format: int64 description: windowSize in milliseconds maximum: 2678400000 minimum: 0 GetMetricsResult: type: object properties: disableDefaultGroups: type: boolean writeOnly: true groups: type: array description: ' Grouping of data under `groupbyTag`, where `groupbyTagEntity` and `groupbyTagSecondLevelKey` are aspects of `groupbyTag`.' items: $ref: '#/components/schemas/SyntheticMetricTagGroup' includeAggregatedTestIds: type: boolean writeOnly: true metrics: type: array description: 'A list of objects each of which defines a metric and the (statistical) aggregation -- MEAN, SUM, MAX, etc -- that should be used to summarize it for the defined time frame. Eg: `[{ ''metric'': ''latency'', ''aggregation'': ''MEAN''}]`. To know more about supported metrics and its aggregation, See `Get Metric catalog`.' items: $ref: '#/components/schemas/SyntheticMetricConfiguration' pagination: $ref: '#/components/schemas/Pagination' tagFilterExpression: $ref: '#/components/schemas/TagFilterExpressionElement' timeFrame: $ref: '#/components/schemas/TimeFrame' required: - metrics securitySchemes: ApiKeyAuth: in: header name: authorization type: apiKey description: "## Example\n\n```bash\ncurl --request GET \\\n --url https://test-instana.instana.io/api/application-monitoring/catalog/metrics \\\n --header 'authorization: apiToken xxxxxxxxxxxxxxxx'\n```\n" x-tagGroups: - name: Websites & Mobile Apps tags: - Website Metrics - Website Catalog - Website Analyze - Website Configuration - Mobile App Metrics - Mobile App Catalog - Mobile App Analyze - Mobile App Configuration - End User Monitoring - name: Applications tags: - Application Metrics - Application Resources - Application Catalog - Application Analyze - Application Settings - Application Topology - Application Alert Configuration - Global Application Alert Configuration - name: Infrastructure tags: - Infrastructure Analyze - Infrastructure Metrics - Infrastructure Resources - Infrastructure Catalog - Infrastructure Topology - name: Logging tags: - Logging Analyze - name: Synthetic Monitoring tags: - Synthetic Catalog - Synthetic Metrics - Synthetic Settings - Synthetic Test Playback Results - Synthetic Alert Configuration - name: Logs tags: - Log Alert Configuration - name: Events tags: - Events - Event Settings - name: Automation tags: - Action Catalog - Action History - Policies - name: Service Levels tags: - SLI Settings - SLI Report - Apdex Settings - Apdex Report - Service Levels Objective(SLO) Configurations - Service Levels Objective(SLO) Report - Service Levels Alert Configuration - SLO Correction Configurations - SLO Correction Windows - name: AI Management tags: - AI Management - name: Settings tags: - Custom Dashboards - User - Groups - Teams - Roles - Audit Log - API Token - Maintenance Configuration - Synthetic Calls - Session Settings - Automation Settings - Authentication - name: Open Beta Features tags: - Infrastructure Analyze - name: Closed Beta Features tags: - Infrastructure Alert Configuration - name: Instana tags: - Releases - Host Agent - Health - Usage