Skip to main content

Installing Statistics Collection service

Installing the Statistics Collection service is optional if you do not plan to collect and analyze usage statistics for API keys used with the API Platform services.

Important note:

All passwords and keys in this section are given for illustration purposes.

During a real installation, it is recommended to use more complex and reliable passwords.

1. Before installing

  1. Consider getting familiar with:

  2. Make sure the necessary preparation steps are completed:

    1. Preparation for installation
    2. Installing License service
    3. Installing API Keys service
  3. Collect the necessary information that was set or retrieved on previous steps:

    ObjectExample valueHow to get value
    Docker Registry mirror endpointdocker.storage.example.local:5000See Fetching installation artifacts
    Kubernetes secret for accessing Docker Registryonpremise-registry-credsSee Fetching installation artifacts
  4. Make sure that the resource requirements specified in the Helm chart are met.

    For more information on how to do this, refer to the System requirements document.

    Note

    Contents of the Helm chart described in this chapter are relevant for the latest API Platform version (see API Platform releases). To find parameters for earlier versions, open the values.yaml on GitHub and select a Platform-<version> tag in the tag switcher on the left.

  5. Choose a domain name for the statistics collection service. For example: stat-receiver.example.com.

2. Install the Statistics Collection service

  1. Create a Helm configuration file. See here for more details on the available settings.

    The example is prefilled with the necessary data collected on previous steps.

    values-stat-receiver.yaml
    dgctlDockerRegistry: docker.storage.example.local:5000

    kafka:
    servers: 'keys-kafka.storage.example.local:9092'
    truststore:
    enabled: false
    keystore:
    enabled: false
    sasl:
    enabled: true
    secretName: 'stat-receiver-kafka-creds'
    jaasLoginModule: 'org.apache.kafka.common.security.scram.ScramLoginModule'
    username: ''
    password: ''
    initializeTopics:
    enabled: true
    topicsPrefix: 'stat_master_'

    Where:

    • dgctlDockerRegistry: endpoint of your Docker Registry with the images of the On-Premise services.

    • kafka: Apache Kafka access settings.

      • servers: address and port of the Apache Kafka cluster that was configured during the Installation of the API Keys service.

      • truststore.enabled: enable to use TLS for connecting to Kafka.

      • keystore.enabled: enable to use client authentication TLS for connecting to Kafka.

      • sasl: settings for SASL connection to Kafka.

        • enabled: enable if SASL authentication is also enabled in the API Keys service.
        • secretName: Kubernetes secret name, where the credentials for connecting to Kafka are stored. The name must be unique within the cluster namespace used for installation.
        • jaasLoginModule: JAAS configuration string for SASL connection.
        • username: username for connecting to Kafka. Required if the secretName field is empty.
        • password: password for connecting to Kafka. Required if the secretName field is empty.
    • initializeTopics.enabled: enable to have the statistics collection service create the necessary topics in Kafka on first startup.

    • topicsPrefix: prefix for the names of the topics that will be created in Kafka. See the name of the topic you specified in the kafka.stats.topic parameter in the API Keys service configuration file: the prefix is the initial part of the topic name up to type.401 (fixed part of the name).

  2. Deploy the service with Helm using the created values-stat-receiver.yaml configuration file:

    helm upgrade --install --version=VERSION --atomic --wait --timeout 7200s --values ./values-stat-receiver.yaml stat-receiver 2gis-on-premise/stat-receiver

    In the --version parameter, specify the required API Platform version. For a list of versions, see the API Platform releases section.

3. Test deployment

When you install all the necessary API Platform services, you will be able to view their usage statistics and configure limits in the web interface of the API Keys service.

What's next?