Skip to content
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

Make it possible to configure the ObservabilityService into the NewHTTPReceiveHandler method #1090

Open
simone-livraghi-globant opened this issue Aug 23, 2024 · 0 comments

Comments

@simone-livraghi-globant

When you invoke the NewHTTPReceiveHandler method, a noopObservabilityService is set by default, and you cannot change it.

`func NewHTTPReceiveHandler(ctx context.Context, p *thttp.Protocol, fn interface{}) (*EventReceiver, error) {
invoker, err := newReceiveInvoker(fn, noopObservabilityService{}, nil, nil, false) //TODO(slinkydeveloper) maybe not nil?
if err != nil {
return nil, err
}

return &EventReceiver{
	p:       p,
	invoker: invoker,
}, nil

}`

Other methods instead have the Option varargs to configure it. For example with this one:
func WithObservabilityService(service ObservabilityService) Option { return func(i interface{}) error { if c, ok := i.(*ceClient); ok { c.observabilityService = service c.inboundContextDecorators = append(c.inboundContextDecorators, service.InboundContextDecorators()...) } return nil } }

Can** WithObservabilityService ** be made available in the NewHTTPReceiveHandler method?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant