Files
4102219754 fork: own SigNoz platform deps under hanzoai + repath off upstream brand (Phase 1) (#9)
* fork: own SigNoz platform deps under hanzoai, repath imports off upstream brand

Phase 1 of the full-fork mandate: eliminate upstream-branded SigNoz modules,
own them as public hanzoai forks, and repath all imports to hanzoai paths.

Owned deps (new public hanzoai forks, module renamed to hanzoai path):
  github.com/SigNoz/signoz-otel-collector v0.144.3
    -> github.com/hanzoai/signoz-otel-collector v0.144.6 (module renamed)
  github.com/SigNoz/clickhouse-go-mock v0.14.0
    -> github.com/hanzoai/clickhouse-go-mock v0.14.1 (module renamed)
  github.com/SigNoz/govaluate v0.0.0-20240203125216-988004ccc7fd
    -> github.com/hanzoai/govaluate v0.1.0 (module renamed)
  github.com/SigNoz/expr (replace target for github.com/expr-lang/expr)
    -> github.com/hanzoai/expr v1.17.8 (upstream module path preserved,
       consumed via replace exactly like the prior SigNoz/expr fork)

In-repo repath: the vendored SigNoz source tree in pkg/, ee/, cmd/ is now
self-referenced as github.com/hanzoai/o11y/... instead of
github.com/SigNoz/signoz/... (1300+ import lines across 377 files), matching
the 750 files already on the hanzoai path. Zero SigNoz-branded module
references remain in go.mod or any .go import.

Generic ecosystem libraries (golang.org/x, google.golang.org, prometheus,
opentelemetry, gin, cobra, luxfi/*, etc.) are left untouched — only the
SigNoz platform fork is owned.

Pre-existing (NOT introduced here): origin/main does not `go build ./...`
because 22 packages are imported but absent from the vendored tree; 14 of
them (roletypes, grammar, cloudintegrations, resourcefilter, integrationtypes,
metricsexplorer, metrics_explorer, times, agg_rewrite, bucket_cache,
sqlitesqlstore, sqlschema/postgressqlschema, sqlstore/postgressqlstore,
cloudintegrations/services) exist in no upstream SigNoz version and must be
vendored into hanzoai/o11y from hanzoai/signoz@770f464f to finish. This
repath is orthogonal to that gap.

* docs(LLM.md): fork boundary map + pre-existing compile-gap inventory

---------

Co-authored-by: Hanzo Dev <[email protected]>
2026-06-30 18:05:03 -07:00

62 lines
3.3 KiB
Go

package rulestatehistory
import (
"context"
"net/http"
"github.com/hanzoai/o11y/pkg/types/rulestatehistorytypes"
"github.com/hanzoai/o11y/pkg/types/telemetrytypes"
)
// Module defines the core operations for managing rule state history.
type Module interface {
// RecordRuleStateHistory persists a batch of rule state history entries for a given rule.
// The bool parameter indicates whether restart is handled.
// TODO(srikanthccv): remove when rule state history record moved to AM
RecordRuleStateHistory(context.Context, string, bool, []rulestatehistorytypes.RuleStateHistory) error
// GetLastSavedRuleStateHistory retrieves the most recently saved state history entries for a given rule.
GetLastSavedRuleStateHistory(context.Context, string) ([]rulestatehistorytypes.RuleStateHistory, error)
// GetHistoryStats returns aggregated statistics for rule state history matching the given query.
GetHistoryStats(context.Context, string, rulestatehistorytypes.Query) (rulestatehistorytypes.GettableRuleStateHistoryStats, error)
// GetHistoryTimeline returns a time-ordered list of rule state history entries and a total count
// for the given query, suitable for paginated timeline views.
GetHistoryTimeline(context.Context, string, rulestatehistorytypes.Query) ([]rulestatehistorytypes.RuleStateHistory, uint64, error)
// GetHistoryFilterKeys returns the available filter keys for rule state history queries.
GetHistoryFilterKeys(context.Context, string, rulestatehistorytypes.Query, string, int64) (*telemetrytypes.GettableFieldKeys, error)
// GetHistoryFilterValues returns the available values for a specific filter key in rule state history.
GetHistoryFilterValues(context.Context, string, string, rulestatehistorytypes.Query, string, int64) (*telemetrytypes.GettableFieldValues, error)
// GetHistoryContributors returns the top contributors to trigger alert, for the given query.
GetHistoryContributors(context.Context, string, rulestatehistorytypes.Query) ([]rulestatehistorytypes.RuleStateHistoryContributor, error)
// GetHistoryOverallStatus returns the overall status windows for rule state history,
// providing an aggregated view of rule health over time.
GetHistoryOverallStatus(context.Context, string, rulestatehistorytypes.Query) ([]rulestatehistorytypes.GettableRuleStateWindow, error)
}
// Handler defines the HTTP handler methods for rule state history API endpoints.
type Handler interface {
// GetRuleHistoryStats handles requests for aggregated rule state history statistics.
GetRuleHistoryStats(http.ResponseWriter, *http.Request)
// GetRuleHistoryTimeline handles requests for a paginated timeline of rule state changes.
GetRuleHistoryTimeline(http.ResponseWriter, *http.Request)
// GetRuleHistoryFilterKeys handles requests for available filter keys in rule state history.
GetRuleHistoryFilterKeys(http.ResponseWriter, *http.Request)
// GetRuleHistoryFilterValues handles requests for available values of a specific filter key.
GetRuleHistoryFilterValues(http.ResponseWriter, *http.Request)
// GetRuleHistoryContributors handles requests for top contributors to alert trigger.
GetRuleHistoryContributors(http.ResponseWriter, *http.Request)
// GetRuleHistoryOverallStatus handles requests for the overall status view of rule health over time.
GetRuleHistoryOverallStatus(http.ResponseWriter, *http.Request)
}