Skip to content

Commit

Permalink
fix: emit metrics with associated resource
Browse files Browse the repository at this point in the history
  • Loading branch information
rogercoll committed Oct 10, 2023
1 parent 6e0bbc8 commit 0f93c1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ func recordPeerMetrics(mb *metadata.MetricsBuilder, now pcommon.Timestamp, devic
rb.SetWireguardDeviceName(deviceName)
rb.SetWireguardPeerName(peer.PublicKey.String())

mb.Emit(metadata.WithResource(rb.Emit()))
mb.EmitForResource(metadata.WithResource(rb.Emit()))
}
2 changes: 1 addition & 1 deletion metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestConvertPeerToMetrics(t *testing.T) {
}

func assertPeerToMetrics(t *testing.T, peer *wgtypes.Peer, md pmetric.Metrics) {
assert.Equal(t, md.ResourceMetrics().Len(), 1)
assert.Equal(t, 1, md.ResourceMetrics().Len())
rsm := md.ResourceMetrics().At(0)

resourceAttrs := map[string]string{
Expand Down

0 comments on commit 0f93c1e

Please sign in to comment.