-
Notifications
You must be signed in to change notification settings - Fork 3
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
Basic instrumentation of Cloudflare bindings (AI, KV, R2, D1) #196
Merged
brettimus
merged 25 commits into
main
from
fp-3992-otel-client-library-instrument-cloudflare-bindings
Aug 28, 2024
Merged
Basic instrumentation of Cloudflare bindings (AI, KV, R2, D1) #196
brettimus
merged 25 commits into
main
from
fp-3992-otel-client-library-instrument-cloudflare-bindings
Aug 28, 2024
Conversation
This file contains 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
commit:
|
brettimus
force-pushed
the
fp-3992-otel-client-library-instrument-cloudflare-bindings
branch
2 times, most recently
from
August 27, 2024 12:16
a11d70a
to
6a88421
Compare
brettimus
force-pushed
the
fp-3992-otel-client-library-instrument-cloudflare-bindings
branch
from
August 28, 2024 05:51
ae1e717
to
9d2091f
Compare
brettimus
changed the title
Prototype proxying cloudflare bindings (AI and R2)
Basic instrumentation of Cloudflare bindings (AI, KV, R2, D1)
Aug 28, 2024
stephlow
approved these changes
Aug 28, 2024
brettimus
deleted the
fp-3992-otel-client-library-instrument-cloudflare-bindings
branch
August 28, 2024 16:16
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.
Summary
This PR adds some automatic instrumentation for certain Cloudflare bindings:
It also introduces a sample application for testing this instrumentation, called
goosify
. To run the sample app, you'll need a Cloudflare account.Running the Sample App
To run the sample app
pnpm i cd examples/goosify pnpm db:touch pnpm db:migrate pnpm dev
To make requests against the sample app:
cd examples/goosify pnpx @fiberplane/studio@latest
If you want to use the Studio in this repo, instead of a published version:
cd api FPX_WATCH_DIR=../examples/goosify pnpm dev
Attributes
The philosophy right now is to keep the attributes as uniform and bare-bones as possible, and make the frontend responsible for wrapping them up into something more user-friendly.
To that end, we just record the binding name, binding type, method invoked, and arguments. There can also be an (optional) error, if the function errored.
Measured methods of the cf bindings will have the following attributes: