Skip to content

Commit

Permalink
Complete exit spans spec change (#487)
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalkoren authored Aug 18, 2021
1 parent 17f11c1 commit 7fd2a8b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions specs/agents/handling-huge-traces/tracing-spans-compress.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ and they define properties under the `composite` context.

### Effects on metric processing

As laid out in the [span destination spec](tracing-spans-destination.md#contextdestinationserviceresource),
As laid out in the [span destination spec](../tracing-spans-destination.md#contextdestinationserviceresource),
APM Server tracks span destination metrics.
To avoid compressed spans to skew latency metrics and cause throughput metrics to be under-counted,
APM Server will take `composite.count` into account when tracking span destination metrics.
Expand All @@ -130,7 +130,7 @@ APM Server will take `composite.count` into account when tracking span destinati
### Eligibility for compression

A span is eligible for compression if all the following conditions are met
1. It's an [exit span](tracing-spans.md#exit-spans)
1. It's an [exit span](../tracing-spans.md#exit-spans)
2. The trace context of this span has not been propagated to a downstream service
3. If the span has `outcome` (i.e., `outcome` is present and it's not `null`) then it should be `success`.
It means spans with outcome indicating an issue of potential interest should not be compressed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Propagating the trace context to downstream services is also known as out-of-pro
### `discardable` flag

Spans store an additional `discardable` flag in order to determine whether a span can be discarded.
The default value is `true` for [exit spans](tracing-spans.md#exit-spans) and `false` for any other span.
The default value is `true` for [exit spans](../tracing-spans.md#exit-spans) and `false` for any other span.

According to the [limitations](#Limitations),
there are certain situations where the `discardable` flag of a span is set to `false`:
Expand Down
2 changes: 1 addition & 1 deletion specs/agents/tracing-spans-destination.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ A user-supplied value MUST have the highest precedence, regardless if it was set

**Value**

For all [exit spans](handling-huge-traces/tracing-spans.md#exit-spans), unless the `context.destination.service.resource` field was set by the user to `null` or an empty
For all [exit spans](tracing-spans.md#exit-spans), unless the `context.destination.service.resource` field was set by the user to `null` or an empty
string through API, agents MUST infer the value of this field based on properties that are set on the span.

If no value is set to the `context.destination.service.resource` field, the logic for automatically inferring
Expand Down
14 changes: 14 additions & 0 deletions tests/agents/json-specs/service_resource_inference.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@
"expected_resource": null,
"failure_message": "The output for non-exit spans should be `null`"
},
{
"span": {
"exit": "false",
"type": "custom",
"subtype": "proprietary-db",
"context": {
"db": {
"instance": "myInstance"
}
}
},
"expected_resource": null,
"failure_message": "The output for non-exit spans should be `null` even if exit-related context data is set"
},
{
"span": {
"exit": "true",
Expand Down

0 comments on commit 7fd2a8b

Please sign in to comment.