Skip to content

Export and Import metrics configuration

Users can use export and import functions to back up configurations.

settings-export-import.png

The exported file is in JSON format and contains all existing configurations and settings as displayed in the web UI.

Use case example

On Device #2, suppose a user wants to make the same configurations as Device #1.

The user can first export configurations from Device #1. Then go to Device #2 Web UI, import configurations using the exported file from the previous step. After successful import, the user will get the same configurations as Device #1.

NOTICE

Importing a configuration file will overwrite previous configurations. To avoid data loss, please backup (export) the configurations before importing.

Resetting configuration to default using an empty JSON file

There is a tip for quickly resetting to default by using an empty JSON file. Save below JSON as a file and import it. This resets all existing configurations to default.

{
    "configurations": [],
    "settings": {
        "flush": 5,
        "interval_sec": 60,
        "prometheus_username": "",
        "prometheus_password": ""
    }
}

Default global setting values are required in a configuration.

Upload Sample

{
    "configurations": [
        {
            "title": "System metrics - PostgreSQL",
            "description": "System metrics with PostgreSQL target",
            "datasources": [
                {
                    "appId": "System",
                    "appTitle": "System"
                }
            ],
            "metrics": [
                {
                    "name": "disk",
                    "instance": {
                        "name": "disk"
                    }
                }
            ],
            "destinations": [
                {
                    "id": "69f47912-daf4-489b-a81b-b11059c9b821",
                    "name": "pqsql",
                    "instance": {
                        "database": "fluentbit",
                        "host": "192.168.244.111",
                        "name": "pgsql",
                        "port": 5432,
                        "table": "fluentbit",
                        "user": "posgresql"
                    }
                }
            ]
        },
        {
            "title": "API Config",
            "description": "This is a description text",
            "datasources": [
                {
                    "appId": "hI5FOxrLcRCQ7doCpoQTDLXTki8al5sI",
                    "appTitle": "tom-nginx"
                }
            ],
            "metrics": [
                {
                    "name": "cpuUsage",
                    "instance": {
                        "name": "cpuUsage"
                    }
                }
            ],
            "destinations": [
                {
                    "id": "1",
                    "name": "apitest",
                    "instance": {
                        "brokers": "192.168.1.3:9092,192.168.1.4:9092",
                        "dynamic_topic": "Off",
                        "format": "json",
                        "message_key": "msg",
                        "message_key_field": "msg",
                        "name": "kafka",
                        "queue_full_retries": 10,
                        "timestamp_format": "double",
                        "timestamp_key": "@timestamp",
                        "topic_key": "key",
                        "topics": "fluent-bit"
                    }
                }
            ]
        }
    ],
    "settings": {
        "flush": 5,
        "interval_sec": 60,
        "prometheus_username": "",
        "prometheus_password": ""
    }
}