Skip to content

Commit

Permalink
Clean Integration configuration
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 12, 2024
1 parent 4780cb9 commit 17cf76d
Show file tree
Hide file tree
Showing 56 changed files with 1,017 additions and 1,469 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.

10 changes: 1 addition & 9 deletions src/DDTrace/Integrations/CakePHP/CakePHPIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ class CakePHPIntegration extends Integration
public $appName;
public $rootSpan;

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

// CakePHP v2.x - we don't need to check for v3 since it does not have \Dispatcher or \ShellDispatcher
public function init(): int
{
Expand Down Expand Up @@ -102,7 +94,7 @@ function (SpanData $span, array $args) use ($integration) {
\DDTrace\trace_method('ExceptionRenderer', '__construct', [
'instrument_when_limited' => 1,
'posthook' => function (SpanData $span, array $args) use ($integration) {
$integration->setError($integration->rootSpan, $args[0]);
$integration->rootSpan->exception = $args[0];
$span->meta[Tag::COMPONENT] = CakePHPIntegration::NAME;
return false;
},
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 isForcingTraceAnalytics(): bool
{
return self::NAME;
return true;
}

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
5 changes: 0 additions & 5 deletions src/DDTrace/Integrations/Frankenphp/FrankenphpIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ class FrankenphpIntegration extends Integration
{
const NAME = 'frankenphp';

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

/**
* {@inheritdoc}
*/
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 17cf76d

Please sign in to comment.