-
Notifications
You must be signed in to change notification settings - Fork 8
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
Exporter packages #115
Merged
Merged
Exporter packages #115
Changes from 17 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
aa6243e
WIP: Split exporters into separate packages
arendjr 381f142
WIP
arendjr a5a082b
Update examples
arendjr 2e83ecd
WIP
arendjr 5496f4f
Fix TS builds
arendjr 1f682b2
WIP
arendjr 528e631
Finish things up
arendjr 47aa4e6
Simplification
arendjr de21b61
Remove SDKs
arendjr 36e3e81
Most things seem to work again
arendjr e420d20
Fix tests
arendjr 7633563
Fix lock file
arendjr 9bdc988
CI fix
arendjr ef555b9
React example works
arendjr a984b82
Add README for React example
arendjr 46af537
Improved docs
arendjr 83c494f
Fix an incomplete comment I wrote awhile ago
brettimus 89a5606
PR feedback
arendjr b85cf02
Make it clear React app example is experimental
arendjr 56a22ec
Add integration test for OTLP -- still failing
arendjr ccfaa02
Fix edge case with metrics being recorded before init()
arendjr 745bda3
Remove copied comment
arendjr 9296f10
Fix temporary meter
arendjr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,28 +2,22 @@ name: CI | |
on: | ||
push: | ||
branches: ["*"] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: rome/[email protected] | ||
with: | ||
version: latest | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup the project | ||
run: npm ci | ||
|
||
- name: Install rome cli tools | ||
run: npm install @rometools/cli-linux-x64 | ||
run: yarn | ||
|
||
- name: Run linter and format checker | ||
run: npm run lint | ||
run: yarn lint | ||
|
||
- name: Create a build | ||
run: yarn build | ||
|
||
- name: Run unit tests | ||
run: npm run test | ||
run: yarn test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Publish lib/ (and convenience package autometrics/) packages to NPMJS | ||
name: Publish main @autometrics/autometrics and the exporters to NPM | ||
on: | ||
push: | ||
tags: | ||
|
@@ -8,24 +8,16 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- uses: rome/[email protected] | ||
with: | ||
version: latest | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup the project | ||
run: npm ci | ||
|
||
- name: Install rome cli tools | ||
run: npm install @rometools/cli-linux-x64 | ||
run: yarn | ||
|
||
- name: Run linter and format checker | ||
run: npm run lint | ||
run: yarn lint | ||
|
||
- name: Run unit tests | ||
run: npm run test | ||
run: yarn test | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
|
@@ -39,9 +31,19 @@ jobs: | |
registry-url: 'https://registry.npmjs.org' | ||
scope: "@autometrics" | ||
|
||
- run: npm ci | ||
|
||
- run: npm run build --workspace=@autometrics/autometrics --workspace=autometrics | ||
- run: npm run release --workspace=@autometrics/autometrics --workspace=autometrics | ||
- run: yarn | ||
|
||
- run: | | ||
yarn build \ | ||
--workspace=@autometrics/autometrics \ | ||
--workspace=@autometrics/exporter-otlp-http \ | ||
--workspace=@autometrics/exporter-prometheus \ | ||
--workspace=@autometrics/exporter-prometheus-push-gateway | ||
- run: | | ||
yarn release \ | ||
--workspace=@autometrics/autometrics \ | ||
--workspace=@autometrics/exporter-otlp-http \ | ||
--workspace=@autometrics/exporter-prometheus \ | ||
--workspace=@autometrics/exporter-prometheus-push-gateway | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Publish Parcel transformer plugin package to NPMJS | ||
name: Publish Parcel transformer plugin package to NPM | ||
on: | ||
push: | ||
tags: | ||
|
@@ -8,24 +8,16 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- uses: rome/[email protected] | ||
with: | ||
version: latest | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup the project | ||
run: npm ci | ||
|
||
- name: Install rome cli tools | ||
run: npm install @rometools/cli-linux-x64 | ||
run: yarn | ||
|
||
- name: Run linter and format checker | ||
run: npm run lint | ||
run: yarn lint | ||
|
||
- name: Run unit tests | ||
run: npm run test | ||
run: yarn test | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
|
@@ -39,10 +31,11 @@ jobs: | |
registry-url: 'https://registry.npmjs.org' | ||
scope: "@autometrics" | ||
|
||
- run: npm ci | ||
- run: yarn | ||
|
||
- run: yarn build --workspace=@autometrics/parcel-transformer-autometrics | ||
|
||
- run: npm run build --workspace=@autometrics/parcel-transformer-autometrics | ||
- run: npm run release --workspace=@autometrics/parcel-transformer-autometrics | ||
- run: yarn release --workspace=@autometrics/parcel-transformer-autometrics | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Publish TypeScript plugin package to NPMJS | ||
name: Publish TypeScript plugin package to NPM | ||
on: | ||
push: | ||
tags: | ||
|
@@ -8,21 +8,13 @@ jobs: | |
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- uses: rome/[email protected] | ||
with: | ||
version: latest | ||
|
||
- uses: actions/checkout@v3 | ||
|
||
- name: Setup the project | ||
run: npm ci | ||
|
||
- name: Install rome cli tools | ||
run: npm install @rometools/cli-linux-x64 | ||
run: yarn | ||
|
||
- name: Run linter and format checker | ||
run: npm run lint | ||
run: yarn lint | ||
|
||
publish: | ||
runs-on: ubuntu-latest | ||
|
@@ -36,10 +28,11 @@ jobs: | |
registry-url: 'https://registry.npmjs.org' | ||
scope: "@autometrics" | ||
|
||
- run: npm ci | ||
- run: yarn | ||
|
||
- run: yarn build --workspace=@autometrics/typescript-plugin | ||
|
||
- run: npm run build --workspace=@autometrics/typescript-plugin | ||
- run: npm run release --workspace=@autometrics/typescript-plugin | ||
- run: yarn release --workspace=@autometrics/typescript-plugin | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
nodeLinker: node-modules | ||
|
||
plugins: | ||
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs | ||
spec: "@yarnpkg/plugin-workspace-tools" | ||
|
||
yarnPath: .yarn/releases/yarn-3.6.3.cjs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,12 +2,12 @@ | |
|
||
## Development workflow | ||
|
||
The project uses as `npm` as the package manager. | ||
The project uses `yarn` as the package manager. | ||
|
||
```shell | ||
git clone [email protected]:autometrics-dev/autometrics-ts.git | ||
cd autometrics-ts | ||
npm install | ||
yarn | ||
``` | ||
|
||
### Overview | ||
|
@@ -31,46 +31,16 @@ into the generated query templates. | |
|
||
```shell | ||
# in project root | ||
npm run dev:lib | ||
yarn dev:lib | ||
``` | ||
|
||
##### TypeScript plugin | ||
|
||
```shell | ||
# in project root | ||
npm run dev:plugin | ||
yarn dev:plugin | ||
``` | ||
|
||
#### Use examples | ||
|
||
Use the examples in `examples/` to test your changes. You will need to reinstall | ||
autometrics packages to use the local development ones to see the changes | ||
reflected. | ||
|
||
Example with the `express` app: | ||
|
||
1. Remove the official npm released autometrics packages | ||
|
||
```shell | ||
npm uninstall @autometrics/autometrics @autometrics/typescript-plugin | ||
``` | ||
|
||
2. Install local versions of autometrics | ||
|
||
```shell | ||
# from examples/express | ||
npm install ../../packages/autometrics/ | ||
npm install -D ../../packages/typescript-plugin/ | ||
``` | ||
|
||
Now every time you will save and rebuild any of the packages they will update in | ||
your example repo automatically (you won't need to re-run `npm install`) | ||
|
||
Open the `express` app with your editor, e.g.: VSCode - `code examples/express/` | ||
|
||
This is now your "lab" environment for testing out how the library or the plugin | ||
work and feel. | ||
|
||
#### Debugging TypeScript plugin | ||
|
||
0. Run `Launch VSCode` and `Attach VSCode` in debugger | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think this was a copy-paste from the otel readme. not sure if we want to include
init
as an example of generic usageThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy-paste?! I'm no AI 🤣