Skip to content

Commit

Permalink
fix: remove not used otlp metrics (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
leoparente authored Dec 26, 2024
1 parent 57023bd commit b2f3d7f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions agent/backend/devicediscovery/device_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"errors"
"fmt"
"net/http"
"strings"
"time"

mqtt "github.com/eclipse/paho.mqtt.golang"
Expand Down Expand Up @@ -52,8 +51,7 @@ type deviceDiscoveryBackend struct {
cancelFunc context.CancelFunc
ctx context.Context

mqttClient *mqtt.Client
otlpMetricsTopic string
mqttClient *mqtt.Client
}

type info struct {
Expand Down Expand Up @@ -89,10 +87,8 @@ func (d *deviceDiscoveryBackend) Configure(logger *zap.Logger, repo policies.Pol
return nil
}

func (d *deviceDiscoveryBackend) SetCommsClient(agentID string, client *mqtt.Client, baseTopic string) {
func (d *deviceDiscoveryBackend) SetCommsClient(_ string, client *mqtt.Client, _ string) {
d.mqttClient = client
otelBaseTopic := strings.Replace(baseTopic, "?", "otlp", 1)
d.otlpMetricsTopic = fmt.Sprintf("%s/m/%c", otelBaseTopic, agentID[0])
}

func (d *deviceDiscoveryBackend) Version() (string, error) {
Expand Down
8 changes: 2 additions & 6 deletions agent/backend/networkdiscovery/network_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"errors"
"fmt"
"net/http"
"strings"
"time"

mqtt "github.com/eclipse/paho.mqtt.golang"
Expand Down Expand Up @@ -52,8 +51,7 @@ type networkDiscoveryBackend struct {
cancelFunc context.CancelFunc
ctx context.Context

mqttClient *mqtt.Client
otlpMetricsTopic string
mqttClient *mqtt.Client
}

type info struct {
Expand Down Expand Up @@ -89,10 +87,8 @@ func (d *networkDiscoveryBackend) Configure(logger *zap.Logger, repo policies.Po
return nil
}

func (d *networkDiscoveryBackend) SetCommsClient(agentID string, client *mqtt.Client, baseTopic string) {
func (d *networkDiscoveryBackend) SetCommsClient(_ string, client *mqtt.Client, _ string) {
d.mqttClient = client
otelBaseTopic := strings.Replace(baseTopic, "?", "otlp", 1)
d.otlpMetricsTopic = fmt.Sprintf("%s/m/%c", otelBaseTopic, agentID[0])
}

func (d *networkDiscoveryBackend) Version() (string, error) {
Expand Down

0 comments on commit b2f3d7f

Please sign in to comment.