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

ElasticSearchIntegration - performRequest does not exist on class #191

Closed
LavaToaster opened this issue Dec 17, 2018 · 2 comments
Closed
Labels
🐛 bug Something isn't working 🎉 new-integration A new integration

Comments

@LavaToaster
Copy link

When I enabled the DD APM I got the following error message

┌─[root@server] - [/opt/app/qa/api] - [2018-12-17 12:59:26]
└─[0] <> php artisan

In ElasticSearchIntegration.php line 160:

  [InvalidArgumentException]
  failed to set return for Elasticsearch\Endpoints\AbstractEndpoint::performRequest, the method does not exist


Exception trace:
 () at /opt/app/qa/api/vendor/datadog/dd-trace/src/DDTrace/Integrations/ElasticSearch/V1/ElasticSearchIntegration.php:160
 dd_trace() at /opt/app/qa/api/vendor/datadog/dd-trace/src/DDTrace/Integrations/ElasticSearch/V1/ElasticSearchIntegration.php:160
 DDTrace\Integrations\ElasticSearch\V1\ElasticSearchIntegration::load() at n/a:n/a
 call_user_func() at /opt/app/qa/api/vendor/datadog/dd-trace/src/DDTrace/Integrations/IntegrationsLoader.php:54
 DDTrace\Integrations\IntegrationsLoader::load() at /opt/app/qa/api/vendor/datadog/dd-trace/src/DDTrace/Integrations/Laravel/V5/LaravelProvider.php:172
 DDTrace\Integrations\Laravel\V5\LaravelProvider->boot() at n/a:n/a
 call_user_func_array() at /opt/app/qa/api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:29
 Illuminate\Container\BoundMethod::Illuminate\Container\{closure}() at /opt/app/qa/api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:87
 Illuminate\Container\BoundMethod::callBoundMethod() at /opt/app/qa/api/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:31
 Illuminate\Container\BoundMethod::call() at /opt/app/qa/api/vendor/laravel/framework/src/Illuminate/Container/Container.php:572
 Illuminate\Container\Container->call() at /opt/app/qa/api/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:795
 Illuminate\Foundation\Application->bootProvider() at /opt/app/qa/api/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:778
 Illuminate\Foundation\Application->Illuminate\Foundation\{closure}() at n/a:n/a
 array_walk() at /opt/app/qa/api/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:779
 Illuminate\Foundation\Application->boot() at /opt/app/qa/api/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/BootProviders.php:17
 Illuminate\Foundation\Bootstrap\BootProviders->bootstrap() at /opt/app/qa/api/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:204
 Illuminate\Foundation\Application->bootstrapWith() at /opt/app/qa/api/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:297
 Illuminate\Foundation\Console\Kernel->bootstrap() at /opt/app/qa/api/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:120
 Illuminate\Foundation\Console\Kernel->handle() at /opt/app/qa/api/artisan:43

From my own debugging I can see that we rely on 5.3.* of the elasticsearch/elasticsearch package, however, the composer.json file in here suggests that you rely on the 1.2.* version. (over 4 years old)

It appears that the method you want to hook into doesn't exist in later version of the package. I'm not entirely sure, otherwise I'd send in a PR, but I feel like you're looking for this method https://github.com/elastic/elasticsearch-php/blob/master/src/Elasticsearch/Transport.php#L93.

If possible as well can you put instrumentation setup through try/catches and disable those that fail, possibly with an error somewhere?

I've had to disable the elastic search integration provider due to issue.

@labbati
Copy link
Member

labbati commented Dec 19, 2018

Hi @Lavoaster sorry to hear of the problem and thanks for taking the time to open this pull request.

From my own debugging I can see that we rely on 5.3.* of the elasticsearch/elasticsearch package, however, the composer.json file in here suggests that you rely on the 1.2.* version. (over 4 years old)

We have plans to support recent versions of ES.

It appears that the method you want to hook into doesn't exist in later version of the package. I'm not entirely sure, otherwise I'd send in a PR, but I feel like you're looking for this method https://github.com/elastic/elasticsearch-php/blob/master/src/Elasticsearch/Transport.php#L93.
If possible as well can you put instrumentation setup through try/catches and disable those that fail, possibly with an error somewhere?

The main point here is that we should properly support version 5.x and before that we have to provide a way to test multiple versions of the same library. You can follow this issue #185 as @inverse proposed a very good approach in my opinion.

I've had to disable the elastic search integration provider due to issue.

Just to make sure you did not have to change any code: you can do this by DD_INTEGRATIONS_DISABLED=elasticsearch.

@labbati labbati added 🐛 bug Something isn't working 🎉 new-integration A new integration labels Jan 3, 2019
@labbati labbati added feature-request 🐛 bug Something isn't working and removed 🐛 bug Something isn't working feature-request labels Feb 14, 2019
@labbati
Copy link
Member

labbati commented Sep 22, 2020

Hi @LavaToaster, we completely rearchitected our API and such issues, like class/method not found cannot happen anymore by design. What we call 'sandboxed' instrumentation. I am closing this issue. Please feel free to comment if this does not hold true for your case and I will reopen it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🎉 new-integration A new integration
Projects
None yet
Development

No branches or pull requests

2 participants