Skip to content

Releases: wso2/apim-analytics-publisher

APIM Analytics Publisher 0.1.2

27 Jan 05:24

Choose a tag to compare

Pre-release

apim-analytics-publisher

This release contains the initial data publisher for Choreo Analytics cloud. Data publisher is responsible for sending analytics
data into Azure cloud for processing and visualization.

Whats New

This release introduce Choreo metric reporter which has the capability to capture metrics and send those to APIM analytics cloud. Current implementation uses a flat metrics schema and SAS token based authentication approach which will be changed in the subsequent releases. Please refer How To Use section for documentation.

##Prerequisites

  • SAS Token is needed to publish events into Azure. During pre-release period only selected people will have access. If you require access please contact a project coordinator
  • You will need to have following dependency jars to run this client
  • proton-j-0.33.4
  • azure-core-amqp-1.6.0
  • azure-core-1.9.0
  • azure-messaging-eventhubs-5.3.1
  • reactor-core-3.3.9

How to Use

Below is an example snippet on how to use the Metric Reporter Implementation. For this release only the sas.token config will be used. For other configuration keys just add some value. Leaving them empty will cause validation issues.

//Create the configuration map. All relevant configs will be passed as a map
Map<String, String> configs = new HashMap<>();
configs.put("token.api.url", "localhost/token-api");
configs.put("auth.api.url", "localhost/auth-api");
configs.put("consumer.secret", "your_secret");
configs.put("consumer.key", "your_key");
//Contact a project contributor to obtain your sas token
configs.put("sas.token", "your_sas_token");

//Create metric reporter using the configs we created earlier. Class name is passed as null as we are using the default class
MetricReporter metricReporter = MetricReporterFactory.getInstance().createMetricReporter(null, configs);
//Obtain a counter metric using the Reporter we created. Metric name will be unique per JVM and 
//asking for another metric with the same name will return the previously created metric.
CounterMetric counterMetric = metricReporter.createCounterMetric("apim.response", MetricSchema.RESPONSE);

//Create the static event to send. Required fields are documented in InputValidator class.
Map<String, String> event = new HashMap<>();
event.put("correlationId", "12345");
event.put("keyType", "pub_key");
event.put("apiId", "121");
event.put("apiName", "pizzashak");
event.put("apiVersion", "1.0.0");
event.put("responseCode", "200");
event.put("apiCreator", "admin");
event.put("apiMethod", "GET");
event.put("apiResourceTemplate", "GET");
event.put("apiCreatorTenantDomain", "carbon.super");
event.put("destination", "localhost");
event.put("applicationId", "5");
event.put("applicationName", "pizza-app");
event.put("applicationConsumerKey", "consumer_key");
event.put("applicationOwner", "admin");
event.put("regionId", "2");
event.put("gatewayType", "synapse");
event.put("userAgent", "Mozilla");
event.put("responseCacheHit", "false");
event.put("responseLatency", "2000");
event.put("backendLatency", "3000");
event.put("requestMediationLatency", "250");
event.put("responseMediationLatency", "1750");
event.put("deploymentId", "1");

//Increment the metric. This will trigger a creation of a json message and then publisher client will 
//send the message to APIM analytics cloud.
counterMetric.incrementCount(event);

APIM Analytics Release 0.0.2

11 Jan 15:35

Choose a tag to compare

Pre-release

apim-analytics-publisher

This release contains the initial data publisher for Choreo Analytics cloud. Data publisher is responsible for sending analytics
data into Azure cloud for processing and visualization.

Install

Install from source

  • Clone this tag
  • Build the source using mvn clean install
  • You can find the executable at <Repo_Home>/component/data-publisher/target/org.wso2.am.analytics.publisher .client-0.0.2-jar-with-dependencies.jar

Download from releases

  • Download the attached jar

APIM Analytics Release 0.0.1

23 Dec 12:16
a369df2

Choose a tag to compare

Pre-release

apim-analytics-publisher

This release contains the initial data publisher for Choreo Analytics cloud. Data publisher is responsible for sending analytics
data into Azure cloud for processing and visualization.

Install

Install from source

  • Clone this tag
  • Build the source using mvn clean install
  • You can find the executable at <Repo_Home>/component/data-publisher/target/org.wso2.am.analytics.publisher .client-0.0.1-jar-with-dependencies.jar

Download from releases

  • Download the attached jar