Skip to content

Commit

Permalink
pkg/metrics: rename policystatemetrics pkg in policymetrics
Browse files Browse the repository at this point in the history
This will now be used not only for the state but also for the kernel
memory so I'm making the name more generic.

Signed-off-by: Mahe Tardy <mahe.tardy@gmail.com>
  • Loading branch information
mtardy committed Oct 8, 2024
1 parent 1243fc4 commit 4db64e5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright Authors of Tetragon

package policystatemetrics
package policymetrics

import (
"context"
Expand Down Expand Up @@ -34,7 +34,7 @@ var policyState = metrics.MustNewCustomGauge(metrics.NewOpts(

// This metric collector converts the output of ListTracingPolicies into a few
// gauges metrics on collection. Thus, it needs a sensor manager to query.
func NewPolicyStateCollector() metrics.CollectorWithInit {
func NewPolicyCollector() metrics.CollectorWithInit {
return metrics.NewCustomCollector(
metrics.CustomMetrics{
policyState,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright Authors of Tetragon

package policystatemetrics
package policymetrics

import (
"context"
Expand Down Expand Up @@ -40,7 +40,7 @@ tetragon_tracingpolicy_loaded{state="load_error"} %d
observer.SetSensorManager(manager)
t.Cleanup(observer.ResetSensorManager)

collector := NewPolicyStateCollector()
collector := NewPolicyCollector()
reg.Register(collector)

err := manager.AddTracingPolicy(context.TODO(), &tracingpolicy.GenericTracingPolicy{
Expand Down
6 changes: 3 additions & 3 deletions pkg/metricsconfig/healthmetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"github.com/cilium/tetragon/pkg/metrics/kprobemetrics"
"github.com/cilium/tetragon/pkg/metrics/opcodemetrics"
"github.com/cilium/tetragon/pkg/metrics/policyfiltermetrics"
"github.com/cilium/tetragon/pkg/metrics/policystatemetrics"
"github.com/cilium/tetragon/pkg/metrics/policymetrics"
"github.com/cilium/tetragon/pkg/metrics/watchermetrics"
"github.com/cilium/tetragon/pkg/observer"
"github.com/cilium/tetragon/pkg/process"
Expand Down Expand Up @@ -87,8 +87,8 @@ func registerHealthMetrics(group metrics.Group) {
// kprobe metrics
kprobemetrics.RegisterMetrics(group)
group.ExtendInitForDocs(kprobemetrics.InitMetricsForDocs)
// policy state metrics
group.MustRegister(policystatemetrics.NewPolicyStateCollector())
// policy metrics
group.MustRegister(policymetrics.NewPolicyCollector())
// gRPC metrics
group.MustRegister(grpcmetrics.NewServerMetrics())
// missed metris
Expand Down

0 comments on commit 4db64e5

Please sign in to comment.