Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
# need to "git add" to detect any changes to descriptions which are not checked in
# select files from locations managed by meta schema
git add examples**
git add schema/meta_schema.yaml
git add schema/meta_schema_*
git add schema-docs.md
if git diff --cached --quiet
then
Expand Down
82 changes: 79 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,82 @@ make all

## Meta schema

[meta_schema.yaml](./schema/meta_schema.yaml) tracks schema details that don't fit neatly into the JSON schema including:
[meta_schema_*.yaml](schema) files track schema details that don't fit neatly into the JSON schema including:

* Property descriptions and semantics
* Track which types are SDK extension plugins
* Implementation support status (TODO)
* Implementation support status

There are variety of tasks which intersect with the meta schema:
The meta schema is broken across multiple files for improved maintainability:

* [meta_schema_types.yaml](#meta_schema_typesyaml)
* [meta_schema_language_{language}.yaml](#meta_schema_language_languageyaml)

There are a variety of build tasks which intersect with the meta schema:

* [make fix-meta-schema](#make-fix-meta-schema)
* [make generate-markdown](#make-generate-markdown)
* [make generate-descriptions](#make-generate-descriptions)
* [make all-meta-schema](#make-all-meta-schema)

### `meta_schema_types.yaml`

[meta_schema_types.yaml](schema/meta_schema_types.yaml) contains property descriptions, semantics, and SDK extension plugin information.

Content looks like:

```yaml
- type: AttributeLimits
properties:
- property: attribute_value_length_limit
description: |
Configure max attribute value size.
Value must be non-negative.
If omitted or null, there is no limit.
# other types omitted for brevity
```

Notes:

* `[]` the document is an array of entries for each type in the JSON schema.
* `[].type` is the name of the JSON schema type. **Maintained automatically by build tooling.**
* `[].properties` is an array of entries for each property in the JSON schema type.
* `[].properties[].property` the name of the property. **Maintained automatically by build tooling.**
* `[].properties[].description` the property description, including semantics and default behavior.

### `meta_schema_language_{language}.yaml`

These files track language implementation status for a particular language. See [fix-meta-schema](#make-fix-meta-schema) for details on adding a new language.

Content looks like:

```yaml
latestSupportedFileFormat: 1.0.0-rc.1
typeSupportStatuses:
- type: Base2ExponentialBucketHistogramAggregation
status: supported # the support status, see below for allowed enum values
notes: ""
propertyOverrides:
- property: record_min_max
status: ignored
# other types omitted for brevity
```

Notes:

* `.latestSupportedFileFormat` is the latest version of `opentelemetry-configuration` supported by the `{language}`
* `.typeSupportStatuses` is an array with entries for each type in the JSON schema.
* `.typeSupportStatuses[].type` is the name of the JSON schema type. **Maintained automatically by build tooling.**
* `.typeSupportStatuses[].status` captures the support status of the type and all properties except overrides in `.typeSupportStatuses[].propertyOverrides`. See enum options below.
* `.typeSupportStatuses[].propertyOverrides` an array of properties which have different support statuses than the overall type as recorded in `.typeSupportStatuses[].status.
* `.typeSupportStatuses[].propertyOverrides[].property` the name of the property whose support status is overridden.
* `.typeSupportStatuses[].propertyOverrides[].status` the overridden support status. See enum options below.
* Status enum options, applicable to `.typeSupportStatuses[].status`, `.typeSupportStatuses[].propertyOverrides[].status`:
* `unknown`: Language maintainer has not yet recorded a status.
* `suppported`: The type / property is supported by the language implementation.
* `not_implemented`: The type / property is not parsed / recognized by the language implementation because the concept is not yet implemented but should be eventually.
* `not_applicable`: The type / property is not parsed / recognized by the language implementation because the concept is not applicable. E.g. C++ specific instrumentation for Java.
* `ignored`: The type / property is not parsed / recognized by the language implementation despite the concept being available in the language's programmatic configuration API.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding lightweight docs for the schema of the meta_schema*.yaml documents.


### `make fix-meta-schema`

Expand All @@ -266,6 +335,13 @@ Ensures that the JSON schema and the meta schema are kept in sync:
* For each meta schema type:
* If a property exists in the JSON schema and not the meta schema, add it.
* If a property exists in the meta schema and not the JSON schema, delete it.
* If a language implementation is known (i.e. defined in constant array `KNOWN_LANGUAGES` in [meta-schema.js](./scripts/meta-schema.js)) but not in meta schema, add it.
* If a language implementation exists in meta schema but is not known, delete it.
* For each language implementation:
* If a type exists in the JSON schema and not in the language implementation's type support status of the meta schema, add it.
* If a type exists in the language implementation's type support status of the meta schema and no in the JSON schema, delete it.
* For each property in a type's propertyOverrides:
* If the property does not exist in the JSON schema, delete it.

When this task adds new entries to the meta schema, they are stubbed out with `TODO` placeholders. Contributors should update these with sensible values.

Expand Down
Loading
Loading