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

OTLP proto encoding in a standalone package #5068

Closed
sfc-gh-sili opened this issue Dec 29, 2022 · 5 comments
Closed

OTLP proto encoding in a standalone package #5068

sfc-gh-sili opened this issue Dec 29, 2022 · 5 comments
Labels
Feature Request Suggest an idea for this project

Comments

@sfc-gh-sili
Copy link

TL;DR; Can we have (Java object -> proto) code in a standalone package instead of in exporter-otlp-common which pulls in okhttps?

Is your feature request related to a problem? Please describe.

We are implementing our own SpanExporter that outputs spans in OTLP format, and we are trying to reuse the Java object -> proto encoding code instead of writing our own. The bare minimum package that includes the objectToProto() encoding would be exporter-otlp-common, but it pulls in okhttp3 as its dependency.

Describe the solution you'd like
Is it possible to have Java object -> proto encoding code released in a standalone package instead of as part of OtlpGrpcExporter or OtlpHttpExporter?

Describe alternatives you've considered
A couple of alternatives we are exploring right now:

  1. Having our own version of Java object -> proto encoding code, but it's something we want to avoid in general.
  2. Marking transitive dependencies (e.g. okhttps3, okio, kotlin) as optional or exclude.

Additional context
We will be running user defined functions in the same environment, so we are extra cautious about every single new dependency.

@sfc-gh-sili sfc-gh-sili added the Feature Request Suggest an idea for this project label Dec 29, 2022
@jack-berg
Copy link
Member

What functionality is your SpanExporter providing that isn't available in OtlpGrpcSpanExporter or OtlpHttpSpanExporter?

If you really need to provide your own SpanExporter, I would suggest excluding the okhttp dependency. The code in :exporters:otlp:common is meant for internal use only and I think it should stay that way.

@sfc-gh-sili
Copy link
Author

What functionality is your SpanExporter providing that isn't available in OtlpGrpcSpanExporter or OtlpHttpSpanExporter?

  1. We run user defined functions in a sandbox environment that has no access to the network, so neither GRPC or HTTP works.
  2. We auto-instrument spans and tie those to user defined functions. This means we are sending a bunch of meta data (e.g. function ID, user ID) with the span proto.

Essentially we would like to stick to the OTLP proto standard, but sending protos via Grpc or Http doesn't work for our use case

@jack-berg
Copy link
Member

jack-berg commented Dec 29, 2022

Interesting. Could you use the OtlpJsonLoggingSpanExporter and parse the OTLP JSON encoded content from the logs?

@sfc-gh-sili
Copy link
Author

Yes that could definitely be an option, but it takes another layer of parsing which we prefer not to have.

@jack-berg
Copy link
Member

Since last commenting on this, we've done some refactoring and exporter-otlp-common no longer includes a dependency on okhttp.

Closing because the original ask is completed, although I still don't recommend using the marshalers because they're in internal classes and not subject to our API compatibility guarantees.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Suggest an idea for this project
Projects
None yet
Development

No branches or pull requests

2 participants