Configure API Gateway Analytics

Overview

This topic describes how to update API Gateway Analytics configuration (for example, the API Gateway Analytics port, database connection, and user credentials) before starting API Gateway Analytics. You can use the configureserver script (recommended) to guide you through all the required steps, or you can use Policy Studio to configure the API Gateway Analytics configuration file.

Prerequisites

The prerequisites for configuring API Gateway Analytics are as follows:

Install API Gateway

Because API Gateway Analytics reports on transactions processed by API Gateway in real time, you must first install API Gateway. For more details, see Install the API Gateway Core Server.

[Important] Important

To view API Gateway metrics in API Gateway Analytics, you must also configure API Gateway to record metrics in the database. For more details, see the Oracle API Gateway Administrator Guide.

Install API Gateway Analytics

You must install API Gateway Analytics. For details on how to install API Gateway Analytics, see the Install API Gateway Analytics topic.

Configure a database

You must install a JDBC-compliant database to store the API Gateway monitoring and transaction data. For more details, see Configure the database for API Gateway Analytics.

Update API Gateway Analytics configuration

By default, API Gateway Analytics is configured to read message metrics from a MySQL database stored on the local machine. You can use the configureserver command to configure API Gateway Analytics to use an alternative database, change the user credentials on the default database connection, or use a different listening port.

Update configuration on the command line

Perform the following steps to run configureserver in interactive mode:

  1. Change to the following directory:

    Windows INSTALL_DIR\oaganalytics\Win32\bin
    Linux/UNIX INSTALL_DIR/oaganalytics/posix/bin


  2. Run the configureserver command.

  3. Enter the port on which the API Gateway Analytics server will listen. Defaults to 8040. If you have another process already using this port on the machine on which API Gateway Analytics is installed, configure API Gateway Analytics to listen on different port.

  4. Enter the database connection URL. Defaults to dbc:mysql://127.0.0.1:3306/reports.

    The following table lists examples of connection URLs for the supported databases, where reports is the name of the database and DB_HOST is the IP address or host name of the machine on which the database is running:

    Database Example Connection URL
    Oracle jdbc:oracle:thin:@DB_HOST:1521:reports
    Microsoft SQL Server jdbc:sqlserver://DB_HOST:1433;DatabaseName=reports;integratedSecurity=false;
    MySQL jdbc:mysql://DB_HOST:3306/reports
    IBM DB2 jdbc:db2://DB_HOST:50000/reports


  5. Enter the database user name. Defaults to root.

  6. Enter the database password.

  7. Enter whether API Gateway Analytics generates PDF-based reports. Defaults to N, which means that PDF reports are not generated. When set to Y, API Gateway Analytics generates PDF reports that include the same metrics displayed in the API Gateway Analytics screen (for example, number of client requests, requests per service, and so on). For more details on generated PDF reports, see the Oracle API Gateway Administrator Guide.

  8. Enter the user name to connect to the API Gateway Analytics process that generates PDF reports. Defaults to an admin user.

    [Note] Note

    This is not the operating system user. This is the user that connects to the API Gateway Analytics web server process, which generates the PDF reports. You can add new users under the Users and Groups node in Policy Studio.

  9. Enter the password to connect to the API Gateway Analytics process that generates PDF reports.

  10. Enter the directory to which generated PDF reports are output (for example, c:\reports).

  11. Enter whether to send generated PDF reports to email recipients. You will require an SMTP account with which to send the reports. Defaults to N.

The following command shows some example output in interactive mode:

C:\Oracle\oaganalytics\Win32\bin>configureserver.bat
Connecting to configuration at : federated:file:///C:\Oracle\oaganalytics/conf/fed/
configs.xml

Listening port [8040]:
Configuring Database: Default Database Connection
Database URL [jdbc:mysql://127.0.0.1:3306/reports]:
Database user name [root]:
Database password []: *****
Enable report generation (Y, N) [N]: y
Report generation process connects as user name [admin]:
Report generation process connects using password []: ********
Report output directory []: c:\reports
Email reports (Y, N) [N]: y
Default email recipient []: joe@example.com
Email from []: apigateway@oracle.com
Choose SMTP connection type:
   0) None
   1) SSL
   2) TLS/SSL
Choice [0]:
SMTP host []: localhost
SMTP port [25]:
SMTP user name []: jbloggs
SMTP password []: *********
Delete report file after emailing (Y, N) [Y]:
Press enter to exit...

Update configuration using command-line options

You can also run the configureserver command with various options (--port, --dburl, --emailfrom, --emailto, --smtphost, and so on). For example, the following command configures the database connection without emailing reports:

configureserver --dburl=jdbc:mysql://127.0.0.1:3306/631v2 --dbuser=root 
--dbpass=changeme --no-email

The following command specifies to email reports and the associated SMTP settings:

configureserver --dburl=jdbc:mysql://127.0.0.1:3306/reports --dbuser=root 
--dbpass=changeme –-email --emailto=joe@example.com --emailfrom=apigateway@oracle.com 
--smtptype=NONE --smtphost=192.168.0.174 --smtpport=25 --smtpuser=jbloggs 
--smtppass=changeme --generate --gpass=changeme --gtemp=c:\reports

For descriptions of all available options, enter the configureserver --help command.

Update configuration in Policy Studio

The recommended way to configure API Gateway Analytics is using the configureserver command, which guides you through the required settings. However, you can also use the Policy Studio to configure specific settings in your API Gateway Analytics configuration file. For example, to configure the reports database, perform the following steps:

  1. In your Policy Studio installation directory, run the policystudio command.

  2. On the Policy Studio Home tab, click Open File, and browse to your API Gateway Analytics configuration file, for example:

    INSTALL_DIR/oaganalytics/conf/fed/configs.xml

  3. Click the External Connections button on the left of Policy Studio, and expand the Default Database tree node.

  4. Right-click the Default Database Connection tree node, and select Edit.

  5. The Database Connection dialog enables you to configure the database connection details. By default, the connection is configured to read metrics data from the reports database. Edit the details for the Default Database Connection on this dialog. For example, you should enter a non-default database user name and password. If you wish to connect to a database other than the default local database, right-click Database Connections in the tree, and select Add a Database Connection. For more details, see the Oracle API Gateway User Guide.

[Note] Note

You can verify that your database connection is configured correctly by clicking the Test Connection button on the Configure Database Connection dialog.