mirror of
https://github.com/hanzoai/o11y.git
synced 2026-10-15 12:58:33 +00:00
Re-sync the entire SigNoz-derived Go tree to a clean fork of latest SigNoz main (upstream 3e6339019), eliminating the version-skew that broke `go build ./...` (mixed-era packages, ~14 imported-but-absent packages, partial signoz->o11y / clickhouse->datastore rebrands, self-import cycle, duplicate package decls). - pkg/ + cmd/ wholesale replaced with latest SigNoz; imports rewritten github.com/SigNoz/signoz/ -> github.com/hanzoai/o11y/. - Adopt SigNoz's CURRENT structure (resourcefilter->telemetryresourcefilter, integrationtypes->cloudintegrationtypes, roletypes/grammar/times folded in upstream); old paths dropped. - Fork deps repathed to hanzoai + bumped: signoz-otel-collector v0.144.6, clickhouse-go-mock v0.14.1, govaluate v0.1.0; expr-lang/expr => hanzoai/expr v1.17.8 (replace). go.mod reconciled from latest SigNoz; go.sum re-tidied. - ee/ + cmd/enterprise stripped — o11y stays MIT-only; community edition imports no ee packages. - Preserved o11y additions: module path github.com/hanzoai/o11y, mount.go (cloud.Register/zip mount adapter, HIP-0106), NOTICE + LICENSE (SigNoz §4c attribution retained; upstream pkg files are headerless per SigNoz convention). - Reverted o11y cosmetic renames (o11y*/datastore*) and experimental originals (authz/iamauthz, billing, zapreceiver, zapmetricreceiver) to SigNoz canonical to kill the skew; snapshots retained in git history for re-layering. go build ./... = exit 0. go vet clean except benign "unreachable code" in generated ANTLR parser files (inherited from upstream).
84 lines
4.6 KiB
Go
84 lines
4.6 KiB
Go
package cloudintegration
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
|
|
"github.com/hanzoai/o11y/pkg/statsreporter"
|
|
citypes "github.com/hanzoai/o11y/pkg/types/cloudintegrationtypes"
|
|
"github.com/hanzoai/o11y/pkg/valuer"
|
|
)
|
|
|
|
type Module interface {
|
|
GetConnectionCredentials(ctx context.Context, orgID valuer.UUID, provider citypes.CloudProviderType) (*citypes.Credentials, error)
|
|
|
|
CreateAccount(ctx context.Context, account *citypes.Account) error
|
|
|
|
// GetAccount returns cloud integration account
|
|
GetAccount(ctx context.Context, orgID, accountID valuer.UUID, provider citypes.CloudProviderType) (*citypes.Account, error)
|
|
|
|
// GetConnectedAccount returns the account where agent is connected
|
|
GetConnectedAccount(ctx context.Context, orgID, accountID valuer.UUID, provider citypes.CloudProviderType) (*citypes.Account, error)
|
|
|
|
// ListAccounts lists accounts where agent is connected
|
|
ListAccounts(ctx context.Context, orgID valuer.UUID, provider citypes.CloudProviderType) ([]*citypes.Account, error)
|
|
|
|
// UpdateAccount updates the cloud integration account for a specific organization.
|
|
UpdateAccount(ctx context.Context, account *citypes.Account) error
|
|
|
|
// DisconnectAccount soft deletes/removes a cloud integration account.
|
|
DisconnectAccount(ctx context.Context, orgID, accountID valuer.UUID, provider citypes.CloudProviderType) error
|
|
|
|
// GetConnectionArtifact returns cloud provider specific connection information,
|
|
// client side handles how this information is shown
|
|
GetConnectionArtifact(ctx context.Context, account *citypes.Account, req *citypes.GetConnectionArtifactRequest) (*citypes.ConnectionArtifact, error)
|
|
|
|
// ListServicesMetadata returns the list of supported services' metadata for a cloud provider with optional filtering for a specific integration
|
|
// This just returns a summary of the service and not the whole service definition.
|
|
ListServicesMetadata(ctx context.Context, orgID valuer.UUID, provider citypes.CloudProviderType, integrationID valuer.UUID) ([]*citypes.ServiceMetadata, error)
|
|
|
|
// GetService returns service definition details for a serviceID. This optionally returns the service config
|
|
// for integrationID if provided.
|
|
GetService(ctx context.Context, orgID valuer.UUID, serviceID citypes.ServiceID, provider citypes.CloudProviderType, integrationID valuer.UUID) (*citypes.Service, error)
|
|
|
|
// CreateService creates a new service for a cloud integration account.
|
|
CreateService(ctx context.Context, orgID valuer.UUID, createdBy string, creator valuer.UUID, service *citypes.CloudIntegrationService, provider citypes.CloudProviderType) error
|
|
|
|
// UpdateService updates cloud integration service
|
|
UpdateService(ctx context.Context, orgID valuer.UUID, createdBy string, creator valuer.UUID, service *citypes.CloudIntegrationService, provider citypes.CloudProviderType) error
|
|
|
|
// AgentCheckIn is called by agent to send heartbeat and get latest config in response.
|
|
AgentCheckIn(ctx context.Context, orgID valuer.UUID, provider citypes.CloudProviderType, req *citypes.AgentCheckInRequest) (*citypes.AgentCheckInResponse, error)
|
|
|
|
statsreporter.StatsCollector
|
|
}
|
|
|
|
type CloudProviderModule interface {
|
|
GetConnectionArtifact(ctx context.Context, account *citypes.Account, req *citypes.GetConnectionArtifactRequest) (*citypes.ConnectionArtifact, error)
|
|
|
|
// ListServiceDefinitions returns all service definitions for this cloud provider.
|
|
ListServiceDefinitions(ctx context.Context) ([]*citypes.ServiceDefinition, error)
|
|
|
|
// GetServiceDefinition returns the service definition for the given service ID.
|
|
GetServiceDefinition(ctx context.Context, serviceID citypes.ServiceID) (*citypes.ServiceDefinition, error)
|
|
|
|
// BuildIntegrationConfig compiles the provider-specific integration config from the account
|
|
// and list of configured services. This is the config returned to the agent on check-in.
|
|
BuildIntegrationConfig(ctx context.Context, account *citypes.Account, services []*citypes.StorableCloudIntegrationService) (*citypes.ProviderIntegrationConfig, error)
|
|
}
|
|
|
|
type Handler interface {
|
|
GetConnectionCredentials(http.ResponseWriter, *http.Request)
|
|
CreateAccount(http.ResponseWriter, *http.Request)
|
|
ListAccounts(http.ResponseWriter, *http.Request)
|
|
GetAccount(http.ResponseWriter, *http.Request)
|
|
UpdateAccount(http.ResponseWriter, *http.Request)
|
|
DisconnectAccount(http.ResponseWriter, *http.Request)
|
|
ListServicesMetadata(http.ResponseWriter, *http.Request)
|
|
ListAccountServicesMetadata(http.ResponseWriter, *http.Request)
|
|
GetService(http.ResponseWriter, *http.Request)
|
|
GetAccountService(http.ResponseWriter, *http.Request)
|
|
UpdateService(http.ResponseWriter, *http.Request)
|
|
AgentCheckIn(http.ResponseWriter, *http.Request)
|
|
}
|