Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

feat: trace context traceparent header support #74

Merged
merged 1 commit into from
Apr 11, 2023
Merged

feat: trace context traceparent header support #74

merged 1 commit into from
Apr 11, 2023

Conversation

hacdias
Copy link
Collaborator

@hacdias hacdias commented Apr 4, 2023

main.go Outdated Show resolved Hide resolved
@hacdias hacdias self-assigned this Apr 4, 2023
@hacdias hacdias marked this pull request as ready for review April 4, 2023 11:16
@hacdias hacdias requested a review from lidel April 4, 2023 11:16
@hacdias hacdias force-pushed the issue/68 branch 2 times, most recently from a53e879 to 0c859c1 Compare April 5, 2023 09:48
@hacdias hacdias changed the title feat: add traceparent header feat: support Trace Context Apr 5, 2023
Copy link
Collaborator

@lidel lidel left a comment

Choose a reason for hiding this comment

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

Thank you @hacdias, left a comment above.

I think the next steps here is to make this universal feature:

  • support what Kubo supports (docs)
  • confirm that traceparent is applied to all requests sent by bifrost-gateway to other systems
  • add "How to use tracing?" to FAQ in README.md
    • example how to pass traceparent
    • example how to trace with Jaeger UI (link to /docs/environment-variables.md#tracing based on Kubo?)

@hacdias
Copy link
Collaborator Author

hacdias commented Apr 6, 2023

I'm using Kubo @ ipfs/kubo#9801 for testing.

Connected traces of Bifrost Gateway proxying requests to Kubo (PROXY_GATEWAY_URL):

image

Connected traces of Bifrost Gateway proxying IPNS records to Kubo (KUBO_RPC_URL):

image

STRN_ORCHESTRATOR_URL should work since we wrap the caboose transport with otelhttp and caboose already uses the request with context:

https://github.com/filecoin-saturn/caboose/blob/34e6ab0f0e60ed6bef02b06242573aa5ab06bd37/fetcher.go#L215-L219

@hacdias hacdias requested a review from lidel April 6, 2023 14:27
@hacdias hacdias changed the title feat: support Trace Context feat: support trace context tracing with OTel Apr 6, 2023
@hacdias hacdias force-pushed the issue/68 branch 2 times, most recently from 5b1290f to 3e682ed Compare April 11, 2023 09:45
Copy link
Collaborator

@lidel lidel left a comment

Choose a reason for hiding this comment

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

Thank you @hacdias!

Demo

OTEL_TRACES_EXPORTER=jaeger with Jaeger UI:

Screenshot 2023-04-12 at 01-02-57 Jaeger UI

@lidel lidel changed the title feat: support trace context tracing with OTel feat: trace context traceparent header support Apr 11, 2023
@lidel lidel merged commit 660ec70 into main Apr 11, 2023
@lidel lidel deleted the issue/68 branch April 11, 2023 23:48
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.

Support Trace Context HTTP headers
2 participants