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

[o11y] Add remaining R2 span tags #3256

Closed
wants to merge 1 commit into from

Conversation

fhanau
Copy link
Collaborator

@fhanau fhanau commented Dec 18, 2024

Please consult the (internal) span definitions to review the added span tags. Input is welcome on API design for r2GetClient() and getHttpClientWithCallback().

@fhanau fhanau requested a review from mikea December 18, 2024 16:12
@fhanau fhanau requested review from a team as code owners December 18, 2024 16:12
@fhanau fhanau requested review from ObsidianMinor and removed request for a team December 18, 2024 16:12
Copy link

github-actions bot commented Dec 18, 2024

The generated output of @cloudflare/workers-types has been changed by this PR. If this is intentional, run bazel build //types && rm -rf types/generated-snapshot && cp -r bazel-bin/types/definitions types/generated-snapshot to update the snapshot. Alternatively, you can download the full generated types: https://github.com/cloudflare/workerd/actions/runs/12562988297/artifacts/2374928934

Full Type Diff
diff -r bazel-bin/types/definitions/experimental/index.d.ts types/generated-snapshot/experimental/index.d.ts
1680c1680
<   cache?: "no-store" | "no-cache";
---
>   cache?: "no-store";
1694c1694
<   cache?: "no-store" | "no-cache";
---
>   cache?: "no-store";
diff -r bazel-bin/types/definitions/experimental/index.ts types/generated-snapshot/experimental/index.ts
1688c1688
<   cache?: "no-store" | "no-cache";
---
>   cache?: "no-store";
1702c1702
<   cache?: "no-store" | "no-cache";
---
>   cache?: "no-store";

@fhanau fhanau force-pushed the felix/subrequest-client-spans-next branch from 24366c3 to f4b9130 Compare December 18, 2024 16:45
@fhanau fhanau requested a review from a team as a code owner December 18, 2024 16:45
@fhanau fhanau force-pushed the felix/111524-user-tracing-otel-v1 branch from 598986f to 956a297 Compare December 18, 2024 16:51
Base automatically changed from felix/111524-user-tracing-otel-v1 to main December 18, 2024 17:39
@fhanau fhanau force-pushed the felix/subrequest-client-spans-next branch from f4b9130 to a8d937b Compare December 18, 2024 17:43
@fhanau fhanau mentioned this pull request Dec 20, 2024
src/workerd/io/io-context.h Outdated Show resolved Hide resolved
@@ -24,6 +24,25 @@
#include <regex>

namespace workerd::api::public_beta {
kj::Own<kj::HttpClient> r2GetClient(IoContext& context,
uint subrequestChannel,
kj::LiteralStringConst op,
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel that defining a simple struct UserTracing or something would go a long way for readability above (due to .method = "r2_delete"_kjc) and below because of maybe casts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

To make sure I understand correctly – I assume you mean a struct like this:

struct UserTracing {
  kj::LiteralStringConst op;
  kj::LiteralStringConst method;
  kj::Maybe<kj::StringPtr> bucket;
  kj::Maybe<StringTagParams> extraTag;
};

Then we could pass parameters simply as {"r2_get"_kjc, "GetObject"_kjc, this->adminBucketName()}, but you prefer using this instead?

{
.op = "r2_get"_kjc,
.method = "GetObject"_kjc,
.bucket = this->adminBucketName()
}

FWIW I was able to clean up the Maybe<StringTagParams> wrappers in the last push.

Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer the version with names spelled out, yes. It is much easier to read and understand how r2_get is different from GetObject

@fhanau fhanau force-pushed the felix/subrequest-client-spans-next branch 3 times, most recently from d368098 to c033b70 Compare December 31, 2024 00:12
src/workerd/api/r2-bucket.c++ Show resolved Hide resolved
@@ -24,6 +24,25 @@
#include <regex>

namespace workerd::api::public_beta {
kj::Own<kj::HttpClient> r2GetClient(IoContext& context,
uint subrequestChannel,
kj::LiteralStringConst op,
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer the version with names spelled out, yes. It is much easier to read and understand how r2_get is different from GetObject

@fhanau fhanau force-pushed the felix/subrequest-client-spans-next branch from 3a95a73 to 13135a2 Compare December 31, 2024 18:54
@fhanau
Copy link
Collaborator Author

fhanau commented Jan 8, 2025

Merged via #3261.

@fhanau fhanau closed this Jan 8, 2025
@fhanau fhanau deleted the felix/subrequest-client-spans-next branch January 8, 2025 16:57
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.

3 participants