Skip to content

Configure Additional Grafana Destinations

Introduction

Privacera monitoring stack allows you to configure additional Grafana destinations for uploading dashboards and alerts. This enables you to push monitoring dashboards and alert configurations to multiple Grafana instances or external Grafana servers.

This guide explains how to configure additional Grafana destinations in the vars.monitoring.yml file within the Privacera monitoring stack.

Prerequisites

Prerequisite Description
Accessible Grafana Instances All additional Grafana URLs must be accessible from the Privacera monitoring stack
Valid Credentials Username and password, or token must have appropriate permissions to create/update dashboards and alerts

Configuration Procedure

Step 1: Access the Configuration Directory

  1. SSH into the instance where Privacera Manager is installed.

  2. Navigate to the configuration directory:

    Bash
    cd ~/privacera/privacera-manager/config/
    

Step 2: Copy the Monitoring Vars File

  1. Copy the monitoring vars file if not already copied:

    If this file already exists in custom-vars folder then you can skip this step.

    Bash
    cp sample-vars/vars.monitoring.yml custom-vars/
    

Step 3: Edit the Monitoring Configuration

  1. Open the monitoring configuration file:

    Bash
    vi custom-vars/vars.monitoring.yml
    

  2. Locate the GRAFANA_ADDITIONAL_URLS section in the file.

Step 4: Configure Additional Grafana Destinations

  1. Uncomment and configure the GRAFANA_ADDITIONAL_URLS block with your additional Grafana instances:

Option 1: Using Username and Password

YAML
1
2
3
4
5
## Uncomment the below variables to provide additional URLs to Grafana. You can add multiple URLs by adding more entries to the list.
GRAFANA_ADDITIONAL_URLS:
  - url: "https://grafana.example.com"
    username: "admin"
    password: "your-password"

Option 2: Using Grafana Token

YAML
1
2
3
4
## Uncomment the below variables to provide additional URLs to Grafana. You can add multiple URLs by adding more entries to the list.
GRAFANA_ADDITIONAL_URLS:
  - url: "https://grafana.example.com"
    token: "your-grafana-token"

Creating Grafana Tokens

If you need to create a Grafana token for authentication, refer to the Grafana documentation on service accounts and tokens. This guide provides step-by-step instructions for creating service accounts and generating tokens with appropriate permissions for dashboard and alert management.

Configuration Parameters

Parameter Description Example Required
url The complete URL of your Grafana instance http://grafana.example.com:3000 Yes
username Username with dashboard/alert management permissions admin Conditional*
password Password for the specified username your-secure-password Conditional*
token Grafana token with appropriate permissions to create/update dashboards and alerts glsa_xxxxxxxxxxxxx Conditional*

Conditional

Either the username and password combination OR a token is required for authentication.

Step 5: Save and Exit

  1. Save the file and exit the editor:
    Bash
    :wq
    

Multiple Destination Configuration

You can configure multiple Grafana destinations by adding additional entries to the list. You can mix different authentication methods:

YAML
1
2
3
4
5
6
7
8
9
GRAFANA_ADDITIONAL_URLS:
  - url: "http://primary-grafana:3000"
    username: "admin"
    password: "primary-password"
  - url: "http://secondary-grafana:3000"
    token: "secondary-token"
  - url: "https://cloud-grafana.company.com"
    username: "monitoring"
    password: "cloud-password"

Triggering the Post-Install Job

To apply your configuration changes and trigger the immediate upload of Grafana dashboards and alerts to the newly configured destinations, run the Privacera Post-Install Job by performing the following steps:

  1. Login to the Privacera jumphost and navigate to the privacera-manager directory.

    Bash
    cd ~/privacera/privacera-manager
    

  2. Run Setup Script:

    Bash
    ./privacera-manager.sh setup
    

  3. Run the following command to trigger the Post-Install Job:

    Bash
    helm upgrade post-install-job output/kubernetes/helm/post-install-job/ -n <NAMESPACE>
    

  4. Verify the Grafana dashboards and alerts are uploaded to the additional Grafana destinations.

What Gets Uploaded

When additional Grafana destinations are configured, the following components will be automatically uploaded to each configured Grafana instance:

  • Dashboards: All Privacera monitoring dashboards
  • Alert Rules: Pre-configured alert rules for monitoring

Troubleshooting

If dashboards and alerts are not uploading to additional Grafana destinations, check the following:

  1. URL Accessibility: Ensure all configured Grafana URLs are reachable from the Privacera monitoring stack.

  2. Authentication: Verify that the username/password combination or token has sufficient permissions to create and update dashboards and alerts.

  3. YAML Syntax: Validate the YAML file for correct indentation and syntax. Improper formatting can prevent configuration from loading.

  4. Check Logs: Review the Post Install Job logs for any error messages related to Grafana upload failures.

  5. Token Permissions: If using tokens, ensure the token has the necessary permissions for dashboard and alert management.

  6. Token Expiration: Check if your Grafana token has expired. Expired tokens will cause authentication failures. You may need to create a new token and update your configuration.


Summary

By configuring additional Grafana destinations in the vars.monitoring.yml file, you can automatically upload dashboards and alerts to multiple Grafana instances. You can use either username/password authentication or tokens for secure access to external Grafana instances.


Comments