Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

feat(audit): add noop auditor for community edition (#10769)

Pandeye588c57e44ea
diff --git a/pkg/auditor/auditor.go b/pkg/auditor/auditor.go
index f4ac83553c..50d26bd349 100644
--- a/pkg/auditor/auditor.go
+++ b/pkg/auditor/auditor.go
@@ -3,10 +3,13 @@ package auditor
import (
"context"
+ "github.com/SigNoz/signoz/pkg/factory"
"github.com/SigNoz/signoz/pkg/types/audittypes"
)
type Auditor interface {
+ factory.ServiceWithHealthy
+
// Audit emits an audit event. It is fire-and-forget: callers never block on audit outcomes.
Audit(ctx context.Context, event audittypes.AuditEvent)
}
diff --git a/pkg/auditor/noopauditor/provider.go b/pkg/auditor/noopauditor/provider.go
new file mode 100644
index 0000000000..9c2675cb18
--- /dev/null
+++ b/pkg/auditor/noopauditor/provider.go
@@ -0,0 +1,42 @@
+package noopauditor
+
+import (
+ "context"
+
+ "github.com/SigNoz/signoz/pkg/auditor"
+ "github.com/SigNoz/signoz/pkg/factory"
+ "github.com/SigNoz/signoz/pkg/types/audittypes"
+)
+
+type provider struct {
+ healthyC chan struct{}
+ stopC chan struct{}
+}
+
+func NewFactory() factory.ProviderFactory[auditor.Auditor, auditor.Config] {
+ return factory.NewProviderFactory(factory.MustNewName("noop"), New)
+}
+
+func New(ctx context.Context, providerSettings factory.ProviderSettings, config auditor.Config) (auditor.Auditor, error) {
+ return &provider{
+ healthyC: make(chan struct{}),
+ stopC: make(chan struct{}),
+ }, nil
+}
+
+func (p *provider) Start(_ context.Context) error {
+ close(p.healthyC)
+ <-p.stopC
+ return nil
+}
+
+func (p *provider) Stop(_ context.Context) error {
+ close(p.stopC)
+ return nil
+}
+
+func (p *provider) Healthy() <-chan struct{} {
+ return p.healthyC
+}
+
+func (p *provider) Audit(_ context.Context, _ audittypes.AuditEvent) {}