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

Exporter Worker #13

Open
BraunreutherA opened this issue Aug 22, 2022 · 1 comment
Open

Exporter Worker #13

BraunreutherA opened this issue Aug 22, 2022 · 1 comment

Comments

@BraunreutherA
Copy link
Contributor

The Exporters - especially the ProtoExporters are quite big. How about using the new Cloudflare ServiceBinding to run a ExporterWorker. So the sdk could get split into the minimal instrumentation code which is small and optimized for execution. This part would the send the data in JSON form to the Exporter Worker which transforms it to Protobuf and sends it to the receiver.

Basically it's the idea of the OTLP collectors but fully serverless on CF.

What do you think @RichiCoder1 ?

@RichiCoder1
Copy link
Owner

RichiCoder1 commented Aug 22, 2022

It's an interesting idea for sure! Would make it much simpler to decouple configuration from indivudal services, and with the way bindings work it's essentially no/the-same overhead.

Maybe something like

// src/exporterService.ts
import { createExporterWorker } from "opentelemetry-sdk-workers";

export default {
	fetch: createExporterWorker({/* otlp config */})
};
// src/consumerWorker.ts
// This could probably have a much better name
import { traceViaBinding } from "opentelemtry-sdk-workers";

export default {
	fetch: traceViaBinding((request) => {
			return new Response("Hello World!");	
		}), 
		/* Take module env, and return exporter binding */ 
		env => env.EXPORTER_SERVICE
	);
};

It probably wouldn't reduce the default size much if any as we'd probably want to communicate via the standard JSON encoding (since it's all HTTP under the covers) but it means you don't have to bloat you worker for Proto support.

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

No branches or pull requests

2 participants