Skip to content

Commit 7f27ed4

Browse files
authored
Use constant from TraceAttributes class (#139)
1 parent 6502441 commit 7f27ed4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/LaravelInstrumentation.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ public static function register(): void
4242
$builder = $instrumentation->tracer()
4343
->spanBuilder(sprintf('HTTP %s', $request?->method() ?? 'unknown'))
4444
->setSpanKind(SpanKind::KIND_SERVER)
45-
->setAttribute('code.function', $function)
46-
->setAttribute('code.namespace', $class)
47-
->setAttribute('code.filepath', $filename)
48-
->setAttribute('code.lineno', $lineno);
45+
->setAttribute(TraceAttributes::CODE_FUNCTION, $function)
46+
->setAttribute(TraceAttributes::CODE_NAMESPACE, $class)
47+
->setAttribute(TraceAttributes::CODE_FILEPATH, $filename)
48+
->setAttribute(TraceAttributes::CODE_LINENO, $lineno);
4949
$parent = Context::getCurrent();
5050
if ($request) {
5151
$parent = Globals::propagator()->extract($request, HeadersPropagator::instance());

0 commit comments

Comments
 (0)