jjatria / perl-opentelemetry-sdk

An implementation of the OpenTelemetry SDK for Perl
https://metacpan.org/pod/OpenTelemetry::SDK
Other
9 stars 4 forks source link

Problems with sample code in README #15

Closed eserte closed 5 months ago

eserte commented 5 months ago

In https://github.com/jjatria/perl-opentelemetry-sdk/blob/d4dae9a1715d8f0b142f235f255e45aff1d31fac/README.md?plain=1#L101 there's a syntax error: the signature should be opened with a (, not {

Signatures and p from (I think) Data::Printer are used here, which might not be obvious, so adding

use feature 'signatures';
use Data::Printer;

would help here.

The $span->add_event call issues a warning:

Odd name/value argument for subroutine 'OpenTelemetry::SDK::Trace::Span::add_event' at ...

Probably it should be ...->add_event(name => ...) or so.

jjatria commented 5 months ago

Well spotted! I'll try to fix this in the next couple of days.

jjatria commented 5 months ago

I pushed f3e03406416c2c to fix this. Thanks for the report!