Skip to content

Commit

Permalink
Clean Integration configuration (#2598)
Browse files Browse the repository at this point in the history
Also avoid the extra Util\Common class and just stuff it into the global Integration.
  • Loading branch information
bwoebi committed Apr 15, 2024
1 parent f6dab57 commit 95a0831
Show file tree
Hide file tree
Showing 47 changed files with 960 additions and 1,421 deletions.
10 changes: 1 addition & 9 deletions src/DDTrace/Integrations/AMQP/AMQPIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,6 @@ class AMQPIntegration extends Integration
const SYSTEM = 'rabbitmq';
protected $protocolVersion;

/**
* @return string The integration name.
*/
public function getName()
{
return self::NAME;
}

// Source: https://magp.ie/2015/09/30/convert-large-integer-to-hexadecimal-without-php-math-extension/
public static function largeBaseConvert($numString, $fromBase, $toBase)
{
Expand Down Expand Up @@ -454,7 +446,7 @@ public function setGenericTags(
$span->meta[Tag::MQ_PROTOCOL_VERSION] = $this->protocolVersion;

if ($exception) {
$this->setError($span, $exception);
$span->exception = $exception;
}
}

Expand Down
37 changes: 0 additions & 37 deletions src/DDTrace/Integrations/AbstractIntegrationConfiguration.php

This file was deleted.

8 changes: 4 additions & 4 deletions src/DDTrace/Integrations/CakePHP/CakePHPIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ class CakePHPIntegration extends Integration
public $parseRouteFn;

/**
* @return string The integration name.
* {@inheritdoc}
*/
public function getName()
public function requiresExplicitTraceAnalyticsEnabling(): bool
{
return self::NAME;
return false;
}

public function init(): int
Expand Down Expand Up @@ -54,7 +54,7 @@ public function init(): int
$integration->handleExceptionFn = function ($This, $scope, $args) use ($integration) {
$rootSpan = \DDTrace\root_span();
if ($rootSpan !== null) {
$integration->setError($rootSpan, $args[0]);
$rootSpan->exception = $args[0];
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,6 @@ class CodeIgniterIntegration extends Integration
{
const NAME = 'codeigniter';

/**
* @return string The integration name.
*/
public function getName()
{
return self::NAME;
}

/**
* Add instrumentation to CodeIgniter requests
*/
Expand Down
5 changes: 0 additions & 5 deletions src/DDTrace/Integrations/Curl/CurlIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ final class CurlIntegration extends Integration
{
const NAME = 'curl';

public function getName()
{
return self::NAME;
}

public function init(): int
{
if (!extension_loaded('curl')) {
Expand Down
31 changes: 0 additions & 31 deletions src/DDTrace/Integrations/DefaultIntegrationConfiguration.php

This file was deleted.

4 changes: 2 additions & 2 deletions src/DDTrace/Integrations/Drupal/DrupalIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ class DrupalIntegration extends Integration
/**
* {@inheritdoc}
*/
public function getName()
public function requiresExplicitTraceAnalyticsEnabling(): bool
{
return self::NAME;
return false;
}

public function init(): int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,6 @@ class ElasticSearchIntegration extends Integration
{
const NAME = 'elasticsearch';

/**
* @return string The integration name.
*/
public function getName()
{
return self::NAME;
}

/**
* Add instrumentation to Elasticsearch requests
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ class ElasticSearchIntegration extends Integration

public $logNextBody = false;

/**
* @return string The integration name.
*/
public function getName()
{
return self::NAME;
}

/**
* Add instrumentation to Elasticsearch requests
*/
Expand Down
8 changes: 0 additions & 8 deletions src/DDTrace/Integrations/Eloquent/EloquentIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,6 @@ class EloquentIntegration extends Integration
*/
private $appName;

/**
* {@inheritdoc}
*/
public function getName()
{
return self::NAME;
}

/**
* {@inheritDoc}
*/
Expand Down
5 changes: 0 additions & 5 deletions src/DDTrace/Integrations/Exec/ExecIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ class ExecIntegration extends Integration
const REDACTED_BINARIES = array('md5' => null);
const UNREDACTED_ENV_VARS = array('LD_PRELOAD' => null, 'LD_LIBRARY_PATH' => null, 'PATH' => null);

public function getName()
{
return self::NAME;
}

public function init(): int
{
\DDTrace\install_hook(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,10 @@ class FrankenphpIntegration extends Integration
{
const NAME = 'frankenphp';

public function getName()
{
return self::NAME;
}

/**
* {@inheritdoc}
*/
public function requiresExplicitTraceAnalyticsEnabling()
public function requiresExplicitTraceAnalyticsEnabling(): bool
{
return false;
}
Expand Down
5 changes: 0 additions & 5 deletions src/DDTrace/Integrations/Guzzle/GuzzleIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ class GuzzleIntegration extends Integration
{
const NAME = 'guzzle';

public function getName()
{
return self::NAME;
}

public function init(): int
{
$integration = $this;
Expand Down
Loading

0 comments on commit 95a0831

Please sign in to comment.