manager.go
manager.go - Overview
-
Overview The
manager.go
file defines theManager
struct and related types for handling integrations within the SigNoz query service. It manages available and installed integrations, providing functionality to list, get, install, and uninstall integrations, as well as retrieve associated pipelines and dashboards. -
Detailed Documentation
Type: IntegrationAuthor
- Purpose: Represents the author of an integration.
- Fields:
Name
(string): Author's name.Email
(string): Author's email address.HomePage
(string): Author's homepage URL.
Type: IntegrationSummary
- Purpose: Provides a summary of an integration.
- Fields:
Id
(string): Unique identifier for the integration.Title
(string): Title of the integration.Description
(string): A short description of the integration.Author
(IntegrationAuthor
): Author information.Icon
(string): Icon associated with the integration.
Type: IntegrationAssets
- Purpose: Contains the assets associated with an integration, such as logs, dashboards, and alerts.
- Fields:
Logs
(LogsAssets
): Log-related assets.Dashboards
([]types.DashboardData
): A slice of dashboard data for the integration.Alerts
([]rules.PostableRule
): A slice of alert rules for the integration.
Type: LogsAssets
- Purpose: Represents log-related assets, specifically pipelines.
- Fields:
Pipelines
([]pipelinetypes.PostablePipeline
): A slice of postable pipeline configurations.
Type: IntegrationConfigStep
- Purpose: Represents a configuration step for an integration.
- Fields:
Title
(string): Title of the configuration step.Instructions
(string): Instructions for the configuration step.
Type: DataCollectedForIntegration
- Purpose: Describes the data collected by an integration, including logs and metrics.
- Fields:
Logs
([]CollectedLogAttribute
): A slice of collected log attributes.Metrics
([]CollectedMetric
): A slice of collected metrics.
Type: CollectedLogAttribute
- Purpose: Represents a log attribute collected by an integration.
- Fields:
Name
(string): Name of the log attribute.Path
(string): Path to the log attribute.Type
(string): Type of the log attribute.
Type: CollectedMetric
- Purpose: Represents a metric collected by an integration.
- Fields:
Name
(string): Name of the metric.Type
(string): Type of the metric.Unit
(string): Unit of the metric.Description
(string): Description of the metric.
Type: SignalConnectionStatus
- Purpose: Represents the connection status of a signal (logs or metrics).
- Fields:
LastReceivedTsMillis
(int64): Timestamp in epoch milliseconds when the signal was last received.LastReceivedFrom
(string): Resource identifier from which the signal was last received.
Type: IntegrationConnectionStatus
- Purpose: Represents the connection status of an integration, including logs and metrics.
- Fields:
Logs
(*SignalConnectionStatus
): Connection status for logs.Metrics
(*SignalConnectionStatus
): Connection status for metrics.
Type: LogsConnectionTest
- Purpose: Represents a test to check the connection for logs.
- Fields:
AttributeKey
(string): Attribute key to use for finding logs.AttributeValue
(string): Attribute value to use for finding logs.
Type: IntegrationConnectionTests
- Purpose: Represents connection tests for an integration, including logs and metrics.
- Fields:
Logs
(*LogsConnectionTest
): Connection test for logs.Metrics
([]string): A slice of metric names expected to have been received.
Type: IntegrationDetails
- Purpose: Contains detailed information about an integration.
- Fields:
IntegrationSummary
(IntegrationSummary
): Summary of the integration.Categories
([]string): A slice of categories the integration belongs to.Overview
(string): A markdown string providing an overview of the integration.Configuration
([]IntegrationConfigStep
): A slice of configuration steps.DataCollected
(DataCollectedForIntegration
): Information about the data collected by the integration.Assets
(IntegrationAssets
): Assets associated with the integration.ConnectionTests
(*IntegrationConnectionTests
): Connection tests for the integration.
Type: IntegrationsListItem
- Purpose: Represents an item in a list of integrations, including whether it is installed.
- Fields:
IntegrationSummary
(IntegrationSummary
): Summary of the integration.IsInstalled
(bool): Indicates whether the integration is installed.
Type: InstalledIntegration
- Purpose: Represents an installed integration, including its configuration and installation time.
- Fields:
IntegrationId
(string): ID of the installed integration.Config
(InstalledIntegrationConfig
): Configuration of the installed integration.InstalledAt
(time.Time
): Time when the integration was installed.
Type: InstalledIntegrationConfig
- Purpose: Represents the configuration of an installed integration as a map of string to interface{}.
- Type:
map[string]interface{}
Type: Integration
- Purpose: Represents an integration, including its details and installation information.
- Fields:
IntegrationDetails
(IntegrationDetails
): Detailed information about the integration.Installation
(*InstalledIntegration
): Installation information, if the integration is installed.
Type: Manager
- Purpose: Manages available and installed integrations.
- Fields:
availableIntegrationsRepo
(AvailableIntegrationsRepo
): Repository for available integrations.installedIntegrationsRepo
(InstalledIntegrationsRepo
): Repository for installed integrations.
Function: NewManager
- Purpose: Creates a new
Manager
instance. - Parameters:
db
(*sqlx.DB
): Database connection.
- Returns:
- (*
Manager
, error): A newManager
instance and an error if the initialization fails.
- (*
Type: IntegrationsFilter
- Purpose: Defines filters for listing integrations.
- Fields:
IsInstalled
(*bool): If set, filters integrations based on whether they are installed.
Function: (m *Manager) ListIntegrations
- Purpose: Lists integrations based on the provided filter.
- Parameters:
ctx
(context.Context
): Context for the operation.filter
(*IntegrationsFilter
): Filter to apply to the list of integrations.
- Returns:
- ([]
IntegrationsListItem
, *model.ApiError
): A slice ofIntegrationsListItem
and an API error if any.
- ([]
Function: (m *Manager) GetIntegration
- Purpose: Retrieves a specific integration by its ID.
- Parameters:
ctx
(context.Context
): Context for the operation.integrationId
(string): ID of the integration to retrieve.
- Returns:
- (*
Integration
, *model.ApiError
): The requestedIntegration
and an API error if any.
- (*
Function: (m *Manager) GetIntegrationConnectionTests
- Purpose: Retrieves connection tests for a specific integration.
- Parameters:
ctx
(context.Context
): Context for the operation.integrationId
(string): ID of the integration.
- Returns:
- (*
IntegrationConnectionTests
, *model.ApiError
): The connection tests and an API error if any.
- (*
Function: (m *Manager) InstallIntegration
- Purpose: Installs an integration.
- Parameters:
ctx
(context.Context
): Context for the operation.integrationId
(string): ID of the integration to install.config
(InstalledIntegrationConfig
): Configuration for the installed integration.
- Returns:
- (*
IntegrationsListItem
, *model.ApiError
): The installedIntegrationsListItem
and an API error if any.
- (*
Function: (m *Manager) UninstallIntegration
- Purpose: Uninstalls an integration.
- Parameters:
ctx
(context.Context
): Context for the operation.integrationId
(string): ID of the integration to uninstall.
- Returns:
- (*
model.ApiError
): An API error if any.
- (*
Function: (m *Manager) GetPipelinesForInstalledIntegrations
- Purpose: Retrieves pipelines for all installed integrations.
- Parameters:
ctx
(context.Context
): Context for the operation.
- Returns:
- ([]
pipelinetypes.GettablePipeline
, *model.ApiError
): A slice ofGettablePipeline
and an API error if any.
- ([]
Function: (m *Manager) dashboardUuid
- Purpose: Generates a unique dashboard UUID for an installed integration.
- Parameters:
integrationId
(string): ID of the integration.dashboardId
(string): ID of the dashboard.
- Returns:
- (string): The generated dashboard UUID.
Function: (m *Manager) parseDashboardUuid
- Purpose: Parses a dashboard UUID to extract the integration and dashboard IDs.
- Parameters:
dashboardUuid
(string): The dashboard UUID to parse.
- Returns:
- (string, string, *
model.ApiError
): The integration ID, dashboard ID, and an API error if any.
- (string, string, *
Function: (m *Manager) GetInstalledIntegrationDashboardById
- Purpose: Retrieves a specific dashboard for an installed integration by its UUID.
- Parameters:
ctx
(context.Context
): Context for the operation.dashboardUuid
(string): UUID of the dashboard to retrieve.
- Returns:
- (*
types.Dashboard
, *model.ApiError
): The requestedDashboard
and an API error if any.
- (*
Function: (m *Manager) GetDashboardsForInstalledIntegrations
- Purpose: Retrieves all dashboards for installed integrations.
- Parameters:
ctx
(context.Context
): Context for the operation.
- Returns:
- ([]
types.Dashboard
, *model.ApiError
): A slice ofDashboard
and an API error if any.
- ([]
Function: (m *Manager) getIntegrationDetails
- Purpose: Helper function to retrieve the details of an integration.
- Parameters:
ctx
(context.Context
): Context for the operation.integrationId
(string): ID of the integration.
- Returns:
- (*
IntegrationDetails
, *model.ApiError
): The integration details and an API error if any.
- (*
Function: (m *Manager) getInstalledIntegration
- Purpose: Helper function to retrieve an installed integration.
- Parameters:
ctx
(context.Context
): Context for the operation.integrationId
(string): ID of the integration.
- Returns:
- (*
InstalledIntegration
, *model.ApiError
): The installed integration and an API error if any.
- (*
Function: (m *Manager) getInstalledIntegrations
- Purpose: Helper function to retrieve all installed integrations with their details.
- Parameters:
ctx
(context.Context
): Context for the operation.
- Returns:
- (map[string]
Integration
, *model.ApiError
): A map of integration ID toIntegration
and an API error if any.
- (map[string]
-
Code Examples N/A
-
Clarity and Accuracy The documentation accurately reflects the code's functionality.
-
Markdown & MDX Perfection The markdown is properly formatted.
-
Edge Cases To Avoid Breaking MDX No MDX breaking characters or structures are present.
-
Getting Started Relevance Include in Getting Started: NO