aeflex

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2021 License: Apache-2.0 Imports: 13 Imported by: 1

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 = promauto.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 = promauto.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 = promauto.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "gcp_aeflex_instances",
			Help: "Total number of running serving instances.",
		},
		[]string{"service", "active"},
	)
)

Functions

This section is empty.

Types

type Service

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

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

func NewService

func NewService(project string) (*Service, error)

NewService returns a Service initialized with authenticated clients for App Engine Admin API. The Service implements the discovery.Service interface.

func (*Service) Discover

func (source *Service) Discover(ctx context.Context) ([]discovery.StaticConfig, error)

Discover 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.

Directories

Path Synopsis
Package iface defines an interface for accessing AppEngine APIs.
Package iface defines an interface for accessing AppEngine APIs.

Jump to

Keyboard shortcuts

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