signoz.go
signoz.go - Overview
-
Overview This file defines the main
SigNoz
struct and its initialization logic. It assembles various components like cache, web, SQL store, telemetry store, Prometheus, and Alertmanager based on provided configurations and provider factories. -
Detailed Documentation
type: SigNoz
- Purpose: Represents the main SigNoz application, holding references to its core components.
- Members:
Registry
: A pointer to afactory.Registry
instance.Cache
: Acache.Cache
instance.Web
: Aweb.Web
instance.SQLStore
: Asqlstore.SQLStore
instance.TelemetryStore
: Atelemetrystore.TelemetryStore
instance.Prometheus
: Aprometheus.Prometheus
instance.Alertmanager
: Analertmanager.Alertmanager
instance.
func: New
- Purpose: Creates and initializes a new
SigNoz
instance. It orchestrates the creation and configuration of various sub-components like cache, web, SQL store, telemetry store, Prometheus, and Alertmanager using provider factories. It also handles SQL migrations. - Parameters:
ctx
:context.Context
- The context for the operation.config
:Config
- The configuration for the SigNoz instance.cacheProviderFactories
:factory.NamedMap[factory.ProviderFactory[cache.Cache, cache.Config]]
- A map of provider factories for creatingcache.Cache
instances.webProviderFactories
:factory.NamedMap[factory.ProviderFactory[web.Web, web.Config]]
- A map of provider factories for creatingweb.Web
instances.sqlstoreProviderFactories
:factory.NamedMap[factory.ProviderFactory[sqlstore.SQLStore, sqlstore.Config]]
- A map of provider factories for creatingsqlstore.SQLStore
instances.telemetrystoreProviderFactories
:factory.NamedMap[factory.ProviderFactory[telemetrystore.TelemetryStore, telemetrystore.Config]]
- A map of provider factories for creatingtelemetrystore.TelemetryStore
instances.
- Returns:
*SigNoz
: A pointer to the newly createdSigNoz
instance.error
: An error if any of the initialization steps fail.
-
Code Examples None
-
Clarity and Accuracy The documentation is based directly on the code and aims to be precise.
-
Markdown & MDX Perfection The documentation uses proper markdown syntax and avoids potential MDX issues.
Include in Getting Started: YES