-
Notifications
You must be signed in to change notification settings - Fork 525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix metadata.service.* fields requirements in json schema #4142
Fix metadata.service.* fields requirements in json schema #4142
Conversation
Validations on metadata.service.* fields were not run correctly, changing the schema to properly run validations and adding package tests for verification. fixes elastic#4141
💚 Build SucceededExpand to view the summary
Build stats
Test stats 🧪
Steps errorsExpand to view the steps failures
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but we should probably wait until we've got a resolution on #4141 (comment)
Update: I added a |
@elastic/apm-agent-devs as just discussed please check the requirements for the current agent versions and let me know if this bugfix causes issues, otherwise I'll merge by the end of the week. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, but I'm wondering why we make version
required but don't also require it to be non-empty. Seems like all fields should be either optional or required and non-empty.
I didn't want to introduce too many changes with this as it will be deployed as bugfix; the reason I went for adding |
Java agent should be OK with this change.
As far as I can see, it is the case since GA. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from RUM agent side.
Validations on metadata.service.* fields were not run correctly, changing the schema to properly run validations and adding package tests for verification. fixes elastic#4141
Motivation/summary
Validations on metadata.service.* fields were not run correctly. This PR changes the schema to properly run validations for
v2
andrum-v3
:metadata.service.name
,metadata.service.agent.name
: key required, value must be non-empty string ,metadata.service.agent.version
: key must be sent, value must not be nullmetadata.service.runtime.name
,metadata.service.runtime.version
: keys must be sent, values must not be null ifmetadata.service.runtime
is sentmetadata.service.language.name
: keys must be sent, values must not be null ifmetadata.service.language
is sentThe PR also fixes an issue where
metadata.service.cloud.*
fields that are not required were not allowed to be sent asnull
values.Checklist
- [ ] I have signed the Contributor License Agreement.I 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
Sending payloads where
metadata.service.agent.name
,metadata.service.agent.version
,metadata.service.runtime.name
,metadata.serice.runtime.version
,metadata.service.language.name
are missing or set tonull
and ensure payload is invalid.Related issues
fixes #4141