spartagrafana

command module
v0.0.0-...-dcf9662 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2017 License: MIT Imports: 19 Imported by: 0

README

SpartaGrafana

Grafana Log

Note: Requires Sparta 0.9.2 or later

This is a multiple CloudFormation-stack Sparta-based application that includes provisioning a Grafana host running on a single EC2 instance.

The Grafana service is provisioned via a WorkflowHook that defines and provisions a separate CloudFormation stack. The GrafanaStack exports the EC2 hostname's PublicDNS name which is then referenced by the HelloWorld lambda' function's metadata. This binding ensures that the GrafanaStack cannot be deleted until the referring Sparta application (SpartaGrafanaPublisher) is deleted.

The SpartaGrafanaPublisher discovers the PublicDNSName during init() by querying CloudFormation:

  awsSession := session.New()
  cloudFormationSvc := cloudformation.New(awsSession)
  params := &cloudformation.DescribeStacksInput{
    StackName: aws.String(GrafanaStackName),
  }
  outputResults, outputResultsErr := cloudFormationSvc.DescribeStacks(params)

Once the DNSName is determined, the SpartaGrafanaPublisher service creates an Influx DB Client to publish go-metrics to the Grafana instance.

To view the single automatically-generated Grafana dashboard, login to the Grafana host (see the GrafanaStack CloudFormation Outputs fror the domain) using admin/admin and navigate to the Sparta Hello World dashboard. By default, the HelloWorld.count counter is tracked, which is the number of lambda reported invocations.

To view the dashboard in action, navigate to the AWS Lambda Console and "Test" the function to begin publishing metrics.

Documentation

Overview

go:generate go run $GOPATH/src/github.com/mweagle/Sparta/aws/cloudformation/cli/describe.go --stackName SpartaHelloWorld --output .

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL