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

ptrace performance #11674

Open
XiaoWeiKIN opened this issue Nov 14, 2024 · 2 comments
Open

ptrace performance #11674

XiaoWeiKIN opened this issue Nov 14, 2024 · 2 comments

Comments

@XiaoWeiKIN
Copy link

I was converting some of my internal traces data to otlp data, and I needed to consume these json type data from kafka and serialize it to ptraces, so I developed a custom encoding extension, but I found that ptraces AppendEmpty was constantly creating objects, So I wanted to use sync.pool optimization, but found that there was no API to use, and the properties were all packaged in-house. Do you have any plans?

image

@dmathieu
Copy link
Member

If this data is generated outside the collector, you should probably be using the protobuf directly rather than pdata.
Doing so will still let you ingest into the collector (pdata is an abstraction on top of protobuf), and will let you use a pool as you need.

https://github.com/open-telemetry/opentelemetry-proto-go

@XiaoWeiKIN
Copy link
Author

thanks @dmathieu , but traces consumer requires ptrace.Traces, how should I create ptrace.Traces through https://github.com/open-telemetry/opentelemetry-proto-go without related API

// Traces is an interface that receives ptrace.Traces, processes it
// as needed, and sends it to the next processing node if any or to the destination.
type Traces interface {
	internal.BaseConsumer
	// ConsumeTraces receives ptrace.Traces for consumption.
	ConsumeTraces(ctx context.Context, td ptrace.Traces) error
}

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