Skip to content

Commit 6ced393

Browse files
authored
Send empty strings for deprecated destination fields (#494)
1 parent 535873f commit 6ced393

File tree

1 file changed

+11
-44
lines changed

1 file changed

+11
-44
lines changed

specs/agents/tracing-spans-destination.md

Lines changed: 11 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,29 @@ Agents SHOULD have a generic component used in all tests that validates that the
1414
Rather than opting into the validation, the testing should provide an opt-out if,
1515
for whatever reason, the destination information can't or shouldn't be collected for a particular exit span.
1616

17-
#### `context.destination.service.name`
17+
#### `context.destination.service.name`/`context.destination.service.type`
1818

19-
ES field: `span.destination.service.name`
19+
ES field: `span.destination.service.name`/`span.destination.service.type`
2020

2121
The identifier for the destination service.
2222

2323
**Deprecated**
2424

25-
This field is deprecated and scheduled to be removed.
25+
These fields are deprecated and removed from Elasticsearch documents.
2626

27-
This field is not used anywhere within the product,
28-
and we don't have plans to do so.
29-
However, we can't just remove it as it's a required field in the intake API.
30-
31-
Future versions of APM Server will remove the field from the intake API and drop it if sent by agents.
32-
Agents MAY omit the field when sending spans to an APM Server that doesn't require the field.
27+
However, we can't just remove them from the intake payloads as they're required fields in the intake API.
3328

3429
**Value**
3530

36-
Agents MUST NOT manually set this field.
37-
Agents MUST NOT offer a non-deprecated public API to set it.
31+
Agents MUST NOT manually set these fields.
32+
Agents MUST NOT offer non-deprecated public APIs to set them.
3833

39-
The value is automatically set on span end, after the value of `context.destination.service.resource` has been determined.
40-
```groovy
41-
if (context.destination?.service?.resource) context.destination.service.name = subtype ?: type
42-
```
34+
The intake JSON spec (up until at least 7.15) requires the fields to be present if `context.destination.service.resource` is set.
35+
Future versions of APM Server will remove the fields from the intake API and drop it if sent by agents.
4336

44-
The change to automatically set the field mainly has an effect on HTTP and gRPC spans that used to set the value to host and non-default port.
45-
As the field is not used anywhere, and we want to remove it from the span documents in the future, that's fine.
37+
Agents MAY omit the fields when sending spans to an APM Server version that doesn't require the field.
38+
Otherwise, the field MUST be serialized as an empty string if `context.destination.service.resource` is set.
39+
Both options result in the fields being omitted from the Elasticsearch document.
4640

4741
#### `context.destination.service.resource`
4842

@@ -123,33 +117,6 @@ However, updating the generic inference logic SHOULD be preferred, if feasible.
123117
Setting the value within a specific library integration/instrumentation is perfectly fine if there's only one canonical library for it.
124118
Examples: gRPC and cloud-provider specific backends.
125119

126-
#### `context.destination.service.type`
127-
128-
ES field: `span.destination.service.type`
129-
130-
Type of the destination service.
131-
132-
**Deprecated**
133-
134-
This field is deprecated and scheduled to be removed.
135-
136-
This field is not used anywhere within the product,
137-
and we don't have plans to do so.
138-
However, we can't just remove it as it's a required field in the intake API.
139-
140-
Future versions of APM Server will remove the field from the intake API and drop it if sent by agents.
141-
Agents MAY omit the field when sending spans to an APM Server that doesn't require the field.
142-
143-
**Value**
144-
145-
Agents MUST NOT manually set this field.
146-
Agents MUST NOT offer a non-deprecated public API to set it.
147-
148-
The value is automatically set on span end, after the value of `context.destination.service.resource` has been determined.
149-
```groovy
150-
if (context.destination?.service?.resource) context.destination.service.type = type
151-
```
152-
153120
### Destination fields
154121

155122
These fields are used within the APM/SIEM integration.

0 commit comments

Comments
 (0)