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

Instrumentation doesn't work with esutil.bulkindexer #899

Open
lucax88x opened this issue Aug 7, 2024 · 0 comments
Open

Instrumentation doesn't work with esutil.bulkindexer #899

lucax88x opened this issue Aug 7, 2024 · 0 comments

Comments

@lucax88x
Copy link

lucax88x commented Aug 7, 2024

Ciao!

Calls using the default client, which I've properly configured, like the ping, is correctly sending traces to otel, but if we use the esutil.bulkindexer nothing is sent out.

	client, err := db.NewElasticsearchClient(db.ElasticsearchOptions{
		Address:  cb.Config.Elasticsearch.Address,
		Username: cb.Config.Elasticsearch.Username,
		Password: cb.Config.Elasticsearch.Password,
		Instrumentation: elasticsearch.NewOpenTelemetryInstrumentation(
			otel.GetTracerProvider(),
			cb.Config.Elasticsearch.CaptureSearchBody,
		),
	})

We found out that the following snippet of code, when it creates the esapi.BulkRequest, it's not setting the instrument field (I can guess because it's private...)

req := esapi.BulkRequest{

Could it be the culript?
We are able to do a PR, if you can give us some insights how you would prefer to fix it.

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

1 participant