WIP: Init OpenTelemetry Support #32971
Draft
+255
−12
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add otel support to Gitea. Includes DB & HTTP request spans. Tested with honeycomb and uptrace.
Marked as WIP, this is more for discussion purposes and possibly contributing to a future feature than anything else. There are several flaws with this PR as it currently exists, the first being that it essentially hardcodes using the HTTP collector vs allowing GRPC as an alternative and that the settings to configure this are entirely env var-based rather than using an existing pattern for settings config in the app.ini file. More on that last point, since the configuration is left to env vars, this is essentially always on, and with no config, will be screaming into the void, possibly at a service listening on the localhost port (this is less than ideal, to say the least). There are also no tests for this PR, which again, is less than ideal, although this PR purpose leads tests for it to be unnecessary, as it is unlikely to be merged in this state (
If this were to go anywhere, collecting some span/traces for shelling out would be nice and possibly adding tracing for Redis/Memcached, too, if needed.
From testing this PR, I've already identified a few hotspots of areas that could receive extra attention, but those will be collected later.
Related Issue: #32866