-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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: compatibility between published Go types to collector's own types #4254
Comments
This is intentionally, and encourage to construct use directly the |
Alternative you can "Marshal" the go "otlp" and unmarshal as "pdata" |
I found it very limited and unintuitive to use. |
Sure, if you don't care about performance... |
" many fields are not settable." all the fields are settable, we are actually using them to construct everything. |
I've tried, and couldn't rewrite this code: https://github.com/cilium/hubble-otel/blob/acc3a282a62b35fa432b1d47200904082fbaf797/common/common.go#L178 It wasn't possible to handle |
@bogdandrutu this illustrates what I am actually referring to: opentelemetry-collector/model/pdata/generated_trace.go Lines 179 to 184 in db6d31e
The thing is that Inside the collector you can set any fields you like cause internal structs can still be accessed, but not in another project... You see what I'm saying now? |
@errordeveloper no I don't see what you are trying to say. If you need to create a new "ResourceSpans" you do from top to bottom:
vs
This is optimal to reduce the amount of allocations, as well as avoid common mistakes as "sharing" the same object between multiple data objects.
Inside the collector we use "model" module and we don't have access to internal as any other project. |
Right now it's not easily possible to covert data that was constructed using published Go types (
go.opentelemetry.io/proto/otlp
) and the internal version of the same (go.opentelemetry.io/collector/model
). This makes it very complicated for someone to build a collector component externally, e.g. they need to fork the collector repo or do other tricks, like marshalling and unmarshalling. Some types can be constructed using exported helpers, but it's hard to work with those and many fields are not settable.The text was updated successfully, but these errors were encountered: