| 124 | } |
| 125 | |
| 126 | func matchRuntimeMetricsRules(rules []internal.GoCollectorRule) []rmMetricDesc { |
| 127 | var descs []rmMetricDesc |
| 128 | for _, d := range metrics.All() { |
| 129 | var ( |
| 130 | deny = true |
| 131 | desc rmMetricDesc |
| 132 | ) |
| 133 | |
| 134 | for _, r := range rules { |
| 135 | if !r.Matcher.MatchString(d.Name) { |
| 136 | continue |
| 137 | } |
| 138 | deny = r.Deny |
| 139 | } |
| 140 | if deny { |
| 141 | continue |
| 142 | } |
| 143 | |
| 144 | desc.Description = d |
| 145 | descs = append(descs, desc) |
| 146 | } |
| 147 | return descs |
| 148 | } |
| 149 | |
| 150 | func defaultGoCollectorOptions() internal.GoCollectorOptions { |
| 151 | return internal.GoCollectorOptions{ |