(t *testing.T)
| 524 | } |
| 525 | |
| 526 | func TestMetricsProvisionOTLPDisabled(t *testing.T) { |
| 527 | ctx, _ := caddy.NewContext(caddy.Context{Context: context.Background()}) |
| 528 | |
| 529 | m := &Metrics{OTLP: false} |
| 530 | |
| 531 | if err := m.provisionOTLP(ctx); err != nil { |
| 532 | t.Fatalf("provisionOTLP returned unexpected error: %v", err) |
| 533 | } |
| 534 | if m.meterProvider != nil { |
| 535 | t.Fatalf("meterProvider should remain nil when OTLP is disabled") |
| 536 | } |
| 537 | |
| 538 | // shutdown must be safe on a never-provisioned Metrics. |
| 539 | if err := m.shutdown(context.Background()); err != nil { |
| 540 | t.Fatalf("shutdown returned unexpected error: %v", err) |
| 541 | } |
| 542 | } |
| 543 | |
| 544 | func TestMetricsProvisionOTLPNoopExporter(t *testing.T) { |
| 545 | // OTEL_METRICS_EXPORTER=none makes autoexport return its built-in |
nothing calls this directly
no test coverage detected