Skip to main content

Moesif analytics

Overview​

The Analytics feature enables the API Platform to capture, process, and publish API request and response data for observability and business insights. Analytics data is collected asynchronously from the gateway without impacting request latency and is published to an external analytics platform for further analysis and visualization.

This capability allows platform administrators and business stakeholders to gain visibility into API usage patterns, traffic behavior, latency characteristics, and consumer activity across the platform.

Features​

  • Asynchronous collection of API request and response data
  • Policy-enriched analytics metadata capture
  • Zero impact on request/response latency
  • Batched and configurable publishing to external analytics platforms
  • Horizontally scalable analytics processing pipeline
  • Pluggable publisher model (supports multiple analytics backends)

Prerequisites​

  • Active Moesif Account and an Application ID

Note: For obtaining the Application ID:

  • Step 1: Sign up in Moesif
  • Sept 2: Follow the onboarding wizard.
  • Sept 3: During the sign up process, you will receive a Collector Application ID for your configured application. Copy this value and keep it saved.

For more detailed instructions and advanced configuration options, refer to the official Moesif Documentation.

Configuration​

Analytics is configured entirely through the gateway config.toml file and is enabled at a system level.

System Parameters (config.toml)​

Analytics​

ParameterTypeRequiredDefaultDescription
enabledbooleanYesfalseEnables or disables analytics globally

Publishers​

ParameterTypeRequiredDescription
typestringYesAnalytics publisher type (Currently limited only to moesif )
enabledbooleanYesEnables the publisher
settingsobjectYesMap of Publisher specific attributes required for configuring the publisher client

gRPC Event Server​

This section configures both the Envoy access log streaming settings and the ALS (Access Log Service) server that receives those logs. The ALS server runs within the policy-engine component.

ParameterTypeRequiredDefaultDescription
buffer_flush_intervaldurationNo1000000000Maximum time Envoy waits(in nanoseconds) before flushing buffered access log entries.
buffer_size_bytesintNo16384Maximum size of the in-memory buffer used to batch access log entries before sending them to ALS server.
grpc_request_timeoutdurationNo20000000000Timeout duration Envoy waits(in nanoseconds) for a response from the ALS server before considering the log delivery attempt failed.
server_portintYes-gRPC port on which the ALS server listens for incoming access log streams from Envoy.
shutdown_timeoutintNo600Maximum time allowed for the ALS server to gracefully shut down while completing in-flight log processing(in seconds).
als_plain_textbooleanNotrueUse plaintext gRPC
public_key_pathstringNo-Path to the public key used for securing ALS communication when transport-level encryption or authentication is enabled.
private_key_pathstringNo-Path to the private key used for securing ALS communication when transport-level encryption or authentication is enabled.
max_message_sizeintNo1000000000Maximum size of a single gRPC message that the ALS server is allowed to receive from Envoy.
max_header_limitintNo8192Maximum allowed size of request or response headers processed by the ALS server

Note: The hostname for the ALS connection is automatically derived from the policy-engine configuration. The internal log name identifier is set to "envoy_access_log" and is not configurable.

Configuration Examples​

Integrate Moesif Publisher​

For Moesif analytics integration, the following publisher-specific attributes must be configured under the settings section. These parameters control authentication, batching behavior, and publish intervals for efficient analytics delivery. The required attributes are as follows.

ParameterTypeRequiredDescription
application_idstringYesAnalytics platform application identifier
publish_intervalintYesInterval (seconds) between publish cycles
event_queue_sizeintYesMaximum events held in memory
batch_sizeintYesMaximum events per batch
timer_wakeup_secondsintYesPublisher timer resolution
[analytics]
enabled = true

[[analytics.publishers]]
type = "moesif"
enabled = true

[analytics.publishers.settings]
application_id = "<MOESIF_APPLICATION_ID>"
publish_interval = 5
event_queue_size = 10000
batch_size = 50
timer_wakeup_seconds = 3

[analytics.grpc_event_server]
buffer_flush_interval = 1000000000
buffer_size_bytes = 16384
grpc_request_timeout = 20000000000
server_port = 18090
shutdown_timeout = 600
als_plain_text = true
max_message_size = 1000000000
max_header_limit = 8192

Use Cases​

  • API Usage Visibility – Understand how APIs are consumed across tenants and applications.
  • Operational Insights – Observe traffic volume, response behavior, and latency trends.
  • Business Intelligence – Support product and business decisions using API analytics data.
  • Platform Monitoring – Gain observability into API behavior without impacting performance.

Was this page helpful?