-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
doc(schema): Export canonical event schema as JSON Schema (#558)
This introduces schemars as dependency and adds a new subcommand to relay that generates the schema, which we then use to publish the schema as release artifact. Alex Hofsteede attempted to document the event schema using JSON schema too, but sort of got stuck halfway through. I don't know if it was lack of time or something else. I believe the difference is that we only attempt to document the canonical version after store normalization while Alex tried to validate every legacy format as well. The only exception we make there is that tags/headers/cookies are also allowed as objects even though the canonical form is array of arrays. This schema file's target audience is mostly SDK developers, but maybe Snuba ppl can profit from it too. Note: We cannot profit from this within the Python SDK as the only tooling for using JSON schema in type annotations is https://pypi.org/project/jsonschema-typed which users would have to install in their devenv to see any effect. What I actually wanted was code generation from JSON schema, not a runtime plugin for the type checker. I think for Snuba it would be fine but it's still inconvenient to set up and the error messages will be very poor for sure. I am fairly certain that this will be a good data source for auto-generated documentation at the very least. We should merge this before it gets out of sync with master even more, later we can make adjustments to make the autogenerated docs better.
- Loading branch information
Showing
50 changed files
with
3,998 additions
and
316 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,7 @@ target | |
# Editors | ||
/.idea/ | ||
.DS_Store | ||
|
||
# NPM utilities for building docs | ||
/node_modules/ | ||
package-lock.json |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
event-schema/event.schema.* | ||
configuration/metrics.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Event schema | ||
|
||
This page is intended to eventually replace [our current event schema documentation]. As opposed to the current one, this one is automatically generated from source code and therefore more likely to be up-to-date and exhaustive. The plan is to eventually make this document the source of truth, i.e. move it into `develop.sentry.dev`. | ||
|
||
**It is still a work-in-progress.** Right now we recommend using our existing docs as linked above and only fall back to this doc to resolve ambiguities. | ||
|
||
In addition to documentation the event schema is documented in machine-readable form: | ||
|
||
- [Download JSON schema](event.schema.json) (which is what this document is generated from) | ||
|
||
{% include "event-schema/event.schema.md" %} | ||
|
||
|
||
[our current event schema documentation]: https://develop.sentry.dev/sdk/event-payloads/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,8 @@ nav: | |
- architecture/ingest-event-path.md | ||
- architecture/project-configuration.md | ||
|
||
- "": event-schema/index.md | ||
|
||
markdown_extensions: | ||
- admonition: {} | ||
- tables: {} | ||
|
@@ -37,6 +39,15 @@ markdown_extensions: | |
class: mermaid | ||
format: !!python/name:pymdownx.superfences.fence_div_format | ||
|
||
plugins: | ||
- search | ||
# Used in event schema docs | ||
- macros | ||
|
||
- exclude: | ||
glob: | ||
- event-schema/event.schema.md | ||
|
||
extra_css: | ||
# Config for diagrams | ||
- https://unpkg.com/[email protected]/dist/mermaid.css | ||
|
Oops, something went wrong.