Skip to content
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

feat: add transistor config schema file #18

Merged
merged 14 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 11 additions & 0 deletions src/schemas/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# yaml-language-server: $schema=./transistor-config.schema.json
collect:
npm:
dependencies:
jsx:
elements:
allowedAttributeStringValues:
- "one"
- "two"

projectId: "1234"
68 changes: 68 additions & 0 deletions src/schemas/transistor-config.schema.json
francinelucca marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://[HOSTHERE]/schemas/transistor-config.schema.json",
"title": "Transistor Config Schema",
"description": "Configuration outline for metrics collection using IBM transistor",
francinelucca marked this conversation as resolved.
Show resolved Hide resolved
"type": "object",
"properties": {
"projectId": {
"type": "string",
"description": "Unique identifier assigned on a per-project basis. This is added to the resource attributes of data events during transmission."
},
"collect": {
"type": "object",
"minProperties": 1,
"description": "The keys under 'collect' represent the various types of data that Transistor is capable of collecting (i.e. 'scopes').",
francinelucca marked this conversation as resolved.
Show resolved Hide resolved
"properties": {
"npm": {
"type": "object",
"description": "configuration for collecting telemetry data from an npm environment",
"minProperties": 1,
"additionalProperties": false,
"properties": {
"dependencies": {
"type": "null",
"description": "Enable telemetry data collection for package.json `dependencies` and `devDependencies`."
}
},
"required": ["dependencies"]
},
"jsx": {
"type": "object",
"description": "configuration for collecting telemetry data from JSX files",
"minProperties": 1,
"additionalProperties": false,
"properties": {
"elements": {
"type": "object",
"description": "Enable telemetry data collection for JSX elements. The set of included elements is determined by looking at import/require statements across analyzed source files.",
"properties": {
"allowedAtrributeNames": {
"type": "array",
"minItems": 1,
"items": {
"type": "string"
},
"description": "Enable telemetry data collection for specific JSX attributes. These are collected for all included JSX elements. Specifying an attributeName here will also turn on data collection for boolean and numeric attribute values. String value data collection is handled separately via the `allowedAttributeStringValues` key."
},
"allowedAttributeStringValues": {
"type": "array",
"minItems": 1,
"items": {
"type": "string"
},
"description": "Enable telemetry data collection for specific string attribute values. These are collected for all defined attributes in the `allowedAttributeNames` key."
}
},
"additionalProperties": false
}
},
"required": ["elements"]
}
},
"additionalProperties": false
}
},
"additionalProperties": false,
"required": ["projectId", "collect"]
}