MCPcopy
hub / github.com/grafana/tempo / runOTelExporter

Function runOTelExporter

modules/distributor/receiver/shim_test.go:170–192  ·  view source on GitHub ↗
(t *testing.T, factory exporter.Factory, cfg component.Config)

Source from the content-addressed store, hash-verified

168}
169
170func runOTelExporter(t *testing.T, factory exporter.Factory, cfg component.Config) (exporter.Traces, func()) {
171 exporter, err := factory.CreateTraces(
172 context.Background(),
173 exporter.Settings{
174 ID: component.MustNewID(factory.Type().String()),
175 TelemetrySettings: component.TelemetrySettings{
176 Logger: zap.NewNop(),
177 TracerProvider: tracenoop.NewTracerProvider(),
178 MeterProvider: metricnoop.NewMeterProvider(),
179 },
180 },
181 cfg,
182 )
183 require.NoError(t, err)
184
185 err = exporter.Start(context.Background(), &mockHost{})
186 require.NoError(t, err)
187
188 return exporter, func() {
189 err = exporter.Shutdown(context.Background())
190 assert.NoError(t, err, "traces exporter shutting down failed")
191 }
192}
193
194type mockHost struct{}
195

Callers 1

TestShim_integrationFunction · 0.85

Calls 3

StartMethod · 0.65
ShutdownMethod · 0.65
StringMethod · 0.45

Tested by

no test coverage detected