After you've created and published your API, you can configure your analytics, logging, and notifications. This article is for API publishers with access to the APIM console. Learn more about the different aspects of the APIM console.
Note: Several paths in this article depend on your API definition version. v4 APIs use the current console layout; v2 APIs use the legacy layout. Learn more about API definitions.
Dashboard
You can configure Platform, API, or Application dashboards. Review dashboards in the console Dashboard in the main menu. For API-specific analytics, open a v4 API and select API Traffic → Analytics, or open a v2 API and select Analytics in the submenu.
Generate a new dashboard
- Select Settings in the main menu.
-
Under the Portal heading, select Analytics. The page lists your Platform, API, and Application dashboards.
-
Select Add a new platform dashboard, Add a new API dashboard, or Add a new application dashboard.
- Enter a Dashboard name and an optional Query filter.
- Add widgets to your dashboard, such as tables, line or pie charts, graphs, maps, or statistics, and select standard or custom fields for each widget.
- Check Enabled dashboard to make your dashboard live.
- Select Save.
The Analytics page also includes an HTTP Client Timeout setting for dashboard data requests.
Health check analytics
A health check is a mechanism to monitor the availability and health of your endpoints or API Gateways. You can configure health checks for both endpoints and API Gateways. Like load-balancing and failover, health checks are backend services.
To ensure that you are prepared to use health checks, make sure that you are familiar with the following concepts:
-
Trigger: define what triggers the health checks.
- HTTP methods
- Paths
- Headers
- Schedule: the schedule at which health checks can be triggered. These can be configured in seconds, minutes, hours, days, weeks, months, and years.
-
From root path: enable this to apply the specified path at the root URL level. For example, if your endpoint URL is
www.test.com/api, this option removes/apibefore appending the path. -
Assertions: where you specify any specific conditions to test for in the API response that will trigger a health check. Assertions are written in Expression Language. An assertion can be a simple
200response (#response.status == 200), but you can also test for specific content.
After configuring health checks, you can view health check information and results in the Health-check dashboard for that specific API. Here, you have multiple charts to track:
- Global availability: average availability and average response times for all health-checked endpoints.
- Per-endpoint availability: average availability and average response times for specific endpoints.
- Latest check: a running list of the most recent health checks. You can choose to show only status transitions.
Enable health check analytics for a v4 API
- Open your API and select Endpoints.
- Select Edit for the endpoint group.
-
Select the Health-check tab.
- Turn on the Enabled toggle.
- Configure the schedule (preset intervals or a custom cron expression), the HTTP Method, and the Target path. Turn on Override endpoint path to replace the endpoint's path instead of appending to it.
- Optionally, add HTTP headers and an Expression Language Assertion (for example,
{#response.status == 200}), and set the Success Threshold and Failure Threshold (default:2). - Deploy the API to start the health-check service.
Enable health check analytics for a v2 API
-
Open your v2 API and navigate to Backend services → Health-check.
-
Turn on the Enable health-check toggle.
- Configure the trigger, schedule, and assertions as needed.
To view health check results for a specific v2 API, navigate to Backend services → Health-check dashboard. To view health check status across all APIs, navigate to Dashboard → API Health Check in the main menu.
Logging
You can enable logs at the API level. Use logging with caution and only for development purposes. It requires more space for analytics storage and can impact API performance.
Enable logging for a v4 API
- Open your API and select API Traffic.
-
Select the Settings tab.
- Turn on the Enabled toggle.
- Configure the Logging mode (Entrypoint, Endpoint), Logging phase (Request, Response), and Content data (Headers, Payload).
- Optionally, add Display conditions written in Expression Language to filter which requests are logged.
Enable logging for a v2 API
-
Open your API and select Logs.
- Select Configure the logging.
-
Choose your logging, content, and scope modes.
View log records
Runtime logs let you analyze your API's usage. To view the runtime logs associated with calls to your API:
- v4 APIs – Open your API and select API Traffic → Runtime Logs. Filter by period, entrypoint, HTTP method, or plan.
- v2 APIs – Open your API and select Logs in the submenu.
You can also review logs for a specific application at Applications → your application → Logs, filtered by request or transaction ID, method, path, response time, HTTP status, or API.
Notifications
Enable notifications at the API, application, or system level.
Enable API notifications
-
Open your API and navigate to the notification settings:
- v4 APIs – Select Configuration → Notifications.
- v2 APIs – Select Notification settings.
-
Select + Add notification.
- Choose the events to subscribe to, grouped by categories such as API key, Subscription, Support, Lifecycle, Rating, and Review.
Delete API notifications
- Navigate to your API's notification settings (see the preceding paths).
- Select the delete icon for the notification you want to delete.
- Confirm that you want to delete the notification.
Enable application notifications
- Select Applications in the main menu and open your application.
- Select Notification settings.
- Select + Add notification and configure the notification using a Portal, Email, or Webhook notifier.
Enable system notifications
- Select Settings in the main menu.
- Under the Notifications heading, select Notification settings.
-
Select + Add notification.
- Enter a Name and select a Notifier (Default Email Notifier or Default Webhook Notifier).
- After creating the notification, edit it to choose the events to subscribe to.