Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove not used otlp metrics #38

Merged
merged 1 commit into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading