plenty of changes to make the package more ergonomic

Including: bug fixes, api changes, new packages, and more!
This commit is contained in:
2024-05-17 15:31:35 +02:00
parent e835318689
commit 3c51f5575b
10 changed files with 378 additions and 178 deletions

View File

@ -25,7 +25,7 @@ type Config struct {
Version string
// Name of an organization providing the service
ServiceProvider string
Exporters []exporters.ExporterWithConfig
Exporters []exporters.TraceExporter
}
func newResource(config Config) *resource.Resource {
@ -38,6 +38,16 @@ func newResource(config Config) *resource.Resource {
return r
}
// NOTE: You can use [trace.WithAttributes] as a parameter to opts argument
func Start(ctx context.Context, spanName string, opts ...trace.SpanStartOption) (context.Context, trace.Span) {
return fiberOpentelemetry.Tracer.Start(ctx, spanName, opts...)
}
// NOTE: You can use [trace.WithAttributes] as a parameter to opts argument
func FStart(c *fiber.Ctx, opts ...trace.SpanStartOption) (context.Context, trace.Span) {
return fiberOpentelemetry.Tracer.Start(c.UserContext(), c.Method()+" "+c.Path(), opts...)
}
func NewMiddleware(config Config) func(*fiber.Ctx) error {
var tracerProviders []trc.TracerProviderOption