-
Notifications
You must be signed in to change notification settings - Fork 51
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
[feature request]: Support for Cloudflare Pages #96
Comments
Hey @vanstinator! Your branch looks like a pretty good start to me. Definitely welcome to PRs to add Pages support! |
@vanstinator - does Datadog provide a public trace endpoint or do you run your own public agent to send the data to? |
For the time being we're going to be running an agent. I'm not sure how we'll expose it yet, those discussions are still happening internally. |
I'd love to see this! We're running Remix on Workers Sites for now, but we won't be able to for long. The latest Remix (using Vite vs esbuild) doesn't support Workers Sites any longer because they're deprecated for full-stack apps I'm working on the replacement now, and would be happy to help test this out |
@vanstinator are you opposed to opening the PR now so this can be merged and allow others to debug/contribute? As I mentioned we'll soon need to use Pages for our Remix app and I'd love to have this (or be able to debug/fix any issues I find while testing) |
Hey @jfsiii I think I can make that happen. I'll lightly clean up my branch today and get a PR open! |
The PR is up! |
Any progress on this issue? |
Unfortunately not. I was forced to step back from maintaining this for the better part of a year and @jahands and co have done an amazing job at keeping the lights on, but didn't have a lot of time to work on adding new features. I am back, so will spend some time over the next week or so to get my bearing and work on it again. My first priority is to ship a 1.0 and get any breaking changes out of the way as much as I can. My next priority is to go through some of the PRs that implement new features and incorporate those too. That includes this one. |
I left the job that was building this out, and I don't have any personal projects on CF-workers where I'd need this unfortunately. |
fwiw this seems to work for Next.js: // instrumentation.ts
import { OTLPExporter } from "@microlabs/otel-cf-workers";
import { SimpleSpanProcessor } from "@opentelemetry/sdk-trace-node";
import { registerOTel } from "@vercel/otel";
export function register() {
registerOTel({
serviceName: "nextjs-app",
spanProcessors: [
// @ts-expect-error for some reason the type doesn't match but it actually works
new SimpleSpanProcessor(
new OTLPExporter({
url: "yourURL",
headers: {
// req headers
},
}),
),
],
});
} |
We're starting to use Cloudflare Pages at Plex for a new layer in our API. We're also heavy users of Datadog, and would like to be able to auto-instrument our Pages codebase so we have e2e traces across our backend stack.
I've been hacking on some support for this, and we have it working internally. Would you be interested in a taking a PR that adds support for CF Pages auto-instrumentation?
I have an in-progress hacked together branch on my fork main...vanstinator:otel-cf-workers:feat/cf-pages
The code ended up being almost identical to the fetch instrumentation. I think it will be relatively trivial to clean up my exploration work and land on a solution that extends the fetch functionality with a few additional lines of code and another function export.
If this sounds good I can probably schedule work to productionize the patch in the next month or two.
The text was updated successfully, but these errors were encountered: