Skip to content

Commit

Permalink
Test for metric unregistration
Browse files Browse the repository at this point in the history
  • Loading branch information
madaraszg-tulip committed Dec 6, 2024
1 parent d35c022 commit bed9d1a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions exporter/exporterhelper/internal/queue_sender_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ func TestQueuedRetry_QueueMetricsReported(t *testing.T) {
attribute.String(DataTypeKey, dataType.String())))

assert.NoError(t, be.Shutdown(context.Background()))
// metrics should be unregistered at shutdown to prevent memory leak
require.Error(t, tt.CheckExporterMetricGauge("otelcol_exporter_queue_capacity", int64(defaultQueueSize)))
require.Error(t, tt.CheckExporterMetricGauge("otelcol_exporter_queue_size", int64(7),
attribute.String(DataTypeKey, dataType.String())))
}
})
}
Expand Down

0 comments on commit bed9d1a

Please sign in to comment.