Skip to content

Commit

Permalink
period separator
Browse files Browse the repository at this point in the history
  • Loading branch information
wesl-ee committed Aug 23, 2024
1 parent 6e53348 commit ec5a5ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions oracle/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,11 @@ func NewMetricsFromConfig(config config.MetricsConfig, nodeClient *NodeClient) M
var statsdClient statsd.ClientInterface = &statsd.NoOpClient{}
if !config.Telemetry.Disabled && nodeClient != nil {

Check warning on line 85 in oracle/metrics/metrics.go

View check run for this annotation

Codecov / codecov/patch

oracle/metrics/metrics.go#L84-L85

Added lines #L84 - L85 were not covered by tests
// Group these metrics into a statsd namespace
namespace, err := nodeClient.DeriveNodeIdentifier()
identifier, err := nodeClient.DeriveNodeIdentifier()
if err == nil { // only publish statsd data when connected to a node
c, err := statsd.New(config.Telemetry.PushAddress, func(c *statsd.Options) error {

Check warning on line 89 in oracle/metrics/metrics.go

View check run for this annotation

Codecov / codecov/patch

oracle/metrics/metrics.go#L87-L89

Added lines #L87 - L89 were not covered by tests
// Prepends all messages with ${namespace}/
c.Namespace = fmt.Sprintf("%s/", namespace)
// Prepends all messages with connect.${identifier}.
c.Namespace = fmt.Sprintf("connect.sidecar.%s.", identifier)
return nil
})
if err == nil {
Expand Down
2 changes: 1 addition & 1 deletion oracle/metrics/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (nc *NodeClient) DeriveNodeIdentifier() (string, error) {
moniker := strings.ReplaceAll(info.DefaultNodeInfo.Moniker, " ", "-")
network := info.DefaultNodeInfo.Network

Check warning on line 44 in oracle/metrics/node.go

View check run for this annotation

Codecov / codecov/patch

oracle/metrics/node.go#L43-L44

Added lines #L43 - L44 were not covered by tests

identifier := fmt.Sprintf("%s/%s", network, moniker)
identifier := fmt.Sprintf("%s.%s", network, moniker)

Check warning on line 46 in oracle/metrics/node.go

View check run for this annotation

Codecov / codecov/patch

oracle/metrics/node.go#L46

Added line #L46 was not covered by tests

return identifier, nil

Check warning on line 48 in oracle/metrics/node.go

View check run for this annotation

Codecov / codecov/patch

oracle/metrics/node.go#L48

Added line #L48 was not covered by tests
}

0 comments on commit ec5a5ee

Please sign in to comment.