Skip to content

Forward traces from the web UI#18519

Merged
rosstimothy merged 6 commits intomasterfrom
tross/proxy_ui_trace_forwarding
Nov 18, 2022
Merged

Forward traces from the web UI#18519
rosstimothy merged 6 commits intomasterfrom
tross/proxy_ui_trace_forwarding

Conversation

@rosstimothy
Copy link
Copy Markdown
Contributor

Adds a /webapi/traces endpoint to the proxy web handler to allow receiving traces from the UI so that they can be forwarded to the configured exporter in the proxy_service.

To accomodate traces coming in via websockets the tracing handler is updated to pull tracing context first from the standard headers and fallback to retrieving it from a query parameter as web sockets from the UI cannot alter headers.

Additionally update web.Terminal to propagate the tracing context properly and instruments some of the functions to ensure spans from the UI are properly correlated to spans on the backend.

@rosstimothy rosstimothy force-pushed the tross/proxy_ui_trace_forwarding branch from 465b838 to 5cc2c3d Compare November 16, 2022 16:23
@rosstimothy rosstimothy marked this pull request as ready for review November 16, 2022 16:48
Comment thread lib/web/apiserver.go Outdated
Comment thread lib/httplib/httplib_test.go Outdated
Comment thread lib/httplib/httplib_test.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
require.Empty(t, req.Header.Get(tracing.TraceParent))
require.Empty(t, req.Header.Get(tracing.TraceParent), "TraceParent header mismatch")

Same for others.

Comment thread lib/web/apiserver.go Outdated
Comment thread lib/web/apiserver_test.go Outdated
Comment thread lib/web/apiserver_test.go Outdated
Comment thread lib/web/apiserver_test.go Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
require.Empty(t, spans)
require.Empty(t, spans, "Spans mismatch")

Same for others. (Message could be better, up to you.)

Comment thread lib/web/apiserver_test.go Outdated
Comment thread lib/web/apiserver_test.go Outdated
Comment thread lib/web/apiserver_test.go Outdated
Comment thread lib/web/apiserver_test.go Outdated
Comment thread lib/web/apiserver.go Outdated
Comment thread lib/web/apiserver.go Outdated
Comment thread lib/web/apiserver.go Outdated
Comment thread lib/web/apiserver.go Outdated
Comment thread lib/web/apiserver.go Outdated
@github-actions github-actions Bot removed the request for review from xacrimon November 17, 2022 22:48
Adds a `/webapi/traces` endpoint to the proxy web handler
to allow receiving traces from the UI so that they can
be forwarded to the configured exporter in the proxy_service.

To accomodate traces coming in via websockets the tracing
handler is updated to pull tracing context first from the
standard headers and fallback to retrieving it from a query
parameter as web sockets from the UI cannot alter headers.

Additionally update `web.Terminal` to propagate the tracing
context properly and instruments some of the functions
to ensure spans from the UI are properly correlated to spans
on the backend.
@rosstimothy rosstimothy force-pushed the tross/proxy_ui_trace_forwarding branch from 577f84d to e4a9031 Compare November 18, 2022 12:38
@rosstimothy rosstimothy enabled auto-merge (squash) November 18, 2022 12:39
@rosstimothy rosstimothy merged commit 02433f6 into master Nov 18, 2022
@github-actions
Copy link
Copy Markdown
Contributor

@rosstimothy See the table below for backport results.

Branch Result
branch/v11 Failed

rosstimothy added a commit that referenced this pull request Nov 18, 2022
Adds a `/webapi/traces` endpoint to the proxy web handler
to allow receiving traces from the UI so that they can
be forwarded to the configured exporter in the proxy_service.

To accomodate traces coming in via websockets the tracing
handler is updated to pull tracing context first from the
standard headers and fallback to retrieving it from a query
parameter as web sockets from the UI cannot alter headers.

Additionally update `web.Terminal` to propagate the tracing
context properly and instruments some of the functions
to ensure spans from the UI are properly correlated to spans
on the backend.
@rosstimothy rosstimothy deleted the tross/proxy_ui_trace_forwarding branch November 18, 2022 17:36
rosstimothy added a commit that referenced this pull request Nov 18, 2022
Adds a `/webapi/traces` endpoint to the proxy web handler
to allow receiving traces from the UI so that they can
be forwarded to the configured exporter in the proxy_service.

To accomodate traces coming in via websockets the tracing
handler is updated to pull tracing context first from the
standard headers and fallback to retrieving it from a query
parameter as web sockets from the UI cannot alter headers.

Additionally update `web.Terminal` to propagate the tracing
context properly and instruments some of the functions
to ensure spans from the UI are properly correlated to spans
on the backend.
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.

4 participants