Yandex Cloud
Search
Contact UsGet started
  • Blog
  • Pricing
  • Documentation
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • ML & AI
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Customer Stories
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Education and Science
    • Yandex Cloud Partner program
  • Blog
  • Pricing
  • Documentation
© 2025 Direct Cursus Technology L.L.C.
Yandex Managed Service for PostgreSQL
  • Getting started
    • All tutorials
    • Creating a PostgreSQL cluster for 1C
    • Creating a cluster of 1C:Enterprise Linux servers with a Managed Service for PostgreSQL cluster
    • Exporting a database to Yandex Data Processing
    • Searching for cluster performance issues
    • Performance analysis and tuning
    • Setting up a connection from a Serverless Containers container
    • Delivering data to Yandex Managed Service for Apache Kafka® using Yandex Data Transfer
    • Delivering data to Yandex Managed Service for YDB using Yandex Data Transfer
    • Delivering data to Yandex Managed Service for Apache Kafka® using Debezium
    • PostgreSQL change data capture and delivery to YDS
    • Delivering data from Yandex Managed Service for Apache Kafka® using Yandex Data Transfer
    • Transferring data from Yandex Object Storage using Yandex Data Transfer
    • Configuring a fault-tolerant architecture in Yandex Cloud
    • Status monitoring of geographically distributed devices
    • Writing load balancer logs to PostgreSQL
    • Creating an MLFlow server for logging experiments and artifacts
    • Working with data using Query
    • Federated data queries using Query
    • Fixing string sorting issues after upgrading _glibc_
    • Writing data from a device into a database
  • Access management
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • Getting started
  • Required paid resources
  • Get your cloud ready
  • Create a cluster in Managed Service for PostgreSQL
  • Create the required Yandex IoT Core resources
  • Create a registry and configure authorization with your login and password
  • Create devices and configure authorization with your login and password
  • Create a device emulator in Cloud Functions
  • Create a function that emulates transmitting data from the device
  • Test the emulation function
  • Create a trigger to call the emulation function once per minute
  • Create a function for processing data in Cloud Functions .
  • Create a function for processing received data
  • Test the data processing function
  • View the data processing result in Managed Service for PostgreSQL
  • Create a trigger to call the data processing function
  • View the trigger result in Managed Service for PostgreSQL
  • Configure monitoring in DataLens
  • Set up a connection to Managed Service for PostgreSQL
  • Create a dataset
  • Create a chart for temperature and mains voltage
  • Create a chart with a map
  • Create a dashboard
  • How to delete the resources you created
  1. Tutorials
  2. Status monitoring of geographically distributed devices

Status monitoring of geographically distributed devices

Written by
Yandex Cloud
Updated at May 7, 2025
  • Getting started
    • Required paid resources
  • Get your cloud ready
  • Create a cluster in Managed Service for PostgreSQL
  • Create the required Yandex IoT Core resources
    • Create a registry and configure authorization with your login and password
    • Create devices and configure authorization with your login and password
  • Create a device emulator in Cloud Functions
    • Create a function that emulates transmitting data from the device
    • Test the emulation function
    • Create a trigger to call the emulation function once per minute
  • Create a function for processing data in Cloud Functions .
    • Create a function for processing received data
    • Test the data processing function
    • View the data processing result in Managed Service for PostgreSQL
    • Create a trigger to call the data processing function
    • View the trigger result in Managed Service for PostgreSQL
  • Configure monitoring in DataLens
    • Set up a connection to Managed Service for PostgreSQL
    • Create a dataset
    • Create a chart for temperature and mains voltage
    • Create a chart with a map
    • Create a dashboard
  • How to delete the resources you created

In this tutorial, you will configure status monitoring for devices (e.g., vending machines) connected to Yandex IoT Core and located at various sites throughout the city. You can monitor the status of vending machines on the Yandex DataLens map and charts. To emulate sensors, we will use Yandex Cloud Functions. If you have any connected sensors, use them. Yandex Managed Service for PostgreSQL will be used to store data.

The source code for the tutorial is available in a GitHub repository.

To configure monitoring of sensor readings:

  1. Get your cloud ready.
  2. Create a Managed Service for PostgreSQL cluster.
  3. Create the required Yandex IoT Core resources.
  4. Create a device emulator in Cloud Functions.
  5. Create a function for processing data in Cloud Functions.
  6. Configure monitoring in DataLens.

If you no longer need the resources you created, delete them.

Getting startedGetting started

Sign up in Yandex Cloud and create a billing account:

  1. Navigate to the management console and log in to Yandex Cloud or register a new account.
  2. On the Yandex Cloud Billing page, make sure you have a billing account linked and it has the ACTIVE or TRIAL_ACTIVE status. If you do not have a billing account, create one and link a cloud to it.

If you have an active billing account, you can navigate to the cloud page to create or select a folder for your infrastructure to operate in.

Learn more about clouds and folders.

Required paid resourcesRequired paid resources

The support cost includes:

  • Fee for using a public IP address (see Yandex Virtual Private Cloud pricing).
  • Fee for the number of messages (see Yandex IoT Core pricing).
  • Fee for the number of Cloud Functions function calls (see Yandex Cloud Functions pricing).
  • Fee for the Managed Service for PostgreSQL cluster computing resources and storage (see Yandex Managed Service for PostgreSQL pricing).

Get your cloud readyGet your cloud ready

  • Create a service account named my-emulator-function-service-account for data sending. Assign the functions.functionInvoker, iot.devices.writer, and viewer roles to it.

  • Create a service account named my-db-function-service-account for data processing. Assign the functions.functionInvoker and editor roles to it.

  • Create a cloud network and at least one subnet in the ru-central1-a, ru-central1-b, or ru-central1-d availability zone.

  • Create a security group named my-pg-sg and add a rule for incoming traffic:

    • Port range: 6432.
    • Protocol: TCP.
    • Source: CIDR.
    • CIDR blocks: 0.0.0.0/0.

Create a cluster in Managed Service for PostgreSQLCreate a cluster in Managed Service for PostgreSQL

The example is based on the minimum values of host parameters. For real tasks, it is better to choose hosts with a guaranteed 100% vCPU share.

Management console
  1. In the management console, select the folder you are using to complete this tutorial.

  2. From the list of services, select Managed Service for PostgreSQL.

  3. Click Create cluster.

  4. Specify a name for the cluster, e.g., my-pg-database.

  5. From the Environment list, select PRODUCTION.

  6. From the Version list, select 15.

  7. Under Host class, specify:

    • Platform: Intel Ice Lake.
    • Type: standard.
    • Class: s3-c2-m8 (2 vCPU, 8 GB).
  8. Under Size of storage:

    • Select network-hdd.
    • Specify the size of 10 GB.
  9. Under Database, specify:

    • DB name: db1.

    • Username: user1.

    • Password: Set a password to access the database.

      Note

      Save the password as you will need it for authentication.

    • Locale for sorting (LC_COLLATE): C.

    • Charset locale (LC_CTYPE): C.

  10. Under Network settings:

    1. Select the cloud network where you created the my-pg-sg security group.
    2. Select the my-pg-sg security group.
  11. Under Hosts:

    1. Leave a single host.
    2. Click .
    3. In the window that opens, enable Public access and click Save.
  12. Under Advanced settings, enable DataLens access and Access from the management console.

  13. Click Create cluster.

It may take a few minutes to create a cluster.

Create the required Yandex IoT Core resourcesCreate the required Yandex IoT Core resources

Registry and device are the main components of the Yandex IoT Core service used for exchanging data and commands. Devices can only exchange data if created in the same registry.

Create a registry and configure authorization with your login and passwordCreate a registry and configure authorization with your login and password

Management console
  1. In the management console, select the folder you are using to complete this tutorial.

  2. From the list of services, select IoT Core.

  3. Click Create registry.

  4. In the Name field, enter a name for the registry, e.g., my-registry.

  5. In the Password field, set a password to access the registry. The password must be at least 14 characters long and contain lowercase letters, capital letters, and numbers. To create a password, you can use the password generator.

    Note

    Save the password as you will need it for authentication.

  6. Click Create.

You can also complete authorization using certificates. Learn more about authorization in Yandex IoT Core.

Create devices and configure authorization with your login and passwordCreate devices and configure authorization with your login and password

Create three devices: my-device-1, my-device-2, and my-device-3.

Management console
  1. In the management console, select the folder you are using to complete this tutorial.

  2. From the list of services, select IoT Core.

  3. Select the registry you created in the previous step.

  4. In the left-hand menu, select Devices.

  5. Click Add device.

  6. In the Name field, enter the device name: my-device-1.

  7. In the Password field, set a password to access the device. The password must be at least 14 characters long and contain lowercase letters, capital letters, and numbers. To create a password, you can use the password generator.

    Note

    Save the password as you will need it for authentication.

  8. Optionally, add an alias:

    1. Click Add alias.

    2. Fill in the fields: enter an alias, e.g., events, and the topic type after $devices/{id}, e.g., events.

      As the result, you will be able to use the events alias instead of the $devices/<device_ID>/events topic.

    3. Repeat the steps for each alias you add.

  9. Click Create.

  10. Similarly, create my-device-2 and my-device-3.

You can also complete authorization using certificates. Learn more about authorization in Yandex IoT Core.

Create a device emulator in Cloud FunctionsCreate a device emulator in Cloud Functions

The emulator will send data from the devices to the Managed Service for PostgreSQL cluster.

To run the emulator, create a function to emulate sending data from device sensors and a trigger to call this function once per minute.

Create a function that emulates transmitting data from the deviceCreate a function that emulates transmitting data from the device

Management console
  1. In the management console, select the folder you are using to complete this tutorial.

  2. From the list of services, select Cloud Functions.

  3. Create a function:

    1. Click Create function.
    2. In the Name field, enter a name for the function, e.g., my-device-emulator-function.
    3. Click Create.
  4. Create a function version:

    1. In the Editor window that opens, select Node.js 18.

    2. Disable the Add files with code examples option.

    3. Click Continue.

    4. In the Method field, select Code editor.

    5. Click Create file:

      • File name: device-emulator.js.
      • File contents: Function code from GitHub.
    6. Similarly, create a file named package.json with the following content:

      {
        "name": "my-app",
        "version": "1.0.0",
        "dependencies": {
          "yandex-cloud": "*"
        }
      }
      
    7. In the Entry point field, specify device-emulator.handler.

    8. Under Parameters, specify:

      • Timeout: 10

      • Memory: 128 MB

      • Service account: my-emulator-function-service-account

      • Environment variables:

        Key Description Value
        CASH_DRAWER_SENSOR_VALUE Percentage of used cash box space 67.89
        TEMPERATURE_SENSOR_VALUE Baseline temperature in the pickup box 10.34
        POWER_SENSOR_VALUE Baseline mains voltage 24.12
        SERVICE_DOOR_SENSOR_VALUE State of the open service door sensor False
        ITEM1_SENSOR_VALUE Stock of product 1 50.65
        ITEM2_SENSOR_VALUE Stock of product 2 80.97
        ITEM3_SENSOR_VALUE Stock of product 3 30.33
        ITEM4_SENSOR_VALUE Stock of product 4 15.15
        REGISTRY_ID ID of the registry you created See the management console
        in Yandex IoT Core
    9. Click Save changes.

Test the emulation functionTest the emulation function

  1. (Optional) To get detailed information from the sensors, subscribe your registry to the Yandex IoT Core device topic.

    CLI

    If you do not have the Yandex Cloud CLI yet, install and initialize it.

    The folder specified when creating the CLI profile is used by default. To change the default folder, use the yc config set folder-id <folder_ID> command. You can specify a different folder using the --folder-name or --folder-id parameter.

    Run this command:

    yc iot mqtt subscribe \
      --username <registry_ID> \
      --password <registry_password> \
      --topic '$devices/<device_ID>/events/#' \
      --qos 1
    

    Where:

    • --username and --password: Credentials for authentication with a username and password.
    • --topic: Device topic for sending data or topic alias.
    • --qos: Quality of service (QoS).

    The command should run without interruption until you finish testing the function.

    For more information about the yc iot mqtt subscribe command, see the CLI reference.

  2. Test the emulation function:

    Management console
    1. In the management console, select the folder you are using to complete this tutorial.

    2. From the list of services, select Cloud Functions.

    3. Select the my-device-emulator-function function.

    4. In the left-hand menu, select Testing.

    5. In the Version tag list, select $latest, the most recent version of the function.

    6. Click Run test.

      If the function is successful, the Done status will be displayed in the Function status field and the result will appear in the Function output field:

      {
        "statusCode" : 200
      }
      

      If you subscribed to the Yandex IoT Core device topic before running the test, you will get the following JSON object in the terminal:

      {
        "DeviceId":"areulpu7dnou********",
        "TimeStamp":"2024-06-19T08:29:14Z",
        "Values":[
            {"Type":"Bool","Name":"Service door sensor","Value":"False"},
            {"Type":"Float","Name":"Power Voltage","Value":"24.91"},
            {"Type":"Float","Name":"Temperature","Value":"10.51"},
            {"Type":"Float","Name":"Cash drawer fullness","Value":"67.89"},
            {"Items":[
                {"Type":"Float", "Id":"1","Name":"Item 1","Fullness":"50.65"},
                {"Type":"Float", "Id":"2","Name":"Item 2","Fullness":"80.97"},
                {"Type":"Float", "Id":"3","Name":"Item 3","Fullness":"30.33"},
                {"Type":"Float", "Id":"4","Name":"Item 4","Fullness":"15.15"}
            ]}
            ]
        }
      

Create a trigger to call the emulation function once per minuteCreate a trigger to call the emulation function once per minute

Management console
  1. In the management console, select the folder you are using to complete this tutorial.

  2. From the list of services, select Cloud Functions.

  3. In the left-hand panel, select Triggers.

  4. Click Create trigger.

  5. In the Name field, enter a name for the trigger, e.g., my-emulator-function-trigger.

  6. In the Type field, select Timer.

  7. In the Cron expression field, select Every minute.

  8. Under Function settings, specify the function parameters:

    • Function: my-device-emulator-function.
    • Function version tag: $latest.
    • Service account: my-emulator-function-service-account.
  9. (Optional) In the Repeat request settings and Dead Letter Queue settings sections, set parameters to prevent data loss in case of failure:

    • Repeat request settings allow you to repeatedly call the function if the current function call fails.

    • Dead Letter Queue settings allow you to redirect messages that the trigger sends to the function.

      You can use a standard message queue as a dead-letter queue. If you do not have a message queue, create one in Yandex Message Queue.

  10. Click Create trigger.

Create a function for processing data in Cloud Functions .Create a function for processing data in Cloud Functions .

Create a data processing function, test it, and review the result of data processing. Then create a trigger to call the function and see the result it returns.

Create a function for processing received dataCreate a function for processing received data

Management console
  1. In the management console, select the folder you are using to complete this tutorial.

  2. From the list of services, select Cloud Functions.

  3. In the left-hand panel, select Functions.

  4. Create a function:

    1. Click Create function.
    2. In the Name field, enter a name for the function, e.g., my-db-function.
    3. Click Create.
  5. Create a function version:

    1. In the Editor window that opens, select Python 3.12.

    2. Disable the Add files with code examples option.

    3. Click Continue.

    4. In the Method field, select Code editor.

    5. Click Create file:

      • File name: myfunction.py.
      • File contents: Function code from GitHub.
    6. In the Entry point field, specify myfunction.msgHandler.

    7. Under Parameters, specify:

      • Timeout: 10.

      • Memory: 128 MB.

      • Service account: my-db-function-service-account.

      • Environment variables:

        Key Description Value
        VERBOSE_LOG Enables and disables writing data True
        DB_HOSTNAME Host FQDN in Managed Service for PostgreSQL See the management console
        in Managed Service for PostgreSQL
        DB_PORT Port to connect to the cluster in Managed Service for PostgreSQL 6432
        DB_NAME Cluster name in Managed Service for PostgreSQL db1
        DB_USER Username to connect to the cluster in Managed Service for PostgreSQL user1
        DB_PASSWORD Password to connect to the DB in Managed Service for PostgreSQL Password you set in Managed Service for PostgreSQL
    8. Click Save changes.

Test the data processing functionTest the data processing function

Management console
  1. In the management console, select the folder you are using to complete this tutorial.

  2. From the list of services, select Cloud Functions.

  3. Select the my-db-function function.

  4. In the left-hand menu, select Testing.

  5. In the Version tag list, select $latest, the most recent version of the function.

  6. In the Payload field, paste the following data:

    {
      "messages": [
      {
        "event_metadata": {
          "event_id": "160d239876d9714800",
          "event_type": "yandex.cloud.events.iot.IoTMessage",
          "created_at": "2020-05-08T19:16:21.267616072Z",
          "folder_id": "b112345678910"
        },
        "details": {
          "registry_id": "are1234567890",
          "device_id": "are0987654321",
          "mqtt_topic": "$devices/are0987654321/events",
          "payload": "ewogICAgICAgICAgICAiRGV2aWNlSWQiOiJhcmU1NzBrZTA1N29pcjg1bDlmciIsCiAgICAgICAgICAgICJUaW1lU3RhbXAiOiIyMDIwLTA2LTExVDExOjA3OjIwWiIsCiAgICAgICAgICAgICJWYWx1ZXMiOlsKICAgICAgICAgICAgICAgIHsiVHlwZSI6IkJvb2wiLCJOYW1lIjoiU2VydmljZSBkb29yIHNlbnNvciIsIlZhbHVlIjoiRmFsc2UifSwKICAgICAgICAgICAgICAgIHsiVHlwZSI6IkZsb2F0IiwiTmFtZSI6IlBvd2VyIFZvbHRhZ2UiLCJWYWx1ZSI6IjI1LjA2In0sCiAgICAgICAgICAgICAgICB7IlR5cGUiOiJGbG9hdCIsIk5hbWUiOiJUZW1wZXJhdHVyZSIsIlZhbHVlIjoiMTEuMjEifSwKICAgICAgICAgICAgICAgIHsiVHlwZSI6IkZsb2F0IiwiTmFtZSI6IkNhc2ggZHJhd2VyIGZ1bGxuZXNzIiwiVmFsdWUiOiI2Ny44OSJ9LAogICAgICAgICAgICAgICAgeyJJdGVtcyI6WwogICAgICAgICAgICAgICAgICAgIHsiVHlwZSI6IkZsb2F0IiwgIklkIjoiMSIsIk5hbWUiOiJJdGVtIDEiLCJGdWxsbmVzcyI6IjUwLjY1In0sCiAgICAgICAgICAgICAgICAgICAgeyJUeXBlIjoiRmxvYXQiLCAiSWQiOiIyIiwiTmFtZSI6Ikl0ZW0gMiIsIkZ1bGxuZXNzIjoiODAuOTcifSwKICAgICAgICAgICAgICAgICAgICB7IlR5cGUiOiJGbG9hdCIsICJJZCI6IjMiLCJOYW1lIjoiSXRlbSAzIiwiRnVsbG5lc3MiOiIzMC4zMyJ9LAogICAgICAgICAgICAgICAgICAgIHsiVHlwZSI6IkZsb2F0IiwgIklkIjoiNCIsIk5hbWUiOiJJdGVtIDQiLCJGdWxsbmVzcyI6IjE1LjE1In0KICAgICAgICAgICAgICAgIF19CiAgICAgICAgICAgICAgICBdCiAgICAgICAgICAgIH0="
        }
      }]
    }
    
  7. Click Run test.

    If the function is successful, you will see the Done status in the Function status field and the Function output field will display this result:

    {
      "statusCode" : 200 ,
      "headers" : {
        "Content-Type" : "text/plain"
      },
    "isBase64Encoded" : false
    }
    

View the data processing result in Managed Service for PostgreSQLView the data processing result in Managed Service for PostgreSQL

Management console
  1. In the management console, select the folder you are using to complete this tutorial.
  2. From the list of services, select Managed Service for PostgreSQL.
  3. Select the my-pg-database cluster.
  4. In the left-hand menu, select SQL.
  5. In the Password field, enter the password you set to access the database and click Connect.
  6. Select the public folder.
  7. View the data processing result in the iot_events and iot_position tables.

Create a trigger to call the data processing functionCreate a trigger to call the data processing function

The trigger will invoke the function when messages appear in the device topic.

Management console
  1. In the management console, select the folder you are using to complete this tutorial.

  2. From the list of services, select Cloud Functions.

  3. In the left-hand panel, select Triggers.

  4. Click Create trigger.

  5. In the Name field, enter a name for the trigger, e.g., my-db-func-trigger.

  6. In the Type field, select IoT Core (device).

  7. Under IoT Core message settings, specify the registry and device parameters:

    • Registry: my-registry.
    • Device: Any device.
    • MQTT topic: $devices/#.
  8. Under Function settings, specify the function parameters:

    • Function: my-db-function.
    • Function version tag: $latest.
    • Service account: my-db-function-service-account.
  9. (Optional) In the Repeat request settings and Dead Letter Queue settings sections, set parameters to prevent data loss in case of failure:

    • Repeat request settings allow you to repeatedly call the function if the current function call fails.

    • Dead Letter Queue settings allow you to redirect messages that the trigger sends to the function.

      You can use a standard message queue as a dead-letter queue. If you do not have a message queue, create one in Yandex Message Queue.

  10. Click Create trigger.

View the trigger result in Managed Service for PostgreSQLView the trigger result in Managed Service for PostgreSQL

Shortly after creating the trigger, you can check how it works.

Management console
  1. In the management console, select the folder you are using to complete this tutorial.
  2. From the list of services, select Managed Service for PostgreSQL.
  3. Select the my-pg-database cluster.
  4. In the left-hand menu, select SQL.
  5. In the Password field, specify the password you set to access the database and click Connect.
  6. Select the public folder.
  7. View the changes in the iot_events table.

Configure monitoring in DataLensConfigure monitoring in DataLens

To monitor the state of your devices, configure a connection, create a dataset, charts, and a dashboard.

Set up a connection to Managed Service for PostgreSQLSet up a connection to Managed Service for PostgreSQL

DataLens interface
  1. In the management console, select the folder you are using to complete this tutorial.

  2. From the list of services, select DataLens.

  3. Click Create connection.

  4. Select the PostgreSQL connector.

    When connecting to an external data source (which is not a Yandex Cloud resource), grant access to the source for the DataLens IP address ranges.

  5. Select a cloud and folder.

  6. Select the my-pg-database cluster and a host.

  7. In the Port field, specify 6432.

  8. Select db1 as the database and user1 as the user.

  9. In the Password field, specify the password you set to access the database in Managed Service for PostgreSQL.

  10. Click Create connection.

  11. In the window that opens, specify the MyPGConnection name for the connection and click Create.

Create a datasetCreate a dataset

DataLens interface
  1. In the management console, select the folder you are using to complete this tutorial.

  2. From the list of services, select DataLens.

  3. Click Create dataset.

  4. In the left-hand panel, click Add.

  5. Select a MyPGConnection connection.

  6. In the left-hand menu, select the public.iot_events and public.iot_position tables and drag them to the right.

  7. Click Save.

  8. In the window that opens, specify My-pg-dataset and click Create.

    The dataset will appear in the list.

Create a chart for temperature and mains voltageCreate a chart for temperature and mains voltage

DataLens interface
  1. In the management console, select the folder you are using to complete this tutorial.

  2. From the list of services, select DataLens.

  3. Click Create chart.

  4. In the left-hand panel, click Select dataset and select My-pg-dataset, which you created previously.

  5. Select Line chart as your chart type.

  6. From the Dimensions section in the left-hand menu, drag the dimensions to the Line chart section as follows:

    • event_datetime, to the X section.

      A timeline will appear in the lower part of the chart on the X-axis.

    • temperature and power_voltage, to the Y section.

    The temperature and mains voltage values will appear on the Y-axis of the chart.

  7. Click Save.

  8. In the window that opens, specify the chart name or use the generated My-pg-dataset — Line chart name and click Save.

Create a chart with a mapCreate a chart with a map

DataLens interface
  1. In the management console, select the folder you are using to complete this tutorial.
  2. From the list of services, select DataLens.
  3. Create a field to define device coordinates:
    1. In the left-hand menu, select Datasets.
    2. Select My-pg-dataset from the list of datasets.
    3. Go to the Fields tab.
    4. In the right part of the window, click Add field.
    5. In the window that opens, in the Field name field, enter Position.
    6. In the Formula field, insert GEOPOINT([latitude],[longitude]).
    7. Click Create.
    8. Click Save.
  4. Create a chart:
    1. At the top right, click Create chart.
    2. Select Map as the chart type.
    3. From the Dimensions section in the left-hand menu, drag the dimensions to the Map section as follows:
      • Position, to the Geopoints section.

      • item1_fullness, item2_fullness, item3_fullness, item4_fullness, and cash_drawer, to the Tooltips section.

        On the right side of the window, you will see a scalable map with vending machines displayed as dots on the map and tooltips displayed as legend lines when you hover over the dots.

    4. Click Save.
    5. In the window that opens, specify the chart name or use the generated My-pg-dataset — Map name and click Save.

Create a dashboardCreate a dashboard

DataLens interface
  1. In the management console, select the folder you are using to complete this tutorial.

  2. From the list of services, select DataLens.

  3. Click Create dashboard.

  4. Add the My-pg-dataset — Map and My-pg-dataset — Line chart charts, which you created at the previous steps, to the dashboard:

    1. In the bottom panel, click Chart.
    2. In the Chart field of the window that opens, click Select and select My-pg-dataset — Map.
    3. Click Add.
    4. Repeat the steps to add My-pg-dataset — Line chart.
  5. Configure the selector:

    1. In the bottom panel, click Selector.
    2. In the Dataset field, click Select and select My-pg-dataset.
    3. In the Field list, select device_id.
    4. In the Default value list, select the ID of any one device you created in Yandex IoT Core.
    5. In the Header field, enter Device.
    6. Click Add.
  6. Configure links:

    1. At the top right, click Links.

    2. In the window that opens, select the My-pg-dataset — Map chart from the list.

    3. In the In.link drop-down list, select Ignore.

      Maps do not support the Links parameter.

    4. In the list, select My-pg-dataset — Line chart.

    5. In the In.link drop-down list, select In.link.

    6. Click Save.

  7. Click Save.

  8. In the window that opens, enter a name for the dashboard: MyDash.

  9. Click Create.

After completing the tutorial, you will be able to monitor sensor readings on a map and chart.

How to delete the resources you createdHow to delete the resources you created

To stop paying for the resources you created:

  1. Delete the devices in Yandex IoT Core.
  2. Delete the registry in Yandex IoT Core.
  3. Delete the triggers for function calls in Cloud Functions.
  4. Delete the functions in Cloud Functions.
  5. Delete the cluster in Managed Service for PostgreSQL.
  6. Delete the static public IP if you reserved one.

Was the article helpful?

Previous
Terraform
Next
Writing load balancer logs to PostgreSQL
© 2025 Direct Cursus Technology L.L.C.