-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
515 additions
and
417 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package otelfx | ||
|
||
import "go.uber.org/fx" | ||
|
||
var Module = fx.Module( | ||
"winterfx_core_otelfx", | ||
fx.Invoke(Setup), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package otelfx | ||
|
||
import ( | ||
"go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp" | ||
"net/http" | ||
) | ||
|
||
func InstrumentHTTPHandler(pattern string, h http.Handler) http.Handler { | ||
return otelhttp.NewHandler(otelhttp.WithRouteTag(pattern, h), pattern) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package probefx | ||
|
||
import ( | ||
"context" | ||
"go.uber.org/fx" | ||
) | ||
|
||
type CheckerFunc func(ctx context.Context) error | ||
|
||
type checker struct { | ||
name string | ||
fn CheckerFunc | ||
} | ||
|
||
func AsCheckerProvider[T any](fn func(v T) (name string, cfn CheckerFunc)) any { | ||
return fx.Annotate( | ||
func(v T) checker { | ||
name, cfn := fn(v) | ||
return checker{name: name, fn: cfn} | ||
}, | ||
fx.ResultTags(`group:"winterfx_core_probefx_checkers"`), | ||
) | ||
} |
Oops, something went wrong.