Prior to the 2023.08 release, metrics appeared in Smile CDR. Metrics have now been externalized using Prometheus (to pull metrics from Smile CDR) and Grafana (to visualize the metrics). The metrics within Smile CDR will be deprecated in a future release, and it is highly recommended to externalize your Smile CDR metrics as soon as possible. In order to externalize metrics in Smile CDR, the following 4 steps must be completed in order.
First, install Prometheus by referring to: https://prometheus.io/docs/introduction/first_steps/
Prometheus is configured using a YAML file. The Prometheus download comes with a sample configuration in a file called
prometheus.yml. Modify this file to allow Prometheseus to scrape the metrics from SmileCDR.
Setup Prometheus with a configuration file:
smilecdrto the scrape_configs
Additional options for the configuration file are available here: https://prometheus.io/docs/prometheus/latest/configuration/configuration/
prometheus.yml configuration file is attached below that uses basic auth to authenticate the smile server. If testing locally using Docker, ensure the target for the smilecdr job is
global: scrape_interval: 15s # Set the scrape interval to every 15 seconds. Default is every 1 minute. evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute. external_labels: monitor: 'smilecdr-monitoring' rule_files: # - "first.rules" # - "second.rules" scrape_configs: - job_name: prometheus static_configs: - targets: ['localhost:9090'] - job_name: smilecdr metrics_path: '/metrics/local/metrics' static_configs: - targets: ['localhost:9000'] basic_auth: username: admin password: password params: format: ['PROMETHEUS']
Install Grafana using the instructions found here: https://grafana.com/docs/grafana/latest/setup-grafana/installation/.
These instructions were adopted from: https://prometheus.io/docs/visualization/grafana/
To create a Prometheus data source in Grafana:
http://localhost:9090/). If running Prometheus in docker locally for testing purposes, use:
In Grafana, each datasource has a unique ID. For the Prometheus datasource that you just created, obtain the ID by editing the datasource, and copying everything after the final "/":
For the following URL:
The datasource ID is:
Copy this value, and in SmileCDR in the admin_web console, populate the Prometheus Datasource ID with that value.
Navigate to the metrics page in Smile CDR, go to each module you want a dashboard for, and click "Download Grafana JSON". Unzip the .zip file, you will be uploading the JSON file contained within the zip file to Grafana to create the dashboard in Step 5. Do this for each module.