-
Notifications
You must be signed in to change notification settings - Fork 30
Demonstrate using tooling to produce JSON schema files enriched with descriptions #407
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
Draft
jack-berg
wants to merge
1
commit into
open-telemetry:main
Choose a base branch
from
jack-berg:output-enriched-schema
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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,253 @@ | ||
| { | ||
| "$id": "https://opentelemetry.io/otelconfig/common.json", | ||
| "$schema": "https://json-schema.org/draft/2020-12/schema", | ||
| "$defs": { | ||
| "IncludeExclude": { | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "included": { | ||
| "type": "array", | ||
| "minItems": 1, | ||
| "items": { | ||
| "type": "string" | ||
| }, | ||
| "description": "Configure list of value patterns to include.\nValues are evaluated to match as follows:\n * If the value exactly matches.\n * If the value matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.\nIf omitted, all values are included.\n" | ||
| }, | ||
| "excluded": { | ||
| "type": "array", | ||
| "minItems": 1, | ||
| "items": { | ||
| "type": "string" | ||
| }, | ||
| "description": "Configure list of value patterns to exclude. Applies after .included (i.e. excluded has higher priority than included).\nValues are evaluated to match as follows:\n * If the value exactly matches.\n * If the value matches the wildcard pattern, where '?' matches any single character and '*' matches any number of characters including none.\nIf omitted, .included attributes are included.\n" | ||
| } | ||
| } | ||
| }, | ||
| "NameStringValuePair": { | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "name": { | ||
| "type": "string", | ||
| "description": "The name of the pair." | ||
| }, | ||
| "value": { | ||
| "type": [ | ||
| "string", | ||
| "null" | ||
| ], | ||
| "description": "The value of the pair." | ||
| } | ||
| }, | ||
| "required": [ | ||
| "name", | ||
| "value" | ||
| ] | ||
| }, | ||
| "OtlpHttpExporter": { | ||
| "type": [ | ||
| "object", | ||
| "null" | ||
| ], | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "endpoint": { | ||
| "type": [ | ||
| "string", | ||
| "null" | ||
| ], | ||
| "description": "Configure endpoint, including the signal specific path.\nIf omitted or null, the http://localhost:4318/v1/{signal} (where signal is 'traces', 'logs', or 'metrics') is used.\n" | ||
| }, | ||
| "tls": { | ||
| "$ref": "#/$defs/HttpTls", | ||
| "description": "Configure TLS settings for the exporter." | ||
| }, | ||
| "headers": { | ||
| "type": "array", | ||
| "minItems": 1, | ||
| "items": { | ||
| "$ref": "#/$defs/NameStringValuePair" | ||
| }, | ||
| "description": "Configure headers. Entries have higher priority than entries from .headers_list.\nIf an entry's .value is null, the entry is ignored.\n" | ||
| }, | ||
| "headers_list": { | ||
| "type": [ | ||
| "string", | ||
| "null" | ||
| ], | ||
| "description": "Configure headers. Entries have lower priority than entries from .headers.\nThe value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details.\nIf omitted or null, no headers are added.\n" | ||
| }, | ||
| "compression": { | ||
| "type": [ | ||
| "string", | ||
| "null" | ||
| ], | ||
| "description": "Configure compression.\nValues include: gzip, none. Implementations may support other compression algorithms.\nIf omitted or null, none is used.\n" | ||
| }, | ||
| "timeout": { | ||
| "type": [ | ||
| "integer", | ||
| "null" | ||
| ], | ||
| "minimum": 0, | ||
| "description": "Configure max time (in milliseconds) to wait for each export.\nValue must be non-negative. A value of 0 indicates no limit (infinity).\nIf omitted or null, 10000 is used.\n" | ||
| }, | ||
| "encoding": { | ||
| "$ref": "#/$defs/OtlpHttpEncoding", | ||
| "description": "Configure the encoding used for messages. \nValues include: protobuf, json. Implementations may not support json.\nIf omitted or null, protobuf is used.\n" | ||
| } | ||
| } | ||
| }, | ||
| "OtlpHttpEncoding": { | ||
| "type": [ | ||
| "string", | ||
| "null" | ||
| ], | ||
| "enum": [ | ||
| "protobuf", | ||
| "json" | ||
| ] | ||
| }, | ||
| "OtlpGrpcExporter": { | ||
| "type": [ | ||
| "object", | ||
| "null" | ||
| ], | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "endpoint": { | ||
| "type": [ | ||
| "string", | ||
| "null" | ||
| ], | ||
| "description": "Configure endpoint.\nIf omitted or null, http://localhost:4317 is used.\n" | ||
| }, | ||
| "tls": { | ||
| "$ref": "#/$defs/GrpcTls", | ||
| "description": "Configure TLS settings for the exporter." | ||
| }, | ||
| "headers": { | ||
| "type": "array", | ||
| "minItems": 1, | ||
| "items": { | ||
| "$ref": "#/$defs/NameStringValuePair" | ||
| }, | ||
| "description": "Configure headers. Entries have higher priority than entries from .headers_list.\nIf an entry's .value is null, the entry is ignored.\n" | ||
| }, | ||
| "headers_list": { | ||
| "type": [ | ||
| "string", | ||
| "null" | ||
| ], | ||
| "description": "Configure headers. Entries have lower priority than entries from .headers.\nThe value is a list of comma separated key-value pairs matching the format of OTEL_EXPORTER_OTLP_HEADERS. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options for details.\nIf omitted or null, no headers are added.\n" | ||
| }, | ||
| "compression": { | ||
| "type": [ | ||
| "string", | ||
| "null" | ||
| ], | ||
| "description": "Configure compression.\nValues include: gzip, none. Implementations may support other compression algorithms.\nIf omitted or null, none is used.\n" | ||
| }, | ||
| "timeout": { | ||
| "type": [ | ||
| "integer", | ||
| "null" | ||
| ], | ||
| "minimum": 0, | ||
| "description": "Configure max time (in milliseconds) to wait for each export.\nValue must be non-negative. A value of 0 indicates no limit (infinity).\nIf omitted or null, 10000 is used.\n" | ||
| } | ||
| } | ||
| }, | ||
| "ExperimentalOtlpFileExporter": { | ||
| "type": [ | ||
| "object", | ||
| "null" | ||
| ], | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "output_stream": { | ||
| "type": [ | ||
| "string", | ||
| "null" | ||
| ], | ||
| "description": "Configure output stream. \nValues include stdout, or scheme+destination. For example: file:///path/to/file.jsonl.\nIf omitted or null, stdout is used.\n" | ||
| } | ||
| } | ||
| }, | ||
| "ConsoleExporter": { | ||
| "type": [ | ||
| "object", | ||
| "null" | ||
| ], | ||
| "additionalProperties": false | ||
| }, | ||
| "HttpTls": { | ||
| "type": [ | ||
| "object", | ||
| "null" | ||
| ], | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "certificate_file": { | ||
| "type": [ | ||
| "string", | ||
| "null" | ||
| ], | ||
| "description": "Configure certificate used to verify a server's TLS credentials. \nAbsolute path to certificate file in PEM format.\nIf omitted or null, system default certificate verification is used for secure connections.\n" | ||
| }, | ||
| "client_key_file": { | ||
| "type": [ | ||
| "string", | ||
| "null" | ||
| ], | ||
| "description": "Configure mTLS private client key. \nAbsolute path to client key file in PEM format. If set, .client_certificate must also be set.\nIf omitted or null, mTLS is not used.\n" | ||
| }, | ||
| "client_certificate_file": { | ||
| "type": [ | ||
| "string", | ||
| "null" | ||
| ], | ||
| "description": "Configure mTLS client certificate. \nAbsolute path to client certificate file in PEM format. If set, .client_key must also be set.\nIf omitted or null, mTLS is not used.\n" | ||
| } | ||
| } | ||
| }, | ||
| "GrpcTls": { | ||
| "type": [ | ||
| "object", | ||
| "null" | ||
| ], | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "certificate_file": { | ||
| "type": [ | ||
| "string", | ||
| "null" | ||
| ], | ||
| "description": "Configure certificate used to verify a server's TLS credentials. \nAbsolute path to certificate file in PEM format.\nIf omitted or null, system default certificate verification is used for secure connections.\n" | ||
| }, | ||
| "client_key_file": { | ||
| "type": [ | ||
| "string", | ||
| "null" | ||
| ], | ||
| "description": "Configure mTLS private client key. \nAbsolute path to client key file in PEM format. If set, .client_certificate must also be set.\nIf omitted or null, mTLS is not used.\n" | ||
| }, | ||
| "client_certificate_file": { | ||
| "type": [ | ||
| "string", | ||
| "null" | ||
| ], | ||
| "description": "Configure mTLS client certificate. \nAbsolute path to client certificate file in PEM format. If set, .client_key must also be set.\nIf omitted or null, mTLS is not used.\n" | ||
| }, | ||
| "insecure": { | ||
| "type": [ | ||
| "boolean", | ||
| "null" | ||
| ], | ||
| "description": "Configure client transport security for the exporter's connection. \nOnly applicable when .endpoint is provided without http or https scheme. Implementations may choose to ignore .insecure.\nIf omitted or null, false is used.\n" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Showing these output files for demonstration purposes, but if we go in this direction, maybe we don't check these into git, but include them as release artifacts
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.
after thinking about this more, i think we would definitely want to have whatever the current version is checked in
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.
I could also setup the tooling to directly modify the schema JSON files in place. This would also help ensure consistent formatting (i.e. indenting), and is akin to gofmt, prettier, spotless.