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

feat(tracing): Initial setup for otel tracing #10

Merged
merged 5 commits into from
Jul 18, 2024

Conversation

ritesh089
Copy link
Collaborator

This PR will be used as a base for otel tracing in the provider.

Copy link
Collaborator

@brooksmtownsend brooksmtownsend left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tracing span implementation looks good 👍🏻 I had a couple nits and one blocker around the HTTP endpoint

main.go Outdated Show resolved Hide resolved
main.go Outdated Show resolved Hide resolved
main.go Show resolved Hide resolved
main.go Outdated
Comment on lines 78 to 85
// Start HTTP server.
srv := &http.Server{
Addr: ":8080",
BaseContext: func(_ net.Listener) context.Context { return ctx },
ReadTimeout: time.Second,
WriteTimeout: 10 * time.Second,
Handler: newHTTPHandler(),
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some concerns about also using an HTTP server here for the health check, the provider does already have a health endpoint that's accessible over NATS. Is this health endpoint primarily used to demonstrate a trace or is it meant to be an indicator of provider health?

At the very least I think we should change this to a different port than 8080 since it's so common to use that for our HTTP endpoints for wasmCloud apps

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The purpose of this endpoint was to demonstrate that the trace is working when integrating via Jaeger . I am ok to change it . Do you think its better to remove this http endpoint ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the port and simplified the tracing to replicate how it will be executed from the GET, PUT and other functions.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be best to remove it and use the wasmCloud NATS health check endpoint for testing tracing if that's possible, that should be possible with the handleHealthCheck option with the provider SDK

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok . I deleted the http health check endpoint. Have already verified that tracing with otel setup works here.

main.go Outdated
Comment on lines 30 to 31
// traceProvider := otel.GetTracerProvider()
// tracer := traceProvider.Tracer("healthcheck")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this code isn't needed, can we remove it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed.

@ritesh089 ritesh089 merged commit 6f10e74 into couchbaselabs:main Jul 18, 2024
1 check passed
@ritesh089 ritesh089 deleted the feat/otel branch July 18, 2024 18:59
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

Successfully merging this pull request may close these issues.

2 participants