Skip to content

Allow setting span kind#8

Merged
lipskis merged 1 commit intomainfrom
dynamic-span-kind
Apr 16, 2026
Merged

Allow setting span kind#8
lipskis merged 1 commit intomainfrom
dynamic-span-kind

Conversation

@lipskis
Copy link
Copy Markdown
Collaborator

@lipskis lipskis commented Apr 16, 2026

Refactor Appsignal::instrument to use named arguments with specific types. Allow setting span kind and attributes as optional arguments.

$serverSpan = Appsignal::instrument('some_event', spanKind:
SpanKind::KIND_SERVER);

This change requires passing a closure as a named argument if any optional arguments are skipped.

Appsignal::instrument("some_event", closure: fn() => sleep(1));

[skip review]

@lipskis lipskis self-assigned this Apr 16, 2026
@lipskis lipskis added the chore A small task that takes a day or two at the most. label Apr 16, 2026
@backlog-helper
Copy link
Copy Markdown

backlog-helper Bot commented Apr 16, 2026

✔️ All good!

New issue guide | Backlog management | Rules | Feedback

@lipskis lipskis force-pushed the dynamic-span-kind branch from 447b973 to d0e93f0 Compare April 16, 2026 12:46
@lipskis lipskis requested a review from tombruijn April 16, 2026 12:46
Refactor Appsignal::instrument to use named arguments with specific
types. Allow setting span kind and attributes as optional arguments.

```php
$serverSpan = Appsignal::instrument('some_event', spanKind:
SpanKind::KIND_SERVER);
```

This change requires passing a closure as a named argument if any
optional arguments are skipped.

```php
Appsignal::instrument("some_event", closure: fn() => sleep(1));
```
@lipskis lipskis force-pushed the dynamic-span-kind branch from d0e93f0 to 68383a2 Compare April 16, 2026 12:52
@lipskis lipskis added enhancement An improvement to an existing feature. and removed chore A small task that takes a day or two at the most. labels Apr 16, 2026
@lipskis lipskis merged commit 72beef0 into main Apr 16, 2026
10 checks passed
@lipskis lipskis deleted the dynamic-span-kind branch April 16, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement An improvement to an existing feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant