cloudservice

package
v0.0.0-...-469bd66 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//nolint:revive // TODO(SERV) Fix revive linter
	WebsiteName = "WEBSITE_SITE_NAME"
	//nolint:revive // TODO(SERV) Fix revive linter
	RegionName = "REGION_NAME"
	//nolint:revive // TODO(SERV) Fix revive linter
	WebsiteStack = "WEBSITE_STACK"
	//nolint:revive // TODO(SERV) Fix revive linter
	AppLogsTrace = "WEBSITE_APPSERVICEAPPLOGS_TRACE_ENABLED"
)
View Source
const (
	//nolint:revive // TODO(SERV) Fix revive linter
	ContainerAppNameEnvVar = "CONTAINER_APP_NAME"
	//nolint:revive // TODO(SERV) Fix revive linter
	ContainerAppDNSSuffix = "CONTAINER_APP_ENV_DNS_SUFFIX"
	//nolint:revive // TODO(SERV) Fix revive linter
	ContainerAppRevision = "CONTAINER_APP_REVISION"
	//nolint:revive // TODO(SERV) Fix revive linter
	ContainerAppReplicaName = "CONTAINER_APP_REPLICA_NAME"

	//nolint:revive // TODO(SERV) Fix revive linter
	AzureSubscriptionIdEnvVar = "DD_AZURE_SUBSCRIPTION_ID"
	//nolint:revive // TODO(SERV) Fix revive linter
	AzureResourceGroupEnvVar = "DD_AZURE_RESOURCE_GROUP"
)
View Source
const (
	ServiceNameEnvVar = "K_SERVICE" // ServiceNameEnvVar is also used in the trace package

)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppService

type AppService struct{}

AppService has helper functions for getting specific Azure Container App data

func (*AppService) GetOrigin

func (a *AppService) GetOrigin() string

GetOrigin returns the `origin` attribute type for the given cloud service.

func (*AppService) GetPrefix

func (a *AppService) GetPrefix() string

GetPrefix returns the prefix that we're prefixing all metrics with.

func (*AppService) GetTags

func (a *AppService) GetTags() map[string]string

GetTags returns a map of Azure-related tags

func (*AppService) Init

func (a *AppService) Init() error

Init is empty for AppService

type CloudRun

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

CloudRun has helper functions for getting Google Cloud Run data

func (*CloudRun) GetOrigin

func (c *CloudRun) GetOrigin() string

GetOrigin returns the `origin` attribute type for the given cloud service.

func (*CloudRun) GetPrefix

func (c *CloudRun) GetPrefix() string

GetPrefix returns the prefix that we're prefixing all metrics with.

func (*CloudRun) GetTags

func (c *CloudRun) GetTags() map[string]string

GetTags returns a map of gcp-related tags.

func (*CloudRun) Init

func (c *CloudRun) Init() error

Init is empty for CloudRun

type CloudService

type CloudService interface {
	// GetTags returns a map of tags for a given cloud service. These tags are then attached to
	// the logs, traces, and metrics.
	GetTags() map[string]string

	// GetOrigin returns the value that will be used for the `origin` attribute for
	// all logs, traces, and metrics.
	GetOrigin() string

	// GetPrefix returns the prefix that we're prefixing all
	// metrics with. For example, for cloudrun, we're using
	// gcp.run.{metric_name}. In this example, `gcp.run` is the
	// prefix.
	GetPrefix() string

	// Init bootstraps the CloudService.
	Init() error
}

CloudService implements getting tags from each Cloud Provider.

func GetCloudServiceType

func GetCloudServiceType() CloudService

type ContainerApp

type ContainerApp struct {
	//nolint:revive // TODO(SERV) Fix revive linter
	SubscriptionId string
	//nolint:revive // TODO(SERV) Fix revive linter
	ResourceGroup string
}

ContainerApp has helper functions for getting specific Azure Container App data

func NewContainerApp

func NewContainerApp() *ContainerApp

NewContainerApp returns a new ContainerApp instance

func (*ContainerApp) GetOrigin

func (c *ContainerApp) GetOrigin() string

GetOrigin returns the `origin` attribute type for the given cloud service.

func (*ContainerApp) GetPrefix

func (c *ContainerApp) GetPrefix() string

GetPrefix returns the prefix that we're prefixing all metrics with.

func (*ContainerApp) GetTags

func (c *ContainerApp) GetTags() map[string]string

GetTags returns a map of Azure-related tags

func (*ContainerApp) Init

func (c *ContainerApp) Init() error

Init initializes ContainerApp specific code

type LocalService

type LocalService struct{}

func (*LocalService) GetOrigin

func (l *LocalService) GetOrigin() string

GetOrigin is a default implementation that returns a local empty origin

func (*LocalService) GetPrefix

func (l *LocalService) GetPrefix() string

GetPrefix is a default implementation that returns a local prefix

func (*LocalService) GetTags

func (l *LocalService) GetTags() map[string]string

GetTags is a default implementation that returns a local empty tag set

func (*LocalService) Init

func (l *LocalService) Init() error

Init is not necessary for LocalService

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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