npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@ibm/telemetry-js-config-generator

v2.0.1

Published

Automated script to generate IBM Telemetry config files

Downloads

3,008

Readme

IBM Telemetry Js Config Generator

Script automation for generating @ibm/telemetry-js config files according to published schema.

Use this tool to automatically generate an @ibm/telemetry-js compatible telemetry.yml file with your project-specific configurations.

Note
For v1, please see v1 docs

Commands

Usage: ibmtelemetry-config [options] [command]

Options:
  -h, --help          display help for command

Commands:
  generate [options]  Generate IBM telemetry config file.
  update [options]    Modify in whole or part an existing telemetry config file
  npm                 Add, update or remove npm scope
  js                  Add, update or remove js scope
  jsx                 Sdd, update or remove jsx scope
  help [command]      display help for command

Generate

From the root of the project that needs to be instrumented with IBM Telemetry, run the generate command:

npx -y @ibm/telemetry-js-config-generator generate --id sample-id --endpoint https://example.com/v1/metrics --files ./src/components/**/*.(tsx|js|jsx)

Note that it is not necessary for your package to directly install this package as a dependency. Instead, use npx to call the published collection script directly from the @ibm/telemetry-js-config-generator package.

Alternatively, if you decide to install the package as a dependency (to run it periodically within your CI environment, for example), you can call the bin like so:

ibmtelemetry-config generate --id sample-id --endpoint https://example.com/v1/metrics --files ./src/components/**/*.(tsx|js|jsx)

A telemetry.yml file will be generated inside the cwd path, unless a file path is specified (see parameters). Verify that the generated output is correct before using the config file.

Usage: ibmtelemetry-config generate [options]

Generate IBM telemetry config file.

Options:
  --id <project-id>            Project Id, should be obtained from the IBM Telemetry team
  --endpoint <endpoint>        URL of an OpenTelemetry-compatible metrics collector API endpoint. Used to post collected telemetry data to.
  -f, --files <files...>       List of files to scan for JSX Scope attributes, can be an array of path(s) or glob(s). Required to generate JSX scope options
  -i, --ignore <files...>      Files to ignore when scanning for JSX Scope attributes, in glob(s) form.
  -p, --file-path <file-path>  Path to create config file at, defaults to `telemetry.yml` (default: "telemetry.yml")
  --no-npm                     Disables config generation for npm scope
  --no-jsx                     Disables config generation for JSX scope
  --no-js                      Disables config generation for JS scope
  -h, --help                   display help for command

Example Usage

npx -y @ibm/telemetry-js-config-generator generate --id sample-id --endpoint https://example.com/v1/metrics --files ./src/components/**/*.(tsx|js|jsx) --file-path ./packages/sample/telemetry.yml -i **/DataTable/**/*.tsx **/Copy/** --no-npm --no-js

ibmtelemetry-config generate --id sample-id --endpoint https://example.com/v1/metrics --no-jsx

Update

To update an existing telemetry config file, run the update command. You can use this command to regenerate entirely a telemetry configuration or only in-part (see available parameters). Remember to supply the file path parameter if your telemetry config is not at the default location.

Usage: ibmtelemetry-config update [options]

Modify in whole or part an existing telemetry config file

Options:
  --id <project-id>            Project Id, should be obtained from the IBM Telemetry team
  --endpoint <endpoint>        URL of an OpenTelemetry-compatible metrics collector API endpoint. Used to post collected telemetry data to.
  -f, --files <files...>       List of files to scan for JSX Scope attributes, can be an array of path(s) or glob(s). Required to generate JSX scope options
  -i, --ignore <files...>      Files to ignore when scanning for JSX Scope attributes, in glob(s) form.
  -p, --file-path <file-path>  Path to create config file at, defaults to `telemetry.yml` (default: "telemetry.yml")
  --no-npm                     Disables config generation for npm scope
  --no-jsx                     Disables config generation for JSX scope
  --no-js                      Disables config generation for JS scope
  -h, --help                   display help for command

Example Usage

npx -y @ibm/telemetry-js-config-generator update --files ./src/components/**/*.(tsx|js|jsx)

ibmtelemetry-config update --no-jsx

npm

Use npm command along with add, update or remove subcommands. Remember to supply the file path parameter if your telemetry config is not at the default location.

Usage: ibmtelemetry-config npm [options] [command]

Add, update or remove npm scope

Options:
  -h, --help        display help for command

Commands:
  add [options]     Add npm scope to current config file
  update [options]  Regenerate the npm scope
  remove [options]  Remove npm scope from current config file
  help [command]    display help for command

Subcommands

Add
Usage: ibmtelemetry-config npm add [options]

Add npm scope to current config file

Options:
  -p, --file-path <file-path>  Path to create config file at, defaults to `telemetry.yml` (default: "telemetry.yml")
  -h, --help                   display help for command
Update
Usage: ibmtelemetry-config npm update [options]

Regenerate the npm scope

Options:
  -p, --file-path <file-path>  Path to create config file at, defaults to `telemetry.yml` (default: "telemetry.yml")
  -h, --help                   display help for command
Remove
Usage: ibmtelemetry-config npm remove [options]

Remove npm scope from current config file

Options:
  -p, --file-path <file-path>  Path to create config file at, defaults to `telemetry.yml` (default: "telemetry.yml")
  -h, --help                   display help for command

Example Usage

npx -y @ibm/telemetry-js-config-generator npm add

ibmtelemetry-config npm update

npx -y @ibm/telemetry-js-config-generator npm remove

jsx

Use jsx command along with add, update or remove subcommands. Remember to supply the file path parameter if your telemetry config is not at the default location.

Usage: ibmtelemetry-config jsx [options] [command]

Add, update or remove jsx scope

Options:
  -h, --help        display help for command

Commands:
  add [options]     Add jsx scope to current config file
  update [options]  Regenerate the jsx scope
  remove [options]  Remove jsx scope from current config file
  help [command]    display help for command

Subcommands

Add
Usage: ibmtelemetry-config jsx add [options]

Add jsx scope to current config file

Options:
  -f, --files <files...>       List of files to scan for JSX Scope attributes, can be an array of path(s) or glob(s). Required to generate JSX scope options
  -i, --ignore <files...>      Files to ignore when scanning for JSX Scope attributes, in glob(s) form.
  -p, --file-path <file-path>  Path to create config file at, defaults to `telemetry.yml` (default: "telemetry.yml")
  -h, --help                   display help for command
Update
Usage: ibmtelemetry-config jsx update [options]

Regenerate the jsx scope

Options:
  -f, --files <files...>       List of files to scan for JSX Scope attributes, can be an array of path(s) or glob(s). Required to generate JSX scope options
  -i, --ignore <files...>      Files to ignore when scanning for JSX Scope attributes, in glob(s) form.
  -p, --file-path <file-path>  Path to create config file at, defaults to `telemetry.yml` (default: "telemetry.yml")
  -h, --help                   display help for command
Remove
Usage: ibmtelemetry-config jsx remove [options]

Remove jsx scope from current config file

Options:
  -p, --file-path <file-path>  Path to create config file at, defaults to `telemetry.yml` (default: "telemetry.yml")
  -h, --help                   display help for command

Example Usage

npx -y @ibm/telemetry-js-config-generator jsx add -f ./src/components/**/*.(tsx|js|jsx) --ignore **/DataTable/**/*.tsx **/Copy/**

ibmtelemetry-config jsx update --files ./src/components/**/*.(tsx|js|jsx)

npx -y @ibm/telemetry-js-config-generator jsx remove

js

Use js command along with add, update or remove subcommands. Remember to supply the file path parameter if your telemetry config is not at the default location.

Add, update or remove js scope

Options:
  -h, --help        display help for command

Commands:
  add [options]     Add js scope to current config file
  update [options]  Regenerate the js scope
  remove [options]  Remove js scope from current config file
  help [command]    display help for command

Subcommands

Add
Usage: ibmtelemetry-config js add [options]

Add js scope to current config file

Options:
  -p, --file-path <file-path>  Path to create config file at, defaults to `telemetry.yml` (default: "telemetry.yml")
  -h, --help                   display help for command
Update
Usage: ibmtelemetry-config js update [options]

Regenerate the js scope

Options:
  -p, --file-path <file-path>  Path to create config file at, defaults to `telemetry.yml` (default: "telemetry.yml")
  -h, --help                   display help for command
Remove
Usage: ibmtelemetry-config js remove [options]

Remove js scope from current config file

Options:
  -p, --file-path <file-path>  Path to create config file at, defaults to `telemetry.yml` (default: "telemetry.yml")
  -h, --help                   display help for command

Example Usage

npx -y @ibm/telemetry-js-config-generator js add

ibmtelemetry-config js update

npx -y @ibm/telemetry-js-config-generator js remove