What is the expectation of dependencies already manually instrumented? #566
-
|
In a repository of "libraries" that has been instrumented for various reasons, does Orchestrion require commenting Case in point: package main
import "github.com/mysuperawesome/library/deps"
func main() {
//orchestrion:ignore
db, err := deps.NewDB()
defer db.Close()
//...
}Even though |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
|
👋 Hey @gabizou The answer to your question is: it depends on the library and how it's instrumented it. For example:
We are actively working on better configuration to detect and act in case we found cases of "doubly-instrumentation". Could you describe in more details what you would expect from orchestrion in cases like this ? |
Beta Was this translation helpful? Give feedback.
-
|
I guess this is also one case where having a report of what is being instrumented (and how) for a given app would be useful to gain quick insight into what happens where; as that'd then help determine how to change that configuration we're trying to design |
Beta Was this translation helpful? Give feedback.
-
I believe @RomainMuller has a brilliant suggestion on having an outlined report of what is being instrumented (and how). I'd expect orchestrion to detect if a dependency is already being potentially orchestrated by a dependency method like type RouterOption = func(next http.Handler) http.Handler
type Router interface {
Handle(path string, handler http.Handler) Route
ServeHTTP(w http.ResponseWriter, r *http.Request)
}
func NewRouter(options []RouterOption) Router {
chiRouter := chi.NewRouter()
for _, o := range options {
chiRouter.Use(o)
}
return &router{
Router: chiRouter,
}
}And separately, we've modularized our DataDog dependencies (makes updating our library modules a heck of a lot easier) so that we can easily include Which lead me to the question of how would it best be considered that the application that is trying to adopt orchestrion, to declare a dependency should not be instrumented as it's already possibly instrumented based on runtime configurations. |
Beta Was this translation helpful? Give feedback.
I'll note that as of
v1.1.0you're able to manually determine what integrations are going to be applied or not by controlling the contents of yourorchestrion.tool.gofile... That is kind of an "all-or-nothing" still (all net/http clients or none; not per individual client); but it gives you more control there.