feat(gw): tracing spans per response type#8841
Merged
Merged
Conversation
Adds more visibility into how long generic lookup takes vs producing specific response type.
Member
Author
|
@guseggert to make this easier to review, this PR points at your branch. If this looks good, feel free to merge, and we can continue in #8595 |
lidel
commented
Apr 1, 2022
|
|
||
| test_go_lint: test/bin/golangci-lint | ||
| golangci-lint run ./... | ||
| golangci-lint run --timeout=3m ./... |
guseggert
reviewed
Apr 1, 2022
| func (i *gatewayHandler) serveRawBlock(w http.ResponseWriter, r *http.Request, blockCid cid.Cid, contentPath ipath.Path, begin time.Time) { | ||
| blockReader, err := i.api.Block().Get(r.Context(), contentPath) | ||
| func (i *gatewayHandler) serveRawBlock(w http.ResponseWriter, r *http.Request, resolvedPath ipath.Resolved, contentPath ipath.Path, begin time.Time) { | ||
| ctx, span := tracing.Span(r.Context(), "Gateway", "ServeRawBlock", trace.WithAttributes(attribute.String("path", resolvedPath.String()))) |
Contributor
There was a problem hiding this comment.
Do we need this attribute, since the path is already on the parent span?
Member
Author
There was a problem hiding this comment.
My understanding is yes: one may want to inspect this span on its own + this path is "resolved one", so it adds additional context when /ipns/ was used for initial request (no need to look at all Resolve operations before it to find out final path)
lidel
added a commit
that referenced
this pull request
Apr 4, 2022
* add deprecation warning when tracer plugins are loaded * add response format attribute to span in gateway handler * add note about tracing's experimental status in godoc * add nil check for TTL when adding name span attrs * add basic sharness test for integration with otel collector * add nil check in UnixFSAPI.processLink * test: sharness check all json objs for swarm span * add env var docs to docs/environment-variables.md * chore: pin the otel collector version * add tracing spans per response type (#8841) * docs: tracing with jaeger-ui Co-authored-by: Marcin Rataj <lidel@lidel.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR extends #8595 with spans for each response type from #8758
Adds more visibility into how long generic lookup takes vs producing specific response type.
Demo