Skip to content

Commit

Permalink
chore: change instrumentation name and default span kind
Browse files Browse the repository at this point in the history
  • Loading branch information
cdaguerre committed Jan 24, 2025
1 parent 615ff3f commit 9034423
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Tracing/Tracing.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,20 @@

final class Tracing
{
public const NAME = 'io.opentelemetry.contrib.php';
public const NAME = 'io.opentelemetry.contrib.php.worldia';

private static TracerProviderInterface|null $tracerProvider = null;

/**
* @param non-empty-string $operation
* @param non-empty-string $spanName
* @param array<string,string> $attributes
* @param SpanKind::KIND_* $kind
*/
public static function trace(string $operation, array|null $attributes = null, int|null $kind = null, Context|null $parentContext = null): SpanInterface
public static function trace(string $spanName, array|null $attributes = null, int|null $kind = null, Context|null $parentContext = null): SpanInterface
{
return static::getTracer()->spanBuilder($operation)
return static::getTracer()->spanBuilder($spanName)
->setAttributes($attributes ?: [])
->setSpanKind($kind ?: SpanKind::KIND_SERVER)
->setSpanKind($kind ?: SpanKind::KIND_INTERNAL)
->setParent($parentContext ?: Context::getCurrent())
->startSpan();
}
Expand Down

0 comments on commit 9034423

Please sign in to comment.