{"modulePath":"github.com/GoogleCloudPlatform/sql-server-agent","version":"v0.0.0-20261117191239-595af8526327","isLatest":true,"isStandardLibrary":false,"goos":"linux","goarch":"amd64","docs":"# package sqlservermetrics\n\nPackage sqlservermetrics run SQL and OS collections and sends metrics to workload manager.\n\n## Constants\n\n```go\nconst (\n\t// ServiceName .\n\tServiceName = internal.ServiceName\n\t// ServiceDisplayName .\n\tServiceDisplayName = \"Google Cloud Agent for SQL Server\"\n\t// Description .\n\tDescription = \"Google Cloud Agent for SQL Server.\"\n\t// ExperimentalMode .\n\tExperimentalMode = internal.ExperimentalMode\n\t// AgentUsageLogPrefix .\n\tAgentUsageLogPrefix = internal.AgentUsageLogPrefix\n\t// AgentVersion .\n\tAgentVersion = internal.AgentVersion\n)\n```\n\n## Variables\n\n```go\nvar UsageMetricsLogger agentstatus.AgentStatus = UsageMetricsLoggerInit(internal.ServiceName, internal.AgentVersion, internal.AgentUsageLogPrefix, true)\n```\nUsageMetricsLogger logs usage metrics.\n\n## Functions\n\n```go\nfunc AgentFilePath() string\n```\nAgentFilePath is the agent file path for linux. It must be a root-owned directory (not a world-writable one such as /tmp) because the agent persists its activation state there.\n\n```go\nfunc CollectionService(p string, collection func(cfg *configpb.Configuration, onetime bool) error, collectionType CollectionType)\n```\nCollectionService runs the passed in collection as a service.\n\n```go\nfunc ConfigPath() string\n```\nConfigPath is the config path for linux.\n\n```go\nfunc Init() (*flags.AgentFlags, string, bool)\n```\nInit parses flags and execute if certain flags are enabled.\n\n```go\nfunc LoadConfiguration(path string) (*configpb.Configuration, error)\n```\nLoadConfiguration loads configuration from given path.\n\n```go\nfunc LogPrefix() string\n```\nLogPrefix is the log prefix for linux.\n\n```go\nfunc LoggingSetup(ctx context.Context, logPrefix string, cfg *configpb.Configuration)\n```\nLoggingSetup initialize the agent logging level.\n\n```go\nfunc LoggingSetupDefault(ctx context.Context, prefix string)\n```\nLoggingSetupDefault wraps LoggingSetupDefault function from agent\\_shared.go.\n\n```go\nfunc OSCollection(ctx context.Context, path, logPrefix string, cfg *configpb.Configuration, onetime bool) error\n```\nOSCollection is the linux implementation of OSCollection.\n\n```go\nfunc SQLCollection(ctx context.Context, path, logPrefix string, cfg *configpb.Configuration, onetime bool) error\n```\nSQLCollection is the linux implementation of SQLCollection.\n\n```go\nfunc UsageMetricsLoggerInit(logName, logVersion, logPrefix string, logUsage bool) agentstatus.AgentStatus\n```\nUsageMetricsLoggerInit initializes and returns usage metrics logger.\n\n## Types\n\n```go\ntype CollectionType int\n```\nCollectionType represents the enums of collection types.\n\n```go\nconst (\n\t// OS collection type.\n\tOS CollectionType = iota\n\t// SQL collection type.\n\tSQL\n)\n```\n\n```go\ntype InstanceProperties struct {\n\tName          string\n\tInstance      string\n\tInstanceID    string\n\tProjectID     string\n\tProjectNumber string\n\tZone          string\n\tImage         string\n}\n```\nInstanceProperties represents properties of instance.\n\n```go\nvar SIP InstanceProperties = sourceInstanceProperties()\n```\nSIP is the source instance properties.\n\n","path":"github.com/GoogleCloudPlatform/sql-server-agent/internal/sqlservermetrics","name":"sqlservermetrics","synopsis":"Package sqlservermetrics run SQL and OS collections and sends metrics to workload manager.","isRedistributable":true}
