Unknown macro: {next_previous_links}
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

In WSO2 API Manager (WSO2 APIM), you can configure Analytics either via the UI or XML.

If you wish to configure Analytics in WSO2 API Manager via the UI, see Publishing API Runtime Statistics.

Follow the instructions below to configure Analytics in WSO2 API Manager using XML:

  1. Open the <APIM_HOME>/repository/conf/api-manager.xml file.
  2. Carry out the following configuration changes under the <APIUsageTracking> element in the XML file.
    1. Enable Analytics in APIM by uncommenting and setting the <Enabled> element to true.

      <Enabled>true</Enabled>
    2. Define the <DASServerURL> value based on the Data Analytics Server (DAS) receivers.

      Example
      <DASServerURL> {tcp://localhost:7612/,tcp://localhost:7613/} </DASServerURL>
    3. Define the <DASUsername> and <DASPassword> based on the DAS receivers.

    4. Define the <DASRestApiURL> element according to the DAS master node, because this URL is used to fetch data from DAS REST API.

    5. Set the <DASRestApiUsername> and <DASRestApiPassword> element according to the DAS REST API.

    Use the default configurations for the other configurations in the <APIUsageTracking> section.

    <!--
            API usage tracker configuration used by the DAS data publisher and
            Google Analytics publisher in API gateway.
        -->
        <APIUsageTracking>
    
            <!--
                Below property is used to enable API Manager analytics configuration via api-manager.xml
                Enabling analytics via a configuration file can be useful in scenarios such as automated deployments where
                UI integration is inconvenient.
    
                If you uncomment this property, analytics configurations added via admin-dashboard UI will
                get overwritten by tha configuration details provided below when you restart the server.
            -->
            <Enabled>true</Enabled>
    
            <!--
                Server URL of the remote DAS/CEP server used to collect statistics. Must
                be specified in protocol://hostname:port/ format.
    
                An event can also be published to multiple Receiver Groups each having 1 or more receivers. Receiver
                Groups are delimited by curly braces whereas receivers are delimited by commas.
            Ex - Multiple Receivers within a single group
             tcp://localhost:7612/,tcp://localhost:7613/,tcp://localhost:7614/
            Ex - Multiple Receiver Groups with two receivers each
                     {tcp://localhost:7612/,tcp://localhost:7613},{tcp://localhost:7712/,tcp://localhost:7713/}
            -->
            <DASServerURL>{tcp://localhost:7612/}</DASServerURL>
    
            <!--
                Administrator username to login to the remote DAS server.
            -->
            <DASUsername>admin</DASUsername>
    
            <!--
                Administrator password to login to the remote DAS server.
            -->
            <DASPassword>admin</DASPassword>
    
            <!--
                DAS REST API configuration
                    Set the values if .'org.wso2.carbon.apimgt.usage.client.impl.APIUsageStatisticsRestClientImpl'
                    is used as Statistic Client
            -->
            <DASRestApiURL>https://localhost:9444</DASRestApiURL>
            <DASRestApiUsername>admin</DASRestApiUsername>
            <DASRestApiPassword>admin</DASRestApiPassword>
    
            <!--
                Below property is used to skip trying to connect to event receiver nodes when publishing events even if
                the stats enabled flag is set to true.
            -->
            <SkipEventReceiverConnection>false</SkipEventReceiverConnection>
    
            <!--
                API Usage Data Publisher.
            -->
            <PublisherClass>org.wso2.carbon.apimgt.usage.publisher.APIMgtUsageDataBridgeDataPublisher</PublisherClass>
    
            <!--
                If below property set to true,then the response message size will be calculated and publish 
                with each successful API invocation event.
            -->
            <PublishResponseMessageSize>false</PublishResponseMessageSize>
            <!--
                    Data publishing stream names and versions of API requests, responses and faults. If the default values
                    are changed, the toolbox also needs to be changed accordingly.
            -->
            <Streams>
                <Request>
                    <Name>org.wso2.apimgt.statistics.request</Name>
                    <Version>1.0.0</Version>
                </Request>
                <Response>
                    <Name>org.wso2.apimgt.statistics.response</Name>
                    <Version>1.0.0</Version>
                </Response>
                <Fault>
                    <Name>org.wso2.apimgt.statistics.fault</Name>
                    <Version>1.0.0</Version>
                </Fault>
                <Destination>
                    <Name>org_wso2_apimgt_statistics_destination</Name>
                    <Version>1.0.0</Version>
                    <BAMProfileName>bam-profile</BAMProfileName>
                </Destination>
                <Throttle>
                    <Name>org.wso2.apimgt.statistics.throttle</Name>
                    <Version>1.0.0</Version>
                </Throttle>
                <Workflow>
                    <Name>org.wso2.apimgt.statistics.workflow</Name>
                    <Version>1.0.0</Version>
                </Workflow>
            </Streams>
    
        </APIUsageTracking>
  3. Configure the statistics client.

  4. Deploy CApp.
    As the summarization logic is defined in the DAS CApp, you need to depoy it in all the DAS nodes. When configuring Analytics using XML, you need to deploy the CApp manually.

    If you were to configure Analytics via the UI the CApp deployment process takes place automatically. 

    Use one of the following methods to deploy the CApp into DAS.

    1. Deploy the CApp via the file system.
      1. Copy the respective CAR file into the <DAS_HOME>/repository/deployment/server/carbonapps directory.

        Stats ClientCAR file
        RDBMS client<APIM_HOME>/statistics/API_Manager_Analytics_RDBMS.car 
        REST client<APIM_HOME>/statistics/API_Manager_Analytics_REST.car

        If the /carbonapps directory does not exist create the directory. 

      2. Restart WSO2 DAS.
    2. Deploy the CApp via the UI

      1. Start WSO2 DAS and sign in to the DAS Management Console. 

      2. Navigate to the main menu and click Carbon Applications

      3. Click Add and deploy the CApp which is in the <APIM_HOME>/statistics directory.

  • No labels