aeflex

package
v0.0.0-...-6a078a0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2018 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Package aeflex implements service discovery for GCE VMs running in App Engine Flex.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ServiceCount is the current number of AEFlex services.
	//
	// Provides metrics:
	//   gcp_aeflex_services
	// Example usage:
	//   ServiceCount.Set(count)
	ServiceCount = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: "gcp_aeflex_services",
			Help: "Number of active AEFlex services.",
		},
	)

	// VersionCount is the current number of available versions.
	//
	// Provides metrics:
	//   gcp_aeflex_versions{service="etl-batch-parser"}
	// Example usage:
	//   VersionCount.WithLabelValues("etl-batch-parser").Set(count)
	VersionCount = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "gcp_aeflex_versions",
			Help: "Total number of versions.",
		},
		[]string{"service"},
	)

	// InstanceCount is the current number of serving instances.
	//
	// Provides metrics:
	//   gcp_aeflex_instances{service="etl-batch-parser", serving="true"}
	// Example usage:
	//   InstanceCount.WithLabelValues("etl-batch-parser", "true").Set(count)
	InstanceCount = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "gcp_aeflex_instances",
			Help: "Total number of running serving instances.",
		},
		[]string{"service", "active"},
	)
)

Functions

This section is empty.

Types

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

Factory stores information needed to create new Source instances.

func NewSourceFactory

func NewSourceFactory(project, filename string) *Factory

NewSourceFactory returns a new Factory object that can create new App Engine Flex Sources.

func (*Factory) Create

func (f *Factory) Create() (discovery.Source, error)

Create returns a discovery.Source initialized with authenticated clients for App Engine Admin API, ready for Collection.

type Source

type Source struct {
	// contains filtered or unexported fields
}

Source caches information collected from the App Engine Admin API during target discovery.

func (*Source) Collect

func (source *Source) Collect() error

Collect contacts the App Engine Admin API to to check every service, and every serving version. Collect saves every AppEngine Flexible Environments VMs that is in a RUNNING and SERVING state.

func (*Source) Save

func (source *Source) Save() error

Save writes the content of the the collected set of targets.

Jump to

Keyboard shortcuts

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