-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Clean up docs, add syntax.md and semconv.schema.json (#53)
Co-authored-by: Armin Ruech <[email protected]> Co-authored-by: Yuri Shkuro <[email protected]> Co-authored-by: Giovanni Liva <[email protected]> Co-authored-by: Christian Neumüller <[email protected]> Co-authored-by: Gernot Reisinger <[email protected]>
- Loading branch information
1 parent
56f5bfa
commit cab67bf
Showing
3 changed files
with
601 additions
and
13 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
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,301 @@ | ||
{ | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"type": "object", | ||
"description": "YAML schema for semantic convention generator, use for example with VS Code.", | ||
"additionalProperties": false, | ||
"properties": { | ||
"groups": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"required": [ | ||
"id", | ||
"brief" | ||
], | ||
"anyOf": [ | ||
{ | ||
"required": [ | ||
"attributes" | ||
] | ||
}, | ||
{ | ||
"required": [ | ||
"extends" | ||
] | ||
} | ||
], | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"description": "unique string" | ||
}, | ||
"type": { | ||
"type": "string", | ||
"enum": [ | ||
"span", | ||
"resource", | ||
"metric" | ||
] | ||
}, | ||
"brief": { | ||
"type": "string", | ||
"description": "a brief description of the semantic convention" | ||
}, | ||
"note": { | ||
"type": "string", | ||
"description": "a more elaborate description of the semantic convention. It defaults to an empty string" | ||
}, | ||
"prefix": { | ||
"type": "string", | ||
"description": "prefix of the attribute for this semconv. It defaults to an empty string." | ||
}, | ||
"extends": { | ||
"type": "string", | ||
"description": "reference another semantic convention ID. It inherits all attributes from the specified semconv." | ||
}, | ||
"span_kind": { | ||
"type": "string", | ||
"enum": [ | ||
"client", | ||
"server", | ||
"producer", | ||
"consumer", | ||
"internal" | ||
], | ||
"description": "specifies the kind of the span. Leaf semconv nodes (in the hierarchy tree) that do not have this field set will generate a warning." | ||
}, | ||
"attributes": { | ||
"type": "array", | ||
"items": { | ||
"$ref": "#/definitions/Attribute" | ||
}, | ||
"description": "list of attributes that belong to the semconv" | ||
}, | ||
"constraints": { | ||
"type": "array", | ||
"items": { | ||
"anyOf": [ | ||
{ | ||
"type": "object", | ||
"additionalProperties": false, | ||
"required": [ | ||
"any_of" | ||
], | ||
"properties": { | ||
"any_of": { | ||
"type": "array", | ||
"description": " accepts a list of sequences. Each sequence contains a list of attribute ids that are required. any_of enforces that all attributes of at least one of the sequences are set.", | ||
"items": { | ||
"anyOf": [ | ||
{ | ||
"type": "array", | ||
"items": { | ||
"type": "string" | ||
} | ||
}, | ||
{ | ||
"type": "string" | ||
} | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
{ | ||
"type": "object", | ||
"additionalProperties": false, | ||
"required": [ | ||
"include" | ||
], | ||
"properties": { | ||
"include": { | ||
"type": "string", | ||
"description": "accepts a semantic conventions id. It includes as part of this semantic convention all constraints and required attributes that are not already defined in the current semantic convention." | ||
} | ||
} | ||
} | ||
] | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"definitions": { | ||
"AttributeEnumType": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"properties": { | ||
"allow_custom_values": { | ||
"type": "boolean" | ||
}, | ||
"members": { | ||
"type": "array", | ||
"items": { | ||
"type": "object", | ||
"additionalProperties": false, | ||
"required": [ | ||
"id", | ||
"value" | ||
], | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"description": "string unique" | ||
}, | ||
"value": { | ||
"type": [ | ||
"string", | ||
"number" | ||
], | ||
"description": "string or number, value of the enum entry." | ||
}, | ||
"brief": { | ||
"type": "string", | ||
"description": "brief description of the enum entry value. It defaults to the value of ID." | ||
}, | ||
"note": { | ||
"type": "string", | ||
"description": "longer description. It defaults to an empty string." | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}, | ||
"AttributeFullSpec": { | ||
"required": [ | ||
"id", | ||
"type" | ||
], | ||
"properties": { | ||
"id": { | ||
"type": "string", | ||
"description": "unique string" | ||
}, | ||
"type": { | ||
"oneOf": [ | ||
{ | ||
"type": "string", | ||
"enum": [ | ||
"string", | ||
"int", | ||
"double", | ||
"boolean", | ||
"string[]", | ||
"int[]", | ||
"double[]", | ||
"boolean[]" | ||
], | ||
"description": "literal denoting the type" | ||
}, | ||
{ | ||
"$ref": "#/definitions/AttributeEnumType" | ||
} | ||
] | ||
} | ||
} | ||
}, | ||
"AttributeReference": { | ||
"type": "object", | ||
"required": [ | ||
"ref" | ||
], | ||
"properties": { | ||
"ref": { | ||
"type": "string", | ||
"description": "reference an existing attribute" | ||
}, | ||
"tag": { | ||
"type": "string", | ||
"description": "associates a tag to the attribute" | ||
} | ||
} | ||
}, | ||
"ValueType": { | ||
"oneOf": [ | ||
{ | ||
"type": [ | ||
"string", | ||
"boolean", | ||
"number" | ||
] | ||
}, | ||
{ | ||
"type": "array", | ||
"items": { | ||
"type": [ | ||
"boolean", | ||
"number", | ||
"string" | ||
] | ||
} | ||
} | ||
] | ||
}, | ||
"Attribute": { | ||
"type": "object", | ||
"allOf": [ | ||
{ | ||
"properties": { | ||
"required": { | ||
"description": "specifies if the attribute is mandatory. Can be 'always', or 'conditional'. When omitted, the attribute is not required. When set to 'conditional',the string provided as <condition> MUST specify the conditions under which the attribute is required.", | ||
"oneOf": [ | ||
{ | ||
"type": "string", | ||
"enum": [ | ||
"always" | ||
] | ||
}, | ||
{ | ||
"type": "object", | ||
"additionalProperties": false, | ||
"required": [ | ||
"conditional" | ||
], | ||
"properties": { | ||
"conditional": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
] | ||
}, | ||
"sampling_relevant": { | ||
"type": "boolean", | ||
"description": "specifies if it is relevant for sampling. It defaults to false.", | ||
"default": false | ||
}, | ||
"brief": { | ||
"type": "string", | ||
"description": "brief description of the attribute." | ||
}, | ||
"note": { | ||
"type": "string", | ||
"description": "additional notes to the attribute. It defaults to an empty string." | ||
}, | ||
"examples": { | ||
"$ref": "#/definitions/ValueType", | ||
"description": "sequence/dictionary of example values for the attribute. They are optional for boolean and enum attributes. Example values must be of the same type of the attribute. If only a single example is provided, it can directly be reported without encapsulating it into a sequence/dictionary." | ||
}, | ||
"deprecated": { | ||
"type": "string", | ||
"description": "specifies if the attribute is deprecated. The string provided as <description> MUST specify why it's deprecated and/or what to use instead." | ||
} | ||
} | ||
}, | ||
{ | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/definitions/AttributeFullSpec" | ||
}, | ||
{ | ||
"$ref": "#/definitions/AttributeReference" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
} | ||
} |
Oops, something went wrong.