Skip to content

Commit

Permalink
Remove original impl of node meta fn
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Chapman committed Jun 14, 2023
1 parent 507286f commit 1d0b2dd
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 14 deletions.
7 changes: 3 additions & 4 deletions agent/hcp/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,13 +315,12 @@ func (t *TelemetryConfig) Enabled() (string, bool) {
// DefaultLabels returns a set of <key, value> string pairs that must be added as attributes to all exported telemetry data.
func (t *TelemetryConfig) DefaultLabels(cfg config.CloudConfig) map[string]string {
labels := make(map[string]string)
nID, nodeName := cfg.NodeMeta()
nodeID := string(nID)
nodeID := string(cfg.NodeID)
if nodeID != "" {
labels["node_id"] = nodeID
}
if nodeName != "" {
labels["node_name"] = nodeName
if cfg.NodeName != "" {
labels["node_name"] = cfg.NodeName
}

for k, v := range t.Labels {
Expand Down
2 changes: 0 additions & 2 deletions agent/hcp/client/metrics_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"golang.org/x/oauth2"
"google.golang.org/protobuf/proto"

"github.com/hashicorp/consul/types"
"github.com/hashicorp/consul/version"
)

Expand All @@ -44,7 +43,6 @@ type MetricsClient interface {
type CloudConfig interface {
HCPConfig(opts ...hcpcfg.HCPConfigOption) (hcpcfg.HCPConfig, error)
Resource() (resource.Resource, error)
NodeMeta() (NodeID types.NodeID, NodeName string)
}

// otlpClient is an implementation of MetricsClient with a retryable http client for retries and to honor throttle.
Expand Down
4 changes: 0 additions & 4 deletions agent/hcp/client/mock_CloudConfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,3 @@ func (m MockCloudCfg) Resource() (resource.Resource, error) {
func (m MockCloudCfg) HCPConfig(opts ...hcpcfg.HCPConfigOption) (hcpcfg.HCPConfig, error) {
return &mockHCPCfg{}, m.ConfigErr
}

func (m MockCloudCfg) NodeMeta() (types.NodeID, string) {
return m.NodeID, m.NodeName
}
4 changes: 0 additions & 4 deletions agent/hcp/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,6 @@ func (c *CloudConfig) Resource() (resource.Resource, error) {
return resource.FromString(c.ResourceID)
}

func (c *CloudConfig) NodeMeta() (types.NodeID, string) {
return c.NodeID, c.NodeName
}

func (c *CloudConfig) HCPConfig(opts ...hcpcfg.HCPConfigOption) (hcpcfg.HCPConfig, error) {
if c.TLSConfig == nil {
c.TLSConfig = &tls.Config{}
Expand Down

0 comments on commit 1d0b2dd

Please sign in to comment.