gosight-server

module
v0.0.0-...-58e7928 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2025 License: GPL-3.0

README

Go License Status Go Report Card

GoSight Server

GoSight Server is a high-performance observability backend built in Go. It receives telemetry from GoSight Agents, OpenTelemetry Endpoints (GRPC) and SDK, and Syslog, stores metrics and logs, processes alerts, and serves a dynamic web UI for visualization and investigation.

Documentation

Documentation

Features

  • OpenTelemetry Endpoint for ingesting Metrics, Logs, and Traces
  • TLS/mTLS-secured gRPC endpoints
  • RFC 3164 / RFC 5424 / CEF compatible SysLog Server for ingesting logs
  • VictoriaMetrics integration for metric and log storage (Time-Series + Compressed JSON for logs)
  • PostgreSQL or file-backed log/event storage (AWS S3 Connector Planned)
  • Rule-based alert evaluation + dispatch
  • Live WebSocket telemetry streaming
  • REST API for metrics, logs, endpoints, and alerts
  • Reactive Sveltekit+Flowbite+Tailwind UI with ApexCharts and customizable dashboards

Architecture

  • Receives telemetry via gRPC stream
  • Stores metrics in VictoriaMetrics
  • Handles logs, alerts, commands, and events
  • Web dashboard renders views from real-time and historical data

Build

go build -o gosight-server ./cmd

Running

./gosight-server --config ./config.yaml

See sample config in ./server/config/.

Key Components / Directory Overview

  • internal/alerts/ – Alert models and rule evaluation engine
  • internal/auth/ – JWT-based authentication and session management
  • internal/bootstrap/ – Server startup logic and configuration loading
  • internal/bufferengine/ – Queue/buffer system for telemetry processing
  • internal/cache/ – In-memory caching layer for metadata and sessions
  • internal/config/ – Configuration file parsing and defaults
  • internal/contextutil/ – Request-scoped context helpers
  • internal/dispatcher/ – Alert action dispatcher for routes (webhook, script)
  • internal/events/ – Event tracking and structured broadcasting
  • internal/grpc/ – gRPC service registration and listener setup
  • internal/http/ – HTTP server handlers and routing (REST and UI)
  • internal/rules/ – Rule parsing, condition logic, and evaluation context
  • internal/runner/ – Metric and log task execution pipeline
  • internal/store/ – Top-level store interface and wrappers:
    • alertstore/
    • datastore/
    • eventstore/
    • logstore/
    • metastore/
    • metricindex/
    • metricstore/
    • routestore/
    • rulestore/
    • userstore/
  • internal/syncmanager/ – Live sync and periodic persistence
  • internal/sys/ – System-level information access
  • internal/syslog/ – SysLog server for ingesting logs
  • internal/telemetry/ – Metric and log ingestion + transformation
  • internal/testutils/ – Mocks and utilities for testing
  • internal/tracker/ – In-memory agent/container tracker
  • internal/usermodel/ – User, role, and permission models
  • internal/websocket/ – WebSocket hubs and live stream broadcasting

License

GPL-3.0-or-later

Directories

Path Synopsis
Package main is the package for the GoSight server.
Package main is the package for the GoSight server.
internal
alerts
Package alerts provides a manager for handling alert instances.
Package alerts provides a manager for handling alert instances.
api/handlers
Package handlers provides HTTP handlers for the GoSight API server.
Package handlers provides HTTP handlers for the GoSight API server.
api/routes
Package routes provides HTTP route configuration for the GoSight API server.
Package routes provides HTTP route configuration for the GoSight API server.
auth
mfa.go: Uses TOTP to generate QR codes/secrets and verify codes.
mfa.go: Uses TOTP to generate QR codes/secrets and verify codes.
bootstrap
Package bootstrap initializes the GoSight server.
Package bootstrap initializes the GoSight server.
bufferengine
Description: Package bufferengine provides a buffered data store implementation for writing process payloads to an underlying data store.
Description: Package bufferengine provides a buffered data store implementation for writing process payloads to an underlying data store.
cache
Package cache provides a unified caching system for the GoSight server application.
Package cache provides a unified caching system for the GoSight server application.
config
Package config provides configuration loading and management for the GoSight server.
Package config provides configuration loading and management for the GoSight server.
contextutil
Package contextutil provides safe helpers for working with context values.
Package contextutil provides safe helpers for working with context values.
core/events/dispatcher
Package dispatcher provides functionality to manage and dispatch events to various actions based on defined routes.
Package dispatcher provides functionality to manage and dispatch events to various actions based on defined routes.
events
Package events provides an event emitter for the GoSight application.
Package events provides an event emitter for the GoSight application.
grpc
Package grpcserver provides the implementation of the gRPC server for GoSight.
Package grpcserver provides the implementation of the gRPC server for GoSight.
otel
Package otel provides the OpenTelemetry Protocol (OTLP) support for GoSight.
Package otel provides the OpenTelemetry Protocol (OTLP) support for GoSight.
rules
Package rules provides the core logic for evaluating alert rules and emitting events based on metric data.
Package rules provides the core logic for evaluating alert rules and emitting events based on metric data.
store/datastore/pgsql
Package pgstore implements the userstore.Store interface using PostgreSQL
Package pgstore implements the userstore.Store interface using PostgreSQL
store/logstore/victorialogs
Package victorialogs provides a VictoriaLogs implementation of the LogStore interface.
Package victorialogs provides a VictoriaLogs implementation of the LogStore interface.
store/routestore
SPDX-License-Identifier: GPL-3.0-or-later
SPDX-License-Identifier: GPL-3.0-or-later
store/rulestore
Package rulestore provides a rule store implementation that uses a YAML file for persistence.
Package rulestore provides a rule store implementation that uses a YAML file for persistence.
store/userstore
Package userstore defines the RBAC storage interface and types
Package userstore defines the RBAC storage interface and types
store/userstore/pgstore
Package pgstore implements the userstore.Store interface using PostgreSQL
Package pgstore implements the userstore.Store interface using PostgreSQL
syncmanager
Package SyncManager is responsible for managing synchronization between the cache and the datastore.
Package SyncManager is responsible for managing synchronization between the cache and the datastore.
sys
Package sys provides the system context for the GoSight application.
Package sys provides the system context for the GoSight application.
syslog
Package syslog provides a syslog server implementation to receive syslog messages from network clients
Package syslog provides a syslog server implementation to receive syslog messages from network clients
websocket
server/internal/http/websocket/commandhub.go
server/internal/http/websocket/commandhub.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL