Skip to main content

signoz.go

signoz.go - Overview

  1. 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.

  2. Detailed Documentation

type: SigNoz

  • Purpose: Represents the main SigNoz application, holding references to its core components.
  • Members:
    • Registry: A pointer to a factory.Registry instance.
    • Cache: A cache.Cache instance.
    • Web: A web.Web instance.
    • SQLStore: A sqlstore.SQLStore instance.
    • TelemetryStore: A telemetrystore.TelemetryStore instance.
    • Prometheus: A prometheus.Prometheus instance.
    • Alertmanager: An alertmanager.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 creating cache.Cache instances.
    • webProviderFactories: factory.NamedMap[factory.ProviderFactory[web.Web, web.Config]] - A map of provider factories for creating web.Web instances.
    • sqlstoreProviderFactories: factory.NamedMap[factory.ProviderFactory[sqlstore.SQLStore, sqlstore.Config]] - A map of provider factories for creating sqlstore.SQLStore instances.
    • telemetrystoreProviderFactories: factory.NamedMap[factory.ProviderFactory[telemetrystore.TelemetryStore, telemetrystore.Config]] - A map of provider factories for creating telemetrystore.TelemetryStore instances.
  • Returns:
    • *SigNoz: A pointer to the newly created SigNoz instance.
    • error: An error if any of the initialization steps fail.
  1. Code Examples None

  2. Clarity and Accuracy The documentation is based directly on the code and aims to be precise.

  3. Markdown & MDX Perfection The documentation uses proper markdown syntax and avoids potential MDX issues.

Include in Getting Started: YES