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: make trace provider in loadtest, add tracing to sdk #4939

Merged
merged 5 commits into from
Nov 8, 2022

Conversation

deansheather
Copy link
Member

  • Create a tracing provider in coder loadtest using the given configuration flags
  • Create a global span for the entire loadtest process
  • Add tracing to codersdk.(*Client).Request (using parent function name) and select other methods in codersdk
  • Add tracing to loadtests
  • Add request/response logging support to codersdk
  • Add trace propagation to codersdk (opt-in on *Client through an option) and coderd using the standardized traceparent header

Untested whether the tracing propagation works, I'll need to setup a test env for it

coderd/tracing/httpmw.go Outdated Show resolved Hide resolved
ctx, span := tracing.StartSpan(ctx)
defer span.End()

conn, err := c.DialContextTCP(ctx, netip.AddrPortFrom(TailnetIP, uint16(TailnetReconnectingPTYPort)))
Copy link
Member

Choose a reason for hiding this comment

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

Might be nice to capture the errors in the span too.

Copy link
Member Author

Choose a reason for hiding this comment

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

There are a lot of errors across the codebase we would have to catch, so it's kinda weird to only do it here. It'd be nice if we could hook into all returned error values in Golang but I don't think that's possible without writing and enforcing a wrapper for errors instead of xerrors.Errorf

@deansheather
Copy link
Member Author

Propagation works properly now.

@deansheather deansheather merged commit d82364b into main Nov 8, 2022
@deansheather deansheather deleted the dean/codersdk-tracing branch November 8, 2022 22:10
@github-actions github-actions bot locked and limited conversation to collaborators Nov 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants