Skip to content

Commit

Permalink
chore: onboard remaining v2 packages to IBM Telemetry 🚀 (#11661)
Browse files Browse the repository at this point in the history
### Related Ticket(s)

N/A

### Description

Adds the config file and dependency necessary to start tracking telemetry data via [IBM Telemetry](https://github.com/ibm-telemetry/telemetry-js) for the packages:

- `@carbon/ibmdotcom-services`
- `@carbon/ibmdotcom-styles`
- `@carbon/ibmdotcom-utilities`
- `@carbon/ibmdotcom-web-components`

The v2 `@carbon/web-components` has already been instrumented with IBM Telemetry.

This separate PR adds Telemetry to these v1 packages: #11660

### Changelog

**New**

- Adds `@ibm/telemetry-js` dependency
- Adds `telemetry.yml` config file using the correct project IDs
- Adds readme telemetry notice
- Adds `telemetry.yml` as an exported file if the package specifies `files`

**Changed**

- Post install scripts to use `@ibm/telemetry` instead of `@carbon/telemetry`

**Removed**

- Uninstalled `@carbon/telemetry`

### Testing

Please look through package.json config files and ensure all necessary modifications have been made so that the "telemetry.yml" config file is included in the release version of each package.

**PLEASE NOTE:** In order for IBM Telemetry to start collecting data for this project, a new build must be published including these changes.
  • Loading branch information
mattrosno authored Mar 27, 2024
1 parent ea376e4 commit 277a048
Show file tree
Hide file tree
Showing 14 changed files with 94 additions and 17 deletions.
Binary file not shown.
9 changes: 9 additions & 0 deletions packages/services/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ and our
[Developer Guide](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/blob/main/docs/developing.md)!
👀

## <picture><source height="20" width="20" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-dark.svg"><source height="20" width="20" media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-light.svg"><img height="20" width="20" alt="IBM Telemetry" src="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-light.svg"></picture> IBM Telemetry

This package uses IBM Telemetry to collect metrics data. By installing this
package as a dependency you are agreeing to telemetry collection. To opt out,
see
[Opting out of IBM Telemetry data collection](https://github.com/ibm-telemetry/telemetry-js/tree/main#opting-out-of-ibm-telemetry-data-collection).
For more information on the data being collected, please see the
[IBM Telemetry documentation](https://github.com/ibm-telemetry/telemetry-js/tree/main#ibm-telemetry-collection-basics).

## 📝 License

Licensed under the
Expand Down
7 changes: 4 additions & 3 deletions packages/services/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"files": [
"lib/**/*",
"es/**/*",
"umd/**/*"
"umd/**/*",
"telemetry.yml"
],
"keywords": [
"carbon",
Expand All @@ -39,15 +40,15 @@
"clean": "rimraf es lib umd",
"contributors:add": "all-contributors add",
"contributors:generate": "all-contributors generate",
"postinstall": "carbon-telemetry collect --install",
"postinstall": "ibmtelemetry --config=telemetry.yml",
"prepublish": "yarn build",
"test": "jest",
"jsdoc": "rimraf docs && jsdoc -c ./jsdoc.json ./README.md"
},
"dependencies": {
"@babel/runtime": "^7.16.3",
"@carbon/ibmdotcom-utilities": "2.6.0-rc.0",
"@carbon/telemetry": "0.1.0",
"@ibm/telemetry-js": "^1.3.0",
"axios": "^1.6.0",
"marked": "^4.0.10",
"window-or-global": "^1.0.1"
Expand Down
7 changes: 7 additions & 0 deletions packages/services/telemetry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# yaml-language-server: $schema=https://unpkg.com/@ibm/telemetry-config-schema@v1/dist/config.schema.json
version: 1
projectId: e68866bc-10f8-4c87-81b1-a3776d4e801e
endpoint: https://collector-prod.1am6wm210aow.us-south.codeengine.appdomain.cloud/v1/metrics
collect:
npm:
dependencies: null
9 changes: 9 additions & 0 deletions packages/styles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ and our
[Developer Guide](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/blob/main/docs/developing.md)!
👀

## <picture><source height="20" width="20" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-dark.svg"><source height="20" width="20" media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-light.svg"><img height="20" width="20" alt="IBM Telemetry" src="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-light.svg"></picture> IBM Telemetry

This package uses IBM Telemetry to collect metrics data. By installing this
package as a dependency you are agreeing to telemetry collection. To opt out,
see
[Opting out of IBM Telemetry data collection](https://github.com/ibm-telemetry/telemetry-js/tree/main#opting-out-of-ibm-telemetry-data-collection).
For more information on the data being collected, please see the
[IBM Telemetry documentation](https://github.com/ibm-telemetry/telemetry-js/tree/main#ibm-telemetry-collection-basics).

## 📝 License

Licensed under the
Expand Down
9 changes: 5 additions & 4 deletions packages/styles/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"files": [
"dist/**/*",
"scss/**/*",
"icons/**/*"
"icons/**/*",
"telemetry.yml"
],
"keywords": [
"carbon",
Expand All @@ -24,16 +25,16 @@
"scripts": {
"build": "gulp",
"ci-check": "yarn build",
"postinstall": "carbon-telemetry collect --install",
"postinstall": "ibmtelemetry --config=telemetry.yml",
"start": "gulp dev",
"upgrade-carbon": "yarn upgrade-interactive @carbon/layout @carbon/styles @carbon/themes @carbon/icons-react --latest --exact"
},
"dependencies": {
"@carbon/icons-react": "11.38.0",
"@carbon/layout": "11.21.0",
"@carbon/styles": "1.53.0",
"@carbon/telemetry": "0.1.0",
"@carbon/type": "11.26.0"
"@carbon/type": "11.26.0",
"@ibm/telemetry-js": "^1.3.0"
},
"devDependencies": {
"@carbon/themes": "11.33.0",
Expand Down
7 changes: 7 additions & 0 deletions packages/styles/telemetry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# yaml-language-server: $schema=https://unpkg.com/@ibm/telemetry-config-schema@v1/dist/config.schema.json
version: 1
projectId: 4a912794-62c0-4df0-936f-35aab853934a
endpoint: https://collector-prod.1am6wm210aow.us-south.codeengine.appdomain.cloud/v1/metrics
collect:
npm:
dependencies: null
9 changes: 9 additions & 0 deletions packages/utilities/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ and our
[Developer Guide](https://github.com/carbon-design-system/carbon-for-ibm-dotcom/blob/main/docs/developing.md)!
👀

## <picture><source height="20" width="20" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-dark.svg"><source height="20" width="20" media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-light.svg"><img height="20" width="20" alt="IBM Telemetry" src="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-light.svg"></picture> IBM Telemetry

This package uses IBM Telemetry to collect metrics data. By installing this
package as a dependency you are agreeing to telemetry collection. To opt out,
see
[Opting out of IBM Telemetry data collection](https://github.com/ibm-telemetry/telemetry-js/tree/main#opting-out-of-ibm-telemetry-data-collection).
For more information on the data being collected, please see the
[IBM Telemetry documentation](https://github.com/ibm-telemetry/telemetry-js/tree/main#ibm-telemetry-collection-basics).

## 📝 License

Licensed under the
Expand Down
7 changes: 4 additions & 3 deletions packages/utilities/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"files": [
"lib/**/*",
"es/**/*",
"umd/**/*"
"umd/**/*",
"telemetry.yml"
],
"keywords": [
"carbon",
Expand All @@ -40,12 +41,12 @@
"contributors:add": "all-contributors add",
"contributors:generate": "all-contributors generate",
"jsdoc": "rimraf docs && jsdoc -c ./jsdoc.json ./README.md",
"postinstall": "carbon-telemetry collect --install",
"postinstall": "ibmtelemetry --config=telemetry.yml",
"prepublish": "yarn build",
"test": "jest"
},
"dependencies": {
"@carbon/telemetry": "0.1.0",
"@ibm/telemetry-js": "^1.3.0",
"axios": "^1.6.0",
"isomorphic-dompurify": "0.27.0",
"js-cookie": "^2.2.1",
Expand Down
7 changes: 7 additions & 0 deletions packages/utilities/telemetry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# yaml-language-server: $schema=https://unpkg.com/@ibm/telemetry-config-schema@v1/dist/config.schema.json
version: 1
projectId: 5e9fac66-dccd-412a-83ba-e98071dbd615
endpoint: https://collector-prod.1am6wm210aow.us-south.codeengine.appdomain.cloud/v1/metrics
collect:
npm:
dependencies: null
9 changes: 9 additions & 0 deletions packages/web-components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -490,3 +490,12 @@ site owners. IBM.com site owners can see them at [here](https://ibm.biz/Bdq5q2).
## Contributing to Carbon for IBM.com Web Components

Can be found at [here](./docs/contributing-to-web-components.md).

## <picture><source height="20" width="20" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-dark.svg"><source height="20" width="20" media="(prefers-color-scheme: light)" srcset="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-light.svg"><img height="20" width="20" alt="IBM Telemetry" src="https://raw.githubusercontent.com/ibm-telemetry/telemetry-js/main/docs/images/ibm-telemetry-light.svg"></picture> IBM Telemetry

This package uses IBM Telemetry to collect metrics data. By installing this
package as a dependency you are agreeing to telemetry collection. To opt out,
see
[Opting out of IBM Telemetry data collection](https://github.com/ibm-telemetry/telemetry-js/tree/main#opting-out-of-ibm-telemetry-data-collection).
For more information on the data being collected, please see the
[IBM Telemetry documentation](https://github.com/ibm-telemetry/telemetry-js/tree/main#ibm-telemetry-collection-basics).
7 changes: 4 additions & 3 deletions packages/web-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
"es/**/*",
"lib/**/*",
"scss/**/*",
"custom-elements.json"
"custom-elements.json",
"telemetry.yml"
],
"publishConfig": {
"access": "public"
Expand Down Expand Up @@ -58,7 +59,7 @@
"clean": "gulp clean",
"clean:dist": "rimraf dist",
"doctoc": "doctoc --title '## Table of contents' docs && doctoc --title '## Table of contents' README.md",
"postinstall": "carbon-telemetry collect --install",
"postinstall": "ibmtelemetry --config=telemetry.yml",
"start": "yarn storybook",
"start-dev": "./update-scss-paths.sh & yarn start",
"storybook": "start-storybook -p 9000",
Expand Down Expand Up @@ -96,8 +97,8 @@
"@carbon/layout": "11.21.0",
"@carbon/motion": "11.17.0",
"@carbon/styles": "1.53.0",
"@carbon/telemetry": "0.1.0",
"@carbon/web-components": "2.6.0-rc.0",
"@ibm/telemetry-js": "^1.3.0",
"lit": "^2.7.6",
"lodash-es": "^4.17.21",
"redux": "^4.0.0",
Expand Down
7 changes: 7 additions & 0 deletions packages/web-components/telemetry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# yaml-language-server: $schema=https://unpkg.com/@ibm/telemetry-config-schema@v1/dist/config.schema.json
version: 1
projectId: 2a67e3ca-af1a-470d-87e5-474e71848221
endpoint: https://collector-prod.1am6wm210aow.us-south.codeengine.appdomain.cloud/v1/metrics
collect:
npm:
dependencies: null
17 changes: 13 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3291,7 +3291,7 @@ __metadata:
"@babel/preset-env": "npm:~7.23.2"
"@babel/runtime": "npm:^7.16.3"
"@carbon/ibmdotcom-utilities": "npm:2.6.0-rc.0"
"@carbon/telemetry": "npm:0.1.0"
"@ibm/telemetry-js": "npm:^1.3.0"
"@rollup/plugin-babel": "npm:^5.3.1"
"@rollup/plugin-commonjs": "npm:^21.0.3"
"@rollup/plugin-json": "npm:^4.1.0"
Expand Down Expand Up @@ -3331,9 +3331,9 @@ __metadata:
"@carbon/icons-react": "npm:11.38.0"
"@carbon/layout": "npm:11.21.0"
"@carbon/styles": "npm:1.53.0"
"@carbon/telemetry": "npm:0.1.0"
"@carbon/themes": "npm:11.33.0"
"@carbon/type": "npm:11.26.0"
"@ibm/telemetry-js": "npm:^1.3.0"
del: "npm:^6.0.0"
gulp: "npm:^4.0.2"
gulp-autoprefixer: "npm:^6.1.0"
Expand Down Expand Up @@ -3373,7 +3373,7 @@ __metadata:
"@babel/plugin-transform-class-properties": "npm:~7.22.5"
"@babel/plugin-transform-export-namespace-from": "npm:~7.22.11"
"@babel/preset-env": "npm:~7.23.2"
"@carbon/telemetry": "npm:0.1.0"
"@ibm/telemetry-js": "npm:^1.3.0"
"@rollup/plugin-babel": "npm:^5.3.1"
"@rollup/plugin-commonjs": "npm:^21.0.3"
"@rollup/plugin-json": "npm:^4.1.0"
Expand Down Expand Up @@ -3439,9 +3439,9 @@ __metadata:
"@carbon/pictograms-react": "npm:11.58.0"
"@carbon/react": "npm:1.53.1"
"@carbon/styles": "npm:1.53.0"
"@carbon/telemetry": "npm:0.1.0"
"@carbon/type": "npm:11.26.0"
"@carbon/web-components": "npm:2.6.0-rc.0"
"@ibm/telemetry-js": "npm:^1.3.0"
"@open-wc/semantic-dom-diff": "npm:~0.18.0"
"@percy-io/in-percy": "npm:^0.1.11"
"@percy/cli": "npm:^1.27.4"
Expand Down Expand Up @@ -4602,6 +4602,15 @@ __metadata:
languageName: node
linkType: hard

"@ibm/telemetry-js@npm:^1.3.0":
version: 1.3.0
resolution: "@ibm/telemetry-js@npm:1.3.0"
bin:
ibmtelemetry: dist/collect.js
checksum: 10/5581511e540b0edf79d7d1badf9a994bcd97d99c27a295909c3184871f76629a9f4095a66c3ca5e835035b90e895c324271786fb958cad9c58f37717b97ca353
languageName: node
linkType: hard

"@isaacs/cliui@npm:^8.0.2":
version: 8.0.2
resolution: "@isaacs/cliui@npm:8.0.2"
Expand Down

0 comments on commit 277a048

Please sign in to comment.