-
Notifications
You must be signed in to change notification settings - Fork 206
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
APM Server specification validation #984
Conversation
Codecov Report
@@ Coverage Diff @@
## master #984 +/- ##
==========================================
- Coverage 79.26% 74.05% -5.22%
==========================================
Files 151 157 +6
Lines 7472 7945 +473
==========================================
- Hits 5923 5884 -39
- Misses 1549 2061 +512
Continue to review full report at Codecov.
|
💔 Tests Failed
Expand to view the summary
Build stats
Test stats 🧪
Test errorsExpand to view the tests failures> Show only the first 10 test failures
|
22d28cb
to
355ddd1
Compare
As discussed with @gregkalapos, I've reverted the changes to the Agent types that transformed it into a complete reference implementation of the APM server schema specs. The validator still has the ability to perform this validation, with the test to perform this marked as skip for now. This is now ready for review. |
355ddd1
to
390ba31
Compare
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.
elastic/apm-server#4427 made some changes on where json
files are. I tried to adapt this PR to the changes, but then I run into some NullReferenceException
s.
But overall, this looks very nice! 👍
work in progress
This commit adds a service property to span context.
This commit validates the input to the mock APM server against the APM server specification JSON schema.
390ba31
to
b2b83b1
Compare
This PR introduces validation against the APM server JSON schema specification. Validation is performed in two ways:
Validate agent types against the schema through reflection.
It's possible to statically validate a large part of the agent types against the JSON schema. Where it is not possible is where agent types model the APM server specification with a structure that cannot be statically mapped to the schema properties, typically because such types have a custom JSON serialization routine that transforms instances of types to a JSON structure that matches the specification.
Validate JSON input to mock APM server against the JSON schema.
This PR makes changes to the agent types in order for them to exactly match the schema. For example, the
sampled
field can be"null"
or"boolean"
within the specification, but the agent models as abool
. In chatting to @gregkalapos, it might make sense to model the specification as a set of POCOs, and leave the agent types as an implementation of the spec as opposed to an exact implementation of the spec. In modelling the spec as POCOs, these could be used outside of the agent, for example, to transform some output to an APM server input, or used by the mock APM server.