model: make ID fields non-pointer string types #3853
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation/summary
Make more ID fields non-pointer types.
I missed a subtle issue with #3849, which changed some code to store a pointer to an empty parent ID in some cases. This didn't cause any change in the fields output, because we check
!= nil
and!= ""
when producing beat events. However, when aggregating transaction metrics, we are only checking!= nil
.To simplify the logic, and avoid these kinds of errors in the future, just store a string value. As a side benefit, this reduces heap allocations.
Included is a tangentially related change to stop recording the parent span index, used for RUMv3, on the model types. We now just use the index during decoding and then discard it.
Checklist
- [ ] I have updated CHANGELOG.asciidocI have considered changes for:
- [ ] documentation- [ ] logging (add log lines, choose appropriate log selector, etc.)- [ ] metrics and monitoring (create issue for Kibana team to add metrics to visualizations, e.g. Kibana#44001)- [ ] telemetry- [ ] Elasticsearch Service (https://cloud.elastic.co)- [ ] Elastic Cloud Enterprise (https://www.elastic.co/products/ece)- [ ] Elastic Cloud on Kubernetes (https://www.elastic.co/elastic-cloud-kubernetes)How to test these changes
make test
Related issues
None.