(t *testing.T, rm metricdata.ResourceMetrics)
| 127 | } |
| 128 | |
| 129 | func validateMetrics(t *testing.T, rm metricdata.ResourceMetrics) { |
| 130 | metricsFound := make(map[string]bool) |
| 131 | for _, sm := range rm.ScopeMetrics { |
| 132 | for _, m := range sm.Metrics { |
| 133 | metricsFound[m.Name] = true |
| 134 | } |
| 135 | } |
| 136 | |
| 137 | required := []string{ |
| 138 | MetricConnectionCount, |
| 139 | MetricConnectionCreateTime, |
| 140 | MetricOperationDuration, |
| 141 | } |
| 142 | |
| 143 | for _, name := range required { |
| 144 | if !metricsFound[name] { |
| 145 | t.Errorf("Required metric not found: %s", name) |
| 146 | } |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | func resetObservabilityForTest() { |
| 151 | observabilityInstanceOnce = sync.Once{} |
no outgoing calls
no test coverage detected