azure

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// AzureAPICallsTotal Total number of Azure API calls
	AzureAPICallsTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: "azure_api",
			Subsystem: "",
			Name:      "calls_total",
			Help:      "Total number of calls to the Azure API",
		},
		[]string{},
	)

	// AzureAPICallsFailedTotal Total number of failed Azure API calls
	AzureAPICallsFailedTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: "azure_api",
			Subsystem: "",
			Name:      "calls_failed_total",
			Help:      "Total number of failed calls to the Azure API",
		},
		[]string{},
	)

	// AzureAPICallsDurationSecondsBuckets Histograms of Azure API calls durations in seconds
	AzureAPICallsDurationSecondsBuckets = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: "azure_api",
			Subsystem: "",
			Name:      "calls_duration_seconds",
			Help:      "Histograms of Azure API calls durations in seconds",
			Buckets:   []float64{0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.15, 0.20, 0.30, 0.40, 0.50, 1.0},
		},
		[]string{},
	)
)
View Source
var (
	// AzureAPIBatchCallsTotal Total number of Azure Batch API calls
	AzureAPIBatchCallsTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: "azure_api",
			Subsystem: "batch",
			Name:      "calls_total",
			Help:      "Total number of calls to the Azure API",
		},
		[]string{"subscription", "resource_group", "account"},
	)

	// AzureAPIBatchCallsFailedTotal Total number of failed Azure Batch API calls
	AzureAPIBatchCallsFailedTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: "azure_api",
			Subsystem: "batch",
			Name:      "calls_failed_total",
			Help:      "Total number of failed calls to the Azure API",
		},
		[]string{"subscription", "resource_group", "account"},
	)

	// AzureAPIBatchCallsDurationSecondsBuckets Histograms of Azure Batch API calls durations in seconds
	AzureAPIBatchCallsDurationSecondsBuckets = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: "azure_api",
			Subsystem: "batch",
			Name:      "calls_duration_seconds",
			Help:      "Histograms of Azure Batch API calls durations in seconds",
			Buckets:   []float64{0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.15, 0.20, 0.30, 0.40, 0.50, 1.0},
		},
		[]string{"subscription", "resource_group", "account"},
	)
)
View Source
var (
	// AzureAPIGraphCallsTotal Total number of Azure Graph API calls
	AzureAPIGraphCallsTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: "azure_api",
			Subsystem: "graph",
			Name:      "calls_total",
			Help:      "Total number of calls to the Azure Graph API",
		},
		[]string{},
	)

	// AzureAPIGraphCallsFailedTotal Total number of failed Azure Graph API calls
	AzureAPIGraphCallsFailedTotal = prometheus.NewCounterVec(
		prometheus.CounterOpts{
			Namespace: "azure_api",
			Subsystem: "graph",
			Name:      "calls_failed_total",
			Help:      "Total number of failed calls to the Azure Graph API",
		},
		[]string{},
	)

	// AzureAPIGraphCallsDurationSecondsBuckets Histograms of Azure Graph API calls durations in seconds
	AzureAPIGraphCallsDurationSecondsBuckets = prometheus.NewHistogramVec(
		prometheus.HistogramOpts{
			Namespace: "azure_api",
			Subsystem: "graph",
			Name:      "calls_duration_seconds",
			Help:      "Histograms of Azure Graph API calls durations in seconds",
			Buckets:   []float64{0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.15, 0.20, 0.30, 0.40, 0.50, 1.0},
		},
		[]string{},
	)
)

Functions

func GetBatchAuthorizer

func GetBatchAuthorizer() (autorest.Authorizer, error)

GetBatchAuthorizer get batch authorizer

func GetBatchAuthorizerWithResource

func GetBatchAuthorizerWithResource(resource string) (autorest.Authorizer, error)

GetBatchAuthorizerWithResource get batch authorizer with resource

func GetBatchJobTaskCounts

func GetBatchJobTaskCounts(ctx context.Context, clients *AzureClients, account *azurebatch.Account, job *batch.CloudJob) (*batch.TaskCounts, error)

GetBatchJobTaskCounts get job tasks metrics

func GetGraphAuthorizer

func GetGraphAuthorizer() (autorest.Authorizer, error)

GetGraphAuthorizer get graph authorizer

func GetSubscription

func GetSubscription(ctx context.Context, clients *AzureClients, subscriptionID string) (*subscription.Model, error)

GetSubscription

func ListApplications

func ListApplications(ctx context.Context, clients *AzureClients) (*[]graph.Application, error)

ListApplications list applications

func ListBatchAccountJobs

func ListBatchAccountJobs(ctx context.Context, clients *AzureClients, account *azurebatch.Account) ([]batch.CloudJob, error)

ListBatchAccountJobs list batch account jobs

func ListBatchAccountPools

func ListBatchAccountPools(ctx context.Context, clients *AzureClients, account *azurebatch.Account) ([]azurebatch.Pool, error)

ListBatchAccountPools List all batch account's pools

func ListSubscriptionBatchAccounts

func ListSubscriptionBatchAccounts(ctx context.Context, clients *AzureClients, subscriptionID string) (*[]azurebatch.Account, error)

ListSubscriptionBatchAccounts List all subscription batch accounts

func ObserveAzureAPICall

func ObserveAzureAPICall(duration float64)

ObserveAzureAPICall

func ObserveAzureAPICallFailed

func ObserveAzureAPICallFailed(duration float64)

ObserveAzureAPICallFailed

func ObserveAzureBatchAPICall

func ObserveAzureBatchAPICall(duration float64, labels ...string)

ObserveAzureBatchAPICall

func ObserveAzureBatchAPICallFailed

func ObserveAzureBatchAPICallFailed(duration float64, labels ...string)

ObserveAzureBatchAPICallFailed

func ObserveAzureGraphAPICall

func ObserveAzureGraphAPICall(duration float64, labels ...string)

ObserveAzureGraphAPICall ...

func ObserveAzureGraphAPICallFailed

func ObserveAzureGraphAPICallFailed(duration float64, labels ...string)

ObserveAzureGraphAPICallFailed ...

Types

type AzureClients

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

AzureClients Collection of Azure clients

func NewAzureClients

func NewAzureClients() *AzureClients

NewAzureClients makes new AzureClients object

func (*AzureClients) GetApplicationsClient

func (azc *AzureClients) GetApplicationsClient(tenantID string) (*graph.ApplicationsClient, error)

GetApplicationsClient get applications client

func (*AzureClients) GetBatchAccountClient

func (azc *AzureClients) GetBatchAccountClient(subscriptionID string) (*azurebatch.AccountClient, error)

GetBatchAccountClient return batch account client for specific subscription

func (*AzureClients) GetBatchJobClient

func (azc *AzureClients) GetBatchJobClient(accountEndpoint string) (*batch.JobClient, error)

GetBatchJobClient get batch job client

func (*AzureClients) GetBatchJobClientWithResource

func (azc *AzureClients) GetBatchJobClientWithResource(accountEndpoint string, resource string) (*batch.JobClient, error)

GetBatchJobClientWithResource get job client with resource

func (*AzureClients) GetBatchPoolClient

func (azc *AzureClients) GetBatchPoolClient(subscriptionID string) (*azurebatch.PoolClient, error)

GetBatchPoolClient get batch pool client

func (*AzureClients) GetSubscriptionClient

func (azc *AzureClients) GetSubscriptionClient(subscriptionID string) (*subscription.SubscriptionsClient, error)

GetSubscriptionClient return subscription client

type ResourceDetails

type ResourceDetails struct {
	SubscriptionID string
	ResourceGroup  string
	Provider       string
	ResourceType   string
	ResourceName   string
}

ResourceDetails contains details about an Azure resource

func ParseResourceID

func ParseResourceID(resourceID string) (ResourceDetails, error)

ParseResourceID parses a resource ID into a ResourceDetails struct

Jump to

Keyboard shortcuts

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