All Products
Search
Document Center

Simple Log Service:Collect monitoring data from MongoDB databases

Last Updated:Feb 02, 2024

MongoDB databases support multiple metrics. You can collect metrics from MongoDB databases to the Full-stack Observability application. This way, you can monitor the metrics in a visualized manner.

Prerequisites

A Full-stack Observability instance is created. For more information, see Create an instance.

Procedure

  1. Log on to the Simple Log Service console.

  2. In the Log Application section, click the Intelligent O&M tab. Then, click Full-stack Observability.

  3. On the Simple Log Service Full Stack Observability page, click the instance that you want to manage.

  4. In the left-side navigation pane, click Full-stack Monitoring.

    If this is your first time to use Full-stack Monitoring in the instance, click Enable.

  5. In the left-side navigation tree, click Data Import. On the Data Import Configurations page, find MongoDB in the Database Monitoring section.

    The first time you create a Logtail configuration for host monitoring data, turn on the switch to go to the configuration page. If you created a Logtail configuration, click the 创建 icon to go to the configuration page.

  6. Create a machine group.

    • If a machine group is available, click Use Existing Machine Groups.
    • If no machine groups are available, perform the following steps to create a machine group. In this example, an Elastic Compute Service (ECS) instance is used.
      1. On the ECS Instances tab, select Manually Select Instances. Then, select the ECS instance that you want to use and click Create.
        For more information, see Install Logtail on an ECS instance.
        Important If your server is an ECS instance that belongs to another Alibaba Cloud account, a server provided by a third-party cloud service provider, or a server deployed in a self-managed data center, you must manually install Logtail V0.16.48 or later on the Linux server. For more information, see Install Logtail on a Linux server. After you install Logtail, you must manually configure a user identifier on the server. For more information, see Configure a user identifier.
      2. After Logtail is installed, click Complete Installation.
      3. In the Create Machine Group step, configure the Name parameter and click Next.

        Simple Log Service allows you to create IP address-based machine groups and custom identifier-based machine groups. For more information, see Create an IP address-based machine group and Create a custom identifier-based machine group.

    Important Make sure that the server on which you want to install Logtail can connect to the Kafka server whose monitoring data you want to collect.
  7. Confirm that the machine group is displayed in the Applied Server Groups section and click Next.

    Important

    If you apply a machine group immediately after you create the machine group, the heartbeat status of the machine group may be FAIL. This issue occurs because the machine group is not connected to Simple Log Service. To resolve this issue, you can click Automatic Retry. If the issue persists, see What do I do if no heartbeat connections are detected on Logtail?

  8. In the Specify Data Source step, configure the parameters and click Complete. The following table describes the parameters.

    Parameter

    Description

    Configuration Name

    The name of the Logtail configuration. You can enter a custom value.

    Cluster Name

    The name of the MongoDB cluster. You can enter a custom value.

    After you configure this parameter, Simple Log Service adds a cluster=Cluster name tag to the MongoDB monitoring data that is collected by using the Logtail configuration.

    Important

    Make sure that the cluster name is unique. Otherwise, data conflicts may occur.

    Server List

    The information about the MongoDB database.

    • Address: the address of the MongoDB database. You can enter the IP address, hostname, or domain name of the server that hosts the database.

    • Port: the port number of the MongoDB database. Default value: 3717.

    • Account: the username of the account that you use to connect to the MongoDB database.

      Note

      We recommend that you create a dedicated account to monitor the data of the MongoDB database and grant the account only the permissions that are required to monitor data.

    • Password: the password of the account that you use to connect to the MongoDB database.

    You can add information about multiple MongoDB databases based on your business requirements.

    Custom Tags

    The custom tags that are added to the collected MongoDB monitoring data. The tags are key-value pairs.

    After you configure this parameter, Simple Log Service adds the custom tags to the MongoDB monitoring data that is collected by using the Logtail configuration.

    Custom Telegraf Configurations

    Simple Log Service collects MongoDB monitoring data by using Telegraf. Telegraf is an open source tool that is used to collect metrics. If the preceding default parameters do not meet your business requirements, you can use Custom Telegraf Configurations to configure custom parameters. For more information about Telegraf, see Telegraf. For more information about configuration examples, see Configuration.

    For more information about the metrics that can be collected, see Metrics.

    After you configure the settings, Simple Log Service automatically creates assets such as Metricstores. For more information, see Assets.

What to do next

After MongoDB monitoring data is collected to Simple Log Service, the Full-stack Observability application automatically creates dedicated dashboards for the monitoring data. You can use the dashboards to analyze the monitoring data. For more information, see View dashboards.