Skip to main content

Importing Metrics Dashboards

You can import your existing dashboards to Logz.io via a manual process.

Bulk upload

Importing multiple dashboards via script

To enable easy migration, we created a Python script to bulk upload your Grafana dashboards to our platform.

Notes
  • Dashboards that include annotations, notification endpoints, and other external resources imported without these resources during bulk import.
  • Custom selection of dashboards is not possible with bulk import. All your dashboard folders imported to a single folder within Logz.io.
  • Thep8s_logzio_name variable is not added to panel queries that don't include filtering: will receive a warning in the logs.
  • Some panel types are not supported by the Logz.io platform. If your dashboard includes an pported panel type, you will receive a warning in the logs. You may experience some issues le the panel renders in Logz.io.

Manual upload

For the dashboard import to work smoothly, you'll need to change the name of the data source in your JSON file to the name of your Logz.io Metrics account. Your Metrics account information is located in the Manage Accounts ( > Settings > Manage accounts) page of your Operations workspace.

Account settings navigation

For the record, notification endpoints and dashboard annotations are not imported: You'll need to recreate them in Logz.io. See Notification endpoints and Annotations for more information.

Importing individual dashboards

To import individual dashboards:

Log into Logz.io and navigate to the Metrics tab.

Select the Import option.

In the left navigation pane, click and select Import.

Import dashboards to Logz.io

  • To import your existing Prometheus dashboards, first export the relevant dashboards as JSON files, then click Upload json file and select the files to upload.

    For related information see Upload HTTP logs.

  • To import dashboards from Grafana.com, enter the relevant dashboard URL or ID in Import via grafana.com and Load them.

InfluxQL to PromQL

This tool allows you to migrate Grafana dashboards based on InfluxDB source to Prometheus source (e.g., Prometheus, M3DB, Cortex).

The tool functions in two ways:

  1. Translate the query language from InfluxQL to PromQL.
  2. Search and replace metrics names.

Convert Grafana Dashboards from InfluxQL to PromQL

Before you begin, you'll need:

  • InfluxQL metrics
  • Logz.io account

Clone the converter repository

Git clone https://github.com/logzio/influxql-to-m3-dashboard-converter.git

Install the tool requirements

Navigate to the project folder and install the requirements by running:

pip install -r requirements.txt

Configure the requirements

Open the config.yaml, and edit the configuration as in the example below. For further examples, refer to the GitHub repository of this project.

log_level: # optional default is INFO
datasource: # optional - will be used as the new datasource
importer: # required - at least 1.
grafana: # grafana api url i.e: https://<<username>>.grafana.net for grafana cloud url
endpoint:
api_token:
folder:
path: # relative or full path
processor:
replace_metrics_names:
- name: # metric to be replaced
value: # new metric name
find_metrics_names:
metrics_auth: # Currently only prometheus is supported
metrics_db_endpoint: https://api.logz.io/v1/metrics/prometheus/api/v1
metrics_basic_auth:
username:
password:
metrics_oauth_header:
key: X-API-TOKEN
value: <<PROMETHEUS-METRICS-SHIPPING-TOKEN>>
replace_strategy:
strategies: [ 'statistic_combination' , 'permutation' ] # optional
min_match_percent: # min percent for result match 1-100
min_filter_percent: # threshold for combination matching 1-100
exporter:
grafana:
endpoint: https://api.logz.io/v1/grafana/api
auth_header:
key:
value:
folder:
path: # relative or full path

Configure the parmeters as per the table below and save the changes.

ParameterDescription
log_levelOptional. Log level to be used during the run of the program. Default: INFO
datasourceOptional. Replaces the existing datasource in the dashboard
importerRequired. At least one input element
importer.grafanaOptional. Import influxql dashboards from grafana API
importer.grafana.endpointRequired. Grafana API URL
importer.grafana.tokenRequired. Grafana API token
importer.folderOptional: Import influxql dashboards from a folder
importer.folder.pathRequired. Path to the folder which contains influxql dashboards. (Relative or absolute)
processorOptional. Processor modules that can transform output
processor.replace_metrics_namesOptional. A processor that will replace a metric name
processor.replace_metrics_names.nameRequired. The name of the original metric to be replaced
processor.replace_metrics_names.valueRequired. The new metric name
processor.find_metrics_namesOptional. Processor to find a match between existing and available metrics
processor.find_metrics_names.metrics_auth.metrics_db_endpointRequired. API endpoint of the metrics db. Currently only prometheus is supported.
processor.find_metrics_names.metrics_auth.metrics_basic_auth.usernameOptional. Metrics db username to be used when querying the db API.
processor.find_metrics_names.metrics_auth.metrics_basic_auth.passwordOptional. Metrics db password to be used when querying the db API.
processor.find_metrics_names.metrics_auth.metrics_oauth_header.keyOptional. Metrics db oauth header key to be used when querying the db API. Must be a full header key
processor.find_metrics_names.metrics_auth.metrics_oauth_header.valueOptional. Metrics db oauth header value to be used when querying the db API. Must be a full header value, including your token for shipping metrics to your Logz.io account. Find it under Settings > Manage accounts. How do I look up my Metrics account token?
processor.find_metrics_names.replace_strategy.strategiesRequired. Strategies to be used in the processor. Available strategies: permutation,statistic_match
processor.find_metrics_names.replace_strategy.min_match_percentRequired (for statistic_match strategy). The percent threshold for considering a match between two metrics.
processor.find_metrics_names.replace_strategy.min_filter_percentRequired (for statistic_match strategy). The percent threshold for performing combination match between two metrics.
exporterRequired. Exporter module that will export the converted dashboards.
exporter.grafanaOptional. Export dashboards using grafana API.
exporter.grafana.endpointRequired. grafana API URL.
exporter.grafana.auth_header.keyRequired. Authentication header key.
exporter.grafana.auth_header.valueRequired. Authentication header value.
exporter.folderOptional. Export dashboard to a folder.
exporter.folder.pathRequired. Path to the folder in which the dashboards will be exported. (Relative or absolute)

Run the script

pip install -r requirements.txt && python3 main.py

Check Logz.io for your dashboards

Once the conversion has been completed, log in to your Logz.io Metrics account, and open the Logz.io Dashboards tab.