-
Notifications
You must be signed in to change notification settings - Fork 431
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some endpoints are not instrumented in the configured tracing tool (OpenTelemetry) #19696
Comments
@mna can you please provide some incentives why it's a bug (not improvement) ? |
@sharon-fdm @lukeheath Good question, I originally labeled it a bug as it looks like we wanted to instrument all routes and missed a few, but I could see it as an improvement too (we instrumented some endpoints, and now we want to extend that instrumentation). I think for Fleet users that enable instrumentation, it would be surprising to only have a subset of endpoints show up in their dashboard - which makes it more a bug. But on the other hand I don't think we document much how to enable instrumentation (whether it's the open telemetry one or the Elastic APM one, I can't find any mention of how to enable them in https://fleetdm.com/docs/configuration/fleet-server-configuration). |
@mna, OK. Will treat as a bug and will estimate next estimation session. |
We estimate as 3 and think it's a feature that needs prioritization. |
#19696 # Checklist for submitter - [x] Changes file added for user-visible changes in `changes/`, `orbit/changes/` or `ee/fleetd-chrome/changes`. - [x] Manual QA for all new/changed functionality
Fleet version:
4.51.0
Web browser and operating system:
N/A
Update (2024/11/18): The APM part of this issue is covered in #23902
💥 Actual behavior
APM (or opentelemetry) is setup for API routes here:
fleet/server/service/handler.go
Lines 140 to 146 in 9867991
However, we have a number of routes that are handled outside of that Gorilla Mux:
fleet/cmd/fleet/serve.go
Lines 967 to 970 in 9867991
fleet/cmd/fleet/serve.go
Lines 1015 to 1028 in 9867991
fleet/cmd/fleet/serve.go
Line 1066 in 9867991
fleet/cmd/fleet/serve.go
Line 1071 in 9867991
fleet/server/service/handler.go
Line 1085 in 9867991
fleet/server/service/handler.go
Line 1145 in 9867991
This ticket is to determine which of those (all? all but frontend? just the Apple MDM ones?) should be instrumented, and to add that instrumentation accordingly (same-ish way it is done for the API routes at the moment).
🕯️ More info (optional)
It looks like both Elastic APM and OpenTelemetry have a package to wrap a standard net/http handler, similar to the one they provide to wrap the gorilla mux used in our API routes, so those could probably be used:
We should take the time to check that they are setup in a consistent way vs the Gorilla one. Elastic APM can be tested locally (see https://github.com/fleetdm/fleet/tree/main/tools/apm-elastic).
The text was updated successfully, but these errors were encountered: