Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use OpenTelemetry\Contrib\Instrumentation\CakePHP\Hooks\Cake\Command\Command;
use OpenTelemetry\Contrib\Instrumentation\CakePHP\Hooks\Cake\Controller\Controller;
use OpenTelemetry\Contrib\Instrumentation\CakePHP\Hooks\Cake\Http\Server;
use OpenTelemetry\SemConv\TraceAttributes;

class CakePHPInstrumentation
{
Expand All @@ -25,4 +24,4 @@ public static function register(): void
Controller::hook($instrumentation);
Command::hook($instrumentation);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@

use Cake\Routing\Exception\MissingRouteException;
use Cake\Routing\Router;
use OpenTelemetry\API\Trace\SpanInterface;
use OpenTelemetry\API\Trace\StatusCode;
use OpenTelemetry\Context\Context;
use OpenTelemetry\Contrib\Instrumentation\CakePHP\Hooks\CakeHook;
use OpenTelemetry\Contrib\Instrumentation\CakePHP\Hooks\CakeHookTrait;
use function OpenTelemetry\Instrumentation\hook;
use OpenTelemetry\SDK\Common\Time\ClockInterface;
use OpenTelemetry\SemConv\TraceAttributes;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
Expand Down Expand Up @@ -83,4 +81,4 @@ private function getRouteTemplate($request): string|null
return null;
}
}
}
}
1 change: 1 addition & 0 deletions src/Instrumentation/CakePHP/src/Hooks/CakeHookTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public static function hook(CachedInstrumentation $instrumentation): CakeHook
* @param string|null $filename
* @param int|null $lineno
* @return mixed
* @psalm-suppress ArgumentTypeCoercion
*/
protected function buildSpan(?ServerRequestInterface $request, string $class, string $function, ?string $filename, ?int $lineno): mixed
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Cake\TestSuite\IntegrationTestTrait;
use OpenTelemetry\API\Trace\SpanKind;
use OpenTelemetry\API\Trace\StatusCode;
use OpenTelemetry\SDK\Metrics\Data\Histogram;
use OpenTelemetry\SDK\Trace\ImmutableSpan;

/**
Expand Down Expand Up @@ -129,4 +128,4 @@ public function test_response_code_gte_400(): void
$attributes = $span->getAttributes()->toArray();
$this->assertSame(400, $attributes['http.response.status_code']);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
use OpenTelemetry\API\Instrumentation\Configurator;
use OpenTelemetry\API\Trace\Propagation\TraceContextPropagator;
use OpenTelemetry\Context\ScopeInterface;
use OpenTelemetry\SDK\Metrics\MeterProvider;
use OpenTelemetry\SDK\Metrics\MetricReader\ExportingReader;
use OpenTelemetry\SDK\Trace\ImmutableSpan;
use OpenTelemetry\SDK\Trace\SpanExporter\InMemoryExporter;
use OpenTelemetry\SDK\Trace\SpanProcessor\SimpleSpanProcessor;
Expand Down Expand Up @@ -45,4 +43,4 @@ public function tearDown(): void

$this->scope->detach();
}
}
}
Loading