Skip to main content

agents/anchor-edge-agent/internal/collector/events.go

Metadata

Indexed Symbols

  • buildBaseEvent (line 10, go function) - Implements build base event for telemetry collection.
  • BuildPatchCompliance (line 23, go function) - Implements build patch compliance for telemetry collection.
  • BuildBackupFailure (line 33, go function) - Implements build backup failure for telemetry collection.
  • BuildServiceDegraded (line 43, go function) - Implements build service degraded for telemetry collection.
  • CollectProfileEvents (line 53, go function) - Implements collect profile events for telemetry collection.

Markdown Headings (if applicable)

No markdown headings detected.

Source Preview

package collector

import (
"strings"
"time"

"github.com/anchor-msp/anchor-edge-agent/internal/types"
)

func buildBaseEvent(config Config, kind string) types.TelemetryEvent {
return types.TelemetryEvent{
EventID: pseudoUUID(),
WorkspaceID: config.WorkspaceID,
ClientID: config.ClientID,
AssetID: config.AssetID,
OccurredAt: time.Now().UTC(),
CorrelationID: pseudoUUID(),
Kind: kind,
Data: map[string]any{},
}
}

func BuildPatchCompliance(config Config, compliant bool, missingCritical, missingImportant int) types.TelemetryEvent {
event := buildBaseEvent(config, "PatchCompliance")
event.Data = map[string]any{