This repository contains the configuration file schema for IBM Telemetry.
IBM Telemetry's config file schema is applied through metadata files written in YAML. If you're new to YAML and want to learn more, see "Learn YAML in Y minutes." Below is the latest stable version of the schema.
The current supported stable version of the config schema is v1. You can add the YAML language server to your YAML files by adding the following line to the top of your files:
# yaml-language-server: $schema=https://unpkg.com/@ibm/telemetry-config-schema@v1/dist/config.schema.json
Note: If you're using VS Code as your editor you may install a YAML extension, such as YAML for additional language support such as validation and auto–complete.
Key Description Required Typeversion
Current schema version. Required 1 projectId
Unique identifier assigned on a per-project basis. See Onboarding a package to IBM Telemetry for instructions on how to obtain a projectId Required String endpoint
URL of an OpenTelemetry-compatible metrics collector API endpoint. Required String collect
Object containing one or more scopes for which to collect data. See collect schema for more info. Required Object
# yaml-language-server: $schema=https://unpkg.com/@ibm/telemetry-config-schema@v1/dist/config.schema.json version: 1 projectId: 'project id' endpoint: 'https://example.com/v1/metrics' collect: npm: dependencies: jsx: elements: allowedAttributeNames: - 'size' - 'title' allowedAttributeStringValues: - 'small' - 'medium' - 'large' - 'title1' - 'title2' js: tokens: functions: allowedArgumentStringValues: - 'arg1' - 'arg2'
The keys under collect
represent the various "scopes" that IBM Telemetry understands (e.g. jsx
). Each "scope" contains one or more "metrics" that can be collected for that scope (e.g. jsx.elements
). Each "metric" contains zero or more configuration options for that metric (e.g. jsx.elements.allowedAttributeNames
).
Note: At least one scope is required.
collect: npm: dependencies: jsx: elements: allowedAttributeNames: - 'size' - 'title' allowedAttributeStringValues: - 'small' - 'medium' - 'large' - 'title1' - 'title2' js: tokens: functions: allowedArgumentStringValues: - 'arg1' - 'arg2'Key Description Required Type
npm
Configuration for collecting telemetry data from an npm environment. See NPM scope for more info. Optional Object jsx
Configuration for collecting telemetry data from JSX files. See JSX scope for more info. Optional Object js
Configuration for collecting telemetry data for tokens and functions. See JS scope for more info. Optional Object wc
Configuration for collecting telemetry data from HTML and JSX files. See WC scope for more info. Optional Object
This scope applies to NPM environments.
Captures data relating to the instrumented package's installer(s) and dependencies installed alongside it. Specifically:
This data can help answer questions such as:
--- npm: dependencies: # or # dependencies: null
This scope is only applicable to React packages. This scope may be useful to configure if the package you're instrumenting exports React components.
--- jsx: elements: allowedAttributeNames: - 'size' - 'title' allowedAttributeStringValues: - 'small' - 'medium' - 'large' - 'title1' - 'title2'
This scope is only applicable to Web Component packages. This scope may be useful to configure if the package you're instrumenting exports Web Components. Applies to .jsx, .mjs, .js, .cjs, .tsx, .mts, .ts, .cts, .mjsx, .cjsx, .mtsx, .ctsx, .html, .htm extension files. While web components are mainly used within HTML files, they are designed to be framework agnostic, meaning that they can still be used anywhere, including JSX files.
--- wc: elements: allowedAttributeNames: - 'size' - 'title' allowedAttributeStringValues: - 'small' - 'medium' - 'large' - 'title1' - 'title2'
Captures element-specific usage data for the instrumented package. This metric is used by both jsx
and wc
scopes. Specifically:
allowedAttributeNames
and allowedAttributeStringValues
config options (see below for additional information)This data can help you answer questions such as:
By default, the jsx.elements
/wc.elements
metrics will collect element names, anonymized element attribute names, and anonymized element attribute values. The following config options allow certain additional values to be collected in plain text (instead of as anonymized values).
allowedAttributeNames
: This is an optional array of strings.
Enables plain-text collection of specific attribute names. These are collected for all discovered elements imported from the instrumented package. Additionally, boolean and numeric values for these attributes will be collected in plain text.
At least one string value is required if this key is defined.
allowedAttributeStringValues
: This is an optional array of strings.
Enables plain-text collection of specific attribute string values. These are collected for discovered attributes included in the allowedAttributeNames
list.
At least one value is required if this key is defined.
Note: You can use the IBM Telemetry Js Config Generator script to automatically generate a config file with these values. Remember to verify that the generated output is correct before using the config file.
This scope applies to JavaScript environments. Captures metrics for file token
and function
usage. Applies to .jsx, .mjs, .js, .cjs, .tsx, .mts, .ts, .cts, .mjsx, .cjsx, .mtsx, .ctsx extension files.
Captures function-specific usage data for the instrumented package. Specifically:
allowedArgumentStringValues
config option (see below for additional information)This data can help you answer questions such as:
By default, the js.function
metrics will collect function names, access and import paths, and anonymized function arguments. The following config options allow certain additional values to be collected in plain text (instead of as anonymized values).
allowedArgumentStringValues
: This is an optional array of strings.
Enables plain-text collection of specific function argument string values. These are collected for discovered JS functions.
At least one value is required if this key is defined.
Captures token-specific usage data for the instrumented package. Specifically:
This data can help you answer questions such as:
By default, the js.token
metrics will collect token names, access and import paths.
--- js: tokens: functions: allowedArgumentStringValues: - 'arg1' - 'arg2'
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4