Documentation
¶
Index ¶
- func RegisterProcessMemoryMetrics(meter metric.Meter, ownContainerID string)
- type OTELMetricsManager
- func (m *OTELMetricsManager) Destroy()
- func (m *OTELMetricsManager) IncHelperCall(helper string)
- func (m *OTELMetricsManager) IncMissingProfileDataRequired(ruleID string)
- func (m *OTELMetricsManager) IncProjectionReconcileTriggered(trigger string)
- func (m *OTELMetricsManager) IncProjectionSpecCompile()
- func (m *OTELMetricsManager) IncProjectionSpecHashChange()
- func (m *OTELMetricsManager) IncProjectionUndeclaredLiteral(helper string)
- func (m *OTELMetricsManager) ObserveProfileEntriesRaw(field string, count float64)
- func (m *OTELMetricsManager) ObserveProfileEntriesRetained(field string, count float64)
- func (m *OTELMetricsManager) ObserveProfileProjectedSize(bytes float64)
- func (m *OTELMetricsManager) ObserveProfileRawSize(bytes float64)
- func (m *OTELMetricsManager) ObserveProfileRetentionRatio(field string, ratio float64)
- func (m *OTELMetricsManager) ObserveProjectionApplyDuration(d time.Duration)
- func (m *OTELMetricsManager) ObserveSBOMScanDuration(status string, d time.Duration)
- func (m *OTELMetricsManager) ReportAlertSuppressed(ruleID, reason string)
- func (m *OTELMetricsManager) ReportContainerProfileCacheHit(hit bool)
- func (m *OTELMetricsManager) ReportContainerProfileLegacyLoad(kind, completeness string)
- func (m *OTELMetricsManager) ReportContainerProfileReconcilerDuration(phase string, duration time.Duration)
- func (m *OTELMetricsManager) ReportContainerProfileReconcilerEviction(reason string)
- func (m *OTELMetricsManager) ReportContainerStart()
- func (m *OTELMetricsManager) ReportContainerStop()
- func (m *OTELMetricsManager) ReportDedupEvent(eventType utils.EventType, duplicate bool)
- func (m *OTELMetricsManager) ReportEvent(eventType utils.EventType)
- func (m *OTELMetricsManager) ReportFailedEvent()
- func (m *OTELMetricsManager) ReportRuleAlert(ruleID string)
- func (m *OTELMetricsManager) ReportRuleEvaluationTime(ctx context.Context, ruleID string, eventType utils.EventType, ...)
- func (m *OTELMetricsManager) ReportRulePrefiltered(ruleID string)
- func (m *OTELMetricsManager) ReportRuleProcessed(ruleID string)
- func (m *OTELMetricsManager) ReportSBOMScan(status string)
- func (m *OTELMetricsManager) ReportSBOMScannerRestart()
- func (m *OTELMetricsManager) SetContainerProfileCacheEntries(kind string, count float64)
- func (m *OTELMetricsManager) SetProjectionSpecAllField(field string, isAll bool)
- func (m *OTELMetricsManager) SetProjectionSpecPatterns(field, kind string, count float64)
- func (m *OTELMetricsManager) SetProjectionStaleEntries(count float64)
- func (m *OTELMetricsManager) SetProjectionUndeclaredRules(count float64)
- func (m *OTELMetricsManager) SetProjectionUndeclaredRulesDetail(ruleIDs []string)
- func (m *OTELMetricsManager) SetSBOMScannerReady(ready bool)
- func (m *OTELMetricsManager) Start()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterProcessMemoryMetrics ¶
RegisterProcessMemoryMetrics registers the per-process/per-container memory gauges — rss_bytes, cgroup_bytes, cgroup_limit_bytes — on the given meter. Both the main agent and the sbom-scanner sidecar call this so each container reports its own memory usage and limit (distinguished downstream by service.name). ownContainerID, when non-empty, lets the cgroup resolver find the correct scope under a host-mounted cgroup tree (the main-agent topology); pass "" for containers that mount their own namespaced /sys/fs/cgroup (the sidecar), where a direct read of the namespace root works.
MUST be called after otelsetup.InitProviders so the real MeterProvider is set.
Types ¶
type OTELMetricsManager ¶
type OTELMetricsManager struct {
// contains filtered or unexported fields
}
func NewOTELMetricsManager ¶
func NewOTELMetricsManager(ownContainerID string) *OTELMetricsManager
NewOTELMetricsManager constructs a fully-initialised OTELMetricsManager. MUST be called after otelsetup.InitProviders() so that otelsetup.Meter() returns the real MeterProvider, not the SDK no-op.
ownContainerID is this agent's own container ID (from the k8s API); it lets the cgroup memory gauges resolve the correct container scope under the host-mounted cgroup tree. Pass "" when unknown — the gauges then fall back to /proc-based resolution and report 0 if that fails.
func (*OTELMetricsManager) Destroy ¶
func (m *OTELMetricsManager) Destroy()
Destroy is a no-op: provider shutdown is handled by the otelsetup shutdown func.
func (*OTELMetricsManager) IncHelperCall ¶
func (m *OTELMetricsManager) IncHelperCall(helper string)
func (*OTELMetricsManager) IncMissingProfileDataRequired ¶
func (m *OTELMetricsManager) IncMissingProfileDataRequired(ruleID string)
func (*OTELMetricsManager) IncProjectionReconcileTriggered ¶
func (m *OTELMetricsManager) IncProjectionReconcileTriggered(trigger string)
func (*OTELMetricsManager) IncProjectionSpecCompile ¶
func (m *OTELMetricsManager) IncProjectionSpecCompile()
func (*OTELMetricsManager) IncProjectionSpecHashChange ¶
func (m *OTELMetricsManager) IncProjectionSpecHashChange()
func (*OTELMetricsManager) IncProjectionUndeclaredLiteral ¶
func (m *OTELMetricsManager) IncProjectionUndeclaredLiteral(helper string)
func (*OTELMetricsManager) ObserveProfileEntriesRaw ¶
func (m *OTELMetricsManager) ObserveProfileEntriesRaw(field string, count float64)
func (*OTELMetricsManager) ObserveProfileEntriesRetained ¶
func (m *OTELMetricsManager) ObserveProfileEntriesRetained(field string, count float64)
func (*OTELMetricsManager) ObserveProfileProjectedSize ¶
func (m *OTELMetricsManager) ObserveProfileProjectedSize(bytes float64)
func (*OTELMetricsManager) ObserveProfileRawSize ¶
func (m *OTELMetricsManager) ObserveProfileRawSize(bytes float64)
func (*OTELMetricsManager) ObserveProfileRetentionRatio ¶
func (m *OTELMetricsManager) ObserveProfileRetentionRatio(field string, ratio float64)
func (*OTELMetricsManager) ObserveProjectionApplyDuration ¶
func (m *OTELMetricsManager) ObserveProjectionApplyDuration(d time.Duration)
func (*OTELMetricsManager) ObserveSBOMScanDuration ¶
func (m *OTELMetricsManager) ObserveSBOMScanDuration(status string, d time.Duration)
func (*OTELMetricsManager) ReportAlertSuppressed ¶
func (m *OTELMetricsManager) ReportAlertSuppressed(ruleID, reason string)
func (*OTELMetricsManager) ReportContainerProfileCacheHit ¶
func (m *OTELMetricsManager) ReportContainerProfileCacheHit(hit bool)
func (*OTELMetricsManager) ReportContainerProfileLegacyLoad ¶
func (m *OTELMetricsManager) ReportContainerProfileLegacyLoad(kind, completeness string)
func (*OTELMetricsManager) ReportContainerProfileReconcilerDuration ¶
func (m *OTELMetricsManager) ReportContainerProfileReconcilerDuration(phase string, duration time.Duration)
func (*OTELMetricsManager) ReportContainerProfileReconcilerEviction ¶
func (m *OTELMetricsManager) ReportContainerProfileReconcilerEviction(reason string)
func (*OTELMetricsManager) ReportContainerStart ¶
func (m *OTELMetricsManager) ReportContainerStart()
func (*OTELMetricsManager) ReportContainerStop ¶
func (m *OTELMetricsManager) ReportContainerStop()
func (*OTELMetricsManager) ReportDedupEvent ¶
func (m *OTELMetricsManager) ReportDedupEvent(eventType utils.EventType, duplicate bool)
func (*OTELMetricsManager) ReportEvent ¶
func (m *OTELMetricsManager) ReportEvent(eventType utils.EventType)
func (*OTELMetricsManager) ReportFailedEvent ¶
func (m *OTELMetricsManager) ReportFailedEvent()
func (*OTELMetricsManager) ReportRuleAlert ¶
func (m *OTELMetricsManager) ReportRuleAlert(ruleID string)
func (*OTELMetricsManager) ReportRuleEvaluationTime ¶
func (*OTELMetricsManager) ReportRulePrefiltered ¶
func (m *OTELMetricsManager) ReportRulePrefiltered(ruleID string)
func (*OTELMetricsManager) ReportRuleProcessed ¶
func (m *OTELMetricsManager) ReportRuleProcessed(ruleID string)
func (*OTELMetricsManager) ReportSBOMScan ¶
func (m *OTELMetricsManager) ReportSBOMScan(status string)
func (*OTELMetricsManager) ReportSBOMScannerRestart ¶
func (m *OTELMetricsManager) ReportSBOMScannerRestart()
func (*OTELMetricsManager) SetContainerProfileCacheEntries ¶
func (m *OTELMetricsManager) SetContainerProfileCacheEntries(kind string, count float64)
func (*OTELMetricsManager) SetProjectionSpecAllField ¶
func (m *OTELMetricsManager) SetProjectionSpecAllField(field string, isAll bool)
func (*OTELMetricsManager) SetProjectionSpecPatterns ¶
func (m *OTELMetricsManager) SetProjectionSpecPatterns(field, kind string, count float64)
func (*OTELMetricsManager) SetProjectionStaleEntries ¶
func (m *OTELMetricsManager) SetProjectionStaleEntries(count float64)
func (*OTELMetricsManager) SetProjectionUndeclaredRules ¶
func (m *OTELMetricsManager) SetProjectionUndeclaredRules(count float64)
func (*OTELMetricsManager) SetProjectionUndeclaredRulesDetail ¶
func (m *OTELMetricsManager) SetProjectionUndeclaredRulesDetail(ruleIDs []string)
SetProjectionUndeclaredRulesDetail records 1 for each rule currently undeclared and 0 for rules that were in the previous call but are no longer undeclared. OTEL synchronous gauges have no Reset(); zeroing removed entries is the equivalent.
func (*OTELMetricsManager) SetSBOMScannerReady ¶
func (m *OTELMetricsManager) SetSBOMScannerReady(ready bool)
func (*OTELMetricsManager) Start ¶
func (m *OTELMetricsManager) Start()
Start is a no-op: the Prometheus HTTP listener (if configured) is started inside otelsetup.InitProviders when OTEL_METRICS_EXPORTER=prometheus.