Skip to content

grafana/integration-sample-apps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

integration-sample-apps

This repository contains various components used to test and validate Grafana Cloud Integrations.

Please note, all components in this repository are meant for transient testing only, and are not for production use!

Repository structure

Directory Contents
charts/ A set of helm charts used to spin up temporary sample-apps for systems under observation on Kubernetes.
sample-apps/ A collection of stand-alone sample-apps, primarily using Multipass orchestration to configure and setup a temporary application, along with requisite load-testing to generate metrics.
ops/ Contains the scripts and configuration files required for CI workflows.

Local setup instructions

Sample apps can be run locally, as well as on Github with Github Actions. Currently, only Unix based systems are supported, and all scripts expect a bash shell.

Prerequisites

Before you begin, ensure you have the following installed:

  • Multipass
  • Docker (for rendering cloud-init files using Jinja)
  • Git (for cloning the repository)

Setup databases

Ensure Multipass is running, then from the root of the repo execute:

make setup-dbs

This will setup Grafana, Mimir, and Loki using Docker Compose in a single Multipass VM, and handle relevant port-forwarding. The dbs parameter is the name of the deployment, and can be changed should you want to run multiple setups in isolation.

Run a sample-app

Running sample apps can differ from sample-app to sample-app, but if they are CI compatible, e.g. if they do not have a .CI_BYPASS file in their directory, then they can be run locally as well.

Simply run the following, replacing <apps> with a comma-separated list of desired sample-apps. This will, by default connect to the established databases in the previous section, with no need to supply IP address or ports.

make setup-apps APPS=<apps>

Should you desire another metrics target, such as k3d for cloud integration development, simply supply ENV=k3d

Checking metrics match expected_metrics

Once your sample-app has been setup, and given time to run (we recommend 2-3 minutes), you can run a script to check if the expected metrics have been emitted, scraped, and stored in Mimir:

To do so, simply run the following make command, again providing a comma-separated list of apps, and an optional ENV parameter. Note: The APPS and ENV parameters can be assigned as environment variables and thus easily reused throughout.

make test-apps APPS=<apps>

This will give you a metric by metric pass/fail, as well as an overall pass-fail based on the configured pass-rate for the given sample-app

Tearing down the test setup

Tearing down can be done separately for the databases and sample-apps. For the databases, run:

make stop-dbs

For sample-apps, a comma-separated list is again expected, and can therefore selectively tear down apps.

make stop-apps APPS=<apps>

Should you wish to delete all spawned VMs, you can do so with

make stop-all

About

A collection of deployable sample apps for the systems which can be observed by the Grafana Cloud integrations.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 12