{"modulePath":"github.com/Stackdome/stackdome","version":"v0.0.7-alpha","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package observability\n\n## Constants\n\n```go\nconst (\n\tComputeEntitlementsIssuedMetricName    = \"stackdome_cloud_compute_entitlements_issued\"\n\tComputeEntitlementsExpiredMetricName   = \"stackdome_cloud_compute_entitlements_expired\"\n\tSharedComputeLeasesMetricName          = \"stackdome_cloud_shared_compute_leases\"\n\tSharedComputeCapacityLimitMetricName   = \"stackdome_cloud_shared_compute_capacity_limit\"\n\tComputeAccessSnapshotSuccessMetricName = \"stackdome_cloud_compute_access_snapshot_collection_success\"\n\n\tLabelSource = \"source\"\n\n\tUnknownSource = \"Unknown\"\n)\n```\n\n```go\nconst (\n\tHTTPRequestsMetricName = \"stackdome_http_server_requests_total\"\n\tHTTPDurationMetricName = \"stackdome_http_server_request_duration_seconds\"\n\tHTTPInFlightMetricName = \"stackdome_http_server_in_flight_requests\"\n\n\tLabelMethod      = \"method\"\n\tLabelRoute       = \"route\"\n\tLabelStatus      = \"status\"\n\tLabelStatusClass = \"status_class\"\n\tLabelWorker      = \"worker\"\n\tLabelResult      = \"result\"\n\n\tUnmatchedRoute = \"unmatched\"\n\tUnknownMethod  = \"UNKNOWN\"\n\n\tWorkerResultSuccess = \"success\"\n\tWorkerResultError   = \"error\"\n\tWorkerResultRequeue = \"requeue\"\n\tWorkerResultPanic   = \"panic\"\n)\n```\n\n```go\nconst (\n\tStacksMetricName               = \"stackdome_stacks\"\n\tStackResourcesMetricName       = \"stackdome_stack_resources\"\n\tStackFailuresMetricName        = \"stackdome_stack_failures\"\n\tStackSnapshotSuccessMetricName = \"stackdome_stack_snapshot_collection_success\"\n\n\tLabelState = \"state\"\n\tLabelType  = \"type\"\n\n\tUnknownState = \"Unknown\"\n)\n```\n\n## Types\n\n```go\ntype ComputeAccessMetricSnapshot struct {\n\tEntitlementsBySource map[string]ComputeEntitlementMetricCounts\n\tLeaseStates          map[string]int64\n}\n```\n\n```go\ntype ComputeAccessSnapshotSource interface {\n\tSnapshot(context.Context) (ComputeAccessMetricSnapshot, error)\n}\n```\n\n```go\nfunc NewDatabaseComputeAccessSnapshotSource(session db.SessionFactory) ComputeAccessSnapshotSource\n```\n\n```go\ntype ComputeAccessSnapshotSourceFunc func(context.Context) (ComputeAccessMetricSnapshot, error)\n```\n\n```go\nfunc (f ComputeAccessSnapshotSourceFunc) Snapshot(ctx context.Context) (ComputeAccessMetricSnapshot, error)\n```\n\n```go\ntype ComputeEntitlementMetricCounts struct {\n\tIssued  int64\n\tExpired int64\n}\n```\n\n```go\ntype Metrics struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewMetrics() *Metrics\n```\n\n```go\nfunc (m *Metrics) DecHTTPInFlight(method string)\n```\n\n```go\nfunc (m *Metrics) Gatherer() prometheus.Gatherer\n```\n\n```go\nfunc (m *Metrics) Handler() http.Handler\n```\n\n```go\nfunc (m *Metrics) IncHTTPInFlight(method string)\n```\n\n```go\nfunc (m *Metrics) ObserveHTTPRequest(method, route string, status int, elapsed time.Duration)\n```\n\n```go\nfunc (m *Metrics) ObserveWorkerExecution(worker, result string)\n```\n\n```go\nfunc (m *Metrics) RegisterComputeAccessCollector(source ComputeAccessSnapshotSource, capacityLimit int)\n```\n\n```go\nfunc (m *Metrics) RegisterStackCollector(source StackSnapshotSource)\n```\n\n```go\ntype StackMetricSnapshot struct {\n\tStackStates    map[string]int64\n\tResourceStates map[string]int64\n\tFailureTypes   map[string]int64\n}\n```\n\n```go\ntype StackSnapshotSource interface {\n\tSnapshot(context.Context) (StackMetricSnapshot, error)\n}\n```\n\n```go\nfunc NewDatabaseStackSnapshotSource(session db.SessionFactory) StackSnapshotSource\n```\n\n```go\ntype StackSnapshotSourceFunc func(context.Context) (StackMetricSnapshot, error)\n```\n\n```go\nfunc (f StackSnapshotSourceFunc) Snapshot(ctx context.Context) (StackMetricSnapshot, error)\n```\n\n","path":"github.com/Stackdome/stackdome/pkg/observability","name":"observability","synopsis":"","isRedistributable":true}
