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

v1.0.3

Published

Automated script to generate IBM Telemetry config files

Downloads

16

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.

Generating Config File

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

npx -y @ibm/telemetry-js-config-generator --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 --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 --p, --file-path). Verify that the generated output is correct before using the config file.

Required Params

--id

Unique identifier assigned on a per-project basis. See Onboarding a package to IBM Telemetry.

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

--endpoint

URL of an OpenTelemetry-compatible metrics collector API endpoint. Used to post collected telemetry data to. npx -y @ibm/telemetry-js-config-generator --id sample-id --endpoint https://example.com/v1/metrics --files ./src/components/**/*.(tsx|js|jsx)

-f, --files

Files to scan component props for (used to generate allowedAttributeNames and allowedAttributeStringValues arrays in JSX scope config). Can be a space-separated list of files or a glob.

This parameter is only required when including JSX scope in telemetry config file (done by default unless opt-out, see --no-jsx).

npx -y @ibm/telemetry-js-config-generator --id sample-id --endpoint https://example.com/v1/metrics --files ./src/components/specific-component-1.tsx ./src/components/specific-component-2.jsx

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

Optional Params

-p, --file-path

Path to create config file at, defaults to telemetry.yml.

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

-i, --ignore

Files to ignore when scanning for JSX Scope attributes, in glob(s) form.

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

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

--no-npm

Use this option to exclude npm scope config from generated telemetry config file.

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

--no-jsx

Use this option to exclude JSX scope config from generated telemetry config file. Omit supplying the -f, --files argument when option out of JSX config.

npx -y @ibm/telemetry-js-config-generator --id sample-id --endpoint https://example.com/v1/metrics --no-jsx