Changelog
0.9.0
- Distributed tracing across services, using the W3C Trace Context standard (
traceparent). Every request that passes throughPSGIPerformanceorDancer2Performancenow gets a trace id; one that arrives with a validtraceparentheader continues that trace, and its root span points at the caller's span. A missing or malformed header starts a fresh trace.ForgeOps::Tracker::current_trace_id()returns it, andstart_trace($traceparent)continues one for work that isn't a request. - Every error reported during a request now says where it happened:
trace_id, plus, under Dancer2,transaction_name(the sameGET /users/:idname performance samples and traces already use) andendpoint(the HTTP method plus the route pattern as declared; never the raw path). Set as soon as Dancer2 has matched the route, so an error reported from inside a route already has them. Plain PSGI has no route pattern, so it sends onlytrace_idunless the app names the request with the newset_request_route($transaction_name, $endpoint). Left out outside a request. Structured fields, so they're never PII-scrubbed. ForgeOps::Tracker::http_span($method, $url, sub { my ($headers) = @_; ... }, data => {})records an outgoing HTTP call as anhttpspan named after the method and host, and hands your code thetraceparentheader to add to it; its parent id is the span's own id, so the called service's root span nests under it. This client doesn't instrument an HTTP client itself. Newpropagate_traces(default 1) andtrace_propagation_targets(default undef, meaning every host; or an arrayref of host strings, each matching that host and its subdomains, and/orqr//regular expressions) control where the header goes.- An errored request's trace is always sent, however fast it was: an error reported while the request ran, or one escaping it. A Dancer2 route that dies now has its trace finished and sent (Dancer2 never runs
after_requestfor it, so before this it was never sent at all). Fast, successful requests are unchanged. - An error escaping a request keeps its trace id, transaction name, endpoint, user and breadcrumbs when it's reported after the performance integration has already finished the request:
Integrations::PSGIenabled outsidePSGIPerformance(the documented order), orIntegrations::Dancer2loaded afterDancer2Performance. - With
track_tracing => 0, requests still get a trace id (attached to errors and handed out byhttp_span, since that is also what links errors across services); only span reporting stops. - Trace and span ids were already W3C shaped (32 and 16 lowercase hex characters); they are now also guaranteed never to be all zeros, the one value the standard reserves as invalid.
This client has earlier CPAN releases (see $ForgeOps::Tracker::VERSION's history in source control), but no CHANGELOG.md existed for it before this entry; like sdks/java's, it starts here without backfilling earlier versions.