Commit 1935c13
[release-1.20] fix: Remove duplicate OTEL observability setup in imc-dispatcher (#8886)
fix: Remove duplicate OTEL observability setup in imc-dispatcher
The imc-dispatcher was calling otel.SetupObservabilityOrDie in its
NewController function, but sharedmain.MainWithContext already sets up
observability before calling NewController. This caused Go runtime
metrics to be registered twice, resulting in the error:
"collected metric 'go_memory_allocations_total' was collected before
with the same name and label values"
This caused the metrics endpoint (/metrics) to fail with an error,
preventing Prometheus from scraping metrics.
Changes:
- Use otel.GetMeterProvider() and otel.GetTracerProvider() to get the
global providers already set up by sharedmain
- Remove duplicate pprof server creation (sharedmain handles it)
- Remove pprof config watch (sharedmain handles it)
- Remove provider shutdown calls (sharedmain handles cleanup)
- Clean up unused imports
Co-authored-by: Christoph Stäbler <cstabler@redhat.com>1 parent 85b4782 commit 1935c13
1 file changed
+5
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
35 | | - | |
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
43 | 42 | | |
44 | | - | |
45 | 43 | | |
46 | 44 | | |
47 | 45 | | |
| |||
55 | 53 | | |
56 | 54 | | |
57 | 55 | | |
58 | | - | |
59 | 56 | | |
60 | 57 | | |
61 | 58 | | |
| |||
85 | 82 | | |
86 | 83 | | |
87 | 84 | | |
88 | | - | |
89 | | - | |
90 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
91 | 88 | | |
92 | 89 | | |
93 | 90 | | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | 91 | | |
98 | 92 | | |
99 | 93 | | |
| |||
222 | 216 | | |
223 | 217 | | |
224 | 218 | | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 219 | + | |
235 | 220 | | |
236 | 221 | | |
237 | 222 | | |
| |||
0 commit comments