1. Home
  2. Documentation
  3. Analytics
  4. How to get responses from the legacy api-metrics using the Analytics API

How to get responses from the legacy api-metrics using the Analytics API

Step-by-step guide to replace api-metrics calls with the traces/query endpoint of the Analytics API.
IMPORTANT
  • The API contract replacing api-metrics is different.
  • The Base URL and authentication method vary according to the Sensedia platform version you use.
Version
Base URL
Authentication
v.5 (Sensedia Platform)https://platform-production.sensedia.comAuthorization header with the access-token value.
v.4Your custom Base URLsensedia-auth header with the access key value.

Regarding Analytics when coupled to the platform, the current version offers greater flexibility, allowing you to customize queries with much more granularity.

For that, we now have the /analytics/v1/products/api-gateway/traces/query endpoint, which replaces api-metrics.

See below an example:

Here are some tips to save you time.

You can build the query using Analytics' graphical interface and then copy and paste it in step 3 above.

See below how to do that.

NOTE

Queries made accessing the /traces/query endpoint have some limitations such as timeout and rate limit. Therefore, it is indicated only for specific searches. For more comprehensive data extraction, use Data Streaming.

General Trace Filters

Follow the example steps below to generate a query from the General Trace GUI.

The steps can be used with any combination of filters, defined in step 1 below.

Aggregations from Visualize or Dashboards

Follow the steps from the example below to generate a query from the Dashboard or Visualize graphical interface.

These steps can be used with any visualization.

You can tailor the search to bring up what you need using the features of Visualize or Dashboards.

For simpler searches, you can write the query directly in step 3 of the first example.

See the page about Query DSL in the OpenSearch documentation for examples of basic queries.

Quick Tips

Here you have the same steps mentioned above, now in quick walkthrough videos.

How happy are you with this page?

We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more