Skip to content
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

Instrumenting SDKs with open telemetry #69

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 15 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
35ebeef
Instrumented js-sdk with open telemetry
JakeGinnivan Dec 10, 2023
15439b1
Optimised and fixed http-client tests
JakeGinnivan Dec 11, 2023
3894c40
Update manual fixture
JakeGinnivan Dec 11, 2023
e32a99f
Updated mode-polling.spec
JakeGinnivan Dec 11, 2023
141d3cf
Fixed retry tests
JakeGinnivan Dec 11, 2023
be98aae
Cleanup failing test
JakeGinnivan Dec 11, 2023
f6b6497
Fixed up otel deps
JakeGinnivan Dec 12, 2023
01294de
Instrumented node-sdk
JakeGinnivan Dec 12, 2023
e47eda0
Fixed tests
JakeGinnivan Dec 12, 2023
bb3a2aa
Update lockfile
JakeGinnivan Dec 12, 2023
fdaff8d
Add changeset
JakeGinnivan Dec 12, 2023
b450823
Initialzed -> initialised
JakeGinnivan Dec 12, 2023
78751a2
Dependency cleanup
JakeGinnivan Dec 12, 2023
69f0142
Update version in code when versioning
JakeGinnivan Dec 12, 2023
48d8824
Remove versioning in PR build
JakeGinnivan Dec 12, 2023
e73e26d
Removed additional end spans
JakeGinnivan Dec 12, 2023
e5983cc
Remove x-sdk-version header
JakeGinnivan Dec 12, 2023
4cb0964
Fixed incorrect executor
JakeGinnivan Dec 12, 2023
f2c9bb6
Add missing dependencies back in
JakeGinnivan Dec 12, 2023
c6e2db8
Add using verdaccio instructions
JakeGinnivan Dec 12, 2023
c2e7994
Don't init otel sdk when env variables not configured
JakeGinnivan Dec 12, 2023
d1bf44e
Merge branch 'main' into feature/open-telemetry
idadaniels Jan 16, 2024
99cfb2d
Set parent span when starting polling updates span
idadaniels Jan 17, 2024
24b9f01
reset error in ensure single
idadaniels Jan 17, 2024
5a59ee9
No parent span use root for polling updates span
idadaniels Jan 17, 2024
d31967c
Update log message for on request
idadaniels Jan 17, 2024
f811943
Option to disable otel, updated span names, remove FEATUREBOARD_SDK_…
idadaniels Jan 24, 2024
bd7ddc7
export client options
idadaniels Jan 24, 2024
1bfceee
Fix spelling
idadaniels Jan 24, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/cuddly-rivers-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@featureboard/node-sdk': minor
'@featureboard/js-sdk': minor
---

Added native open telemetry integration
4 changes: 4 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ jobs:
sed -i "s/<Version>.*<\/Version>/<Version>$version<\/Version>/" $csproj_path
sed -i "s/<Copyright>.*<\/Copyright>/<Copyright>Copyright (c) Arkahna $currentYear<\/Copyright>/" $csproj_path

- name: Update Node/JS SDK version
run: |
pnpm nx run-many --target version --all

- name: Push changes
run: |
pnpm i -r --no-frozen-lockfile
Expand Down
22 changes: 1 addition & 21 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,24 +42,4 @@ jobs:
run: pnpm tsc -b

- name: Lint, build and test
run: pnpm nx run-many --target build,lint,test --all --exclude examples-dotnet-api

- name: Version command
id: version
run: |
npx changeset version
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update DotNet SDK version and copyright year
run: |
version=$(node -pe "require('./libs/dotnet-sdk/package.json').version")
echo "Version: $version"
currentYear=$(node -pe "new Date().getFullYear()")
csproj_path=libs/dotnet-sdk/FeatureBoard.DotnetSdk.csproj
sed -i "s/<Version>.*<\/Version>/<Version>$version<\/Version>/" $csproj_path
sed -i "s/<Copyright>.*<\/Copyright>/<Copyright>Copyright (c) Arkahna $currentYear<\/Copyright>/" $csproj_path
cat $csproj_path

- name: Package libs
run: pnpm package
run: pnpm nx run-many --target build,lint,test,package --all --exclude examples-dotnet-api
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ tsconfig.tsbuildinfo
**/src/**/*.js
**/src/**/*.d.ts
**/src/**/*.js.map
!**/src/**/schema.d.ts

.env
1 change: 0 additions & 1 deletion FeatureBoardSdks.sln.DotSettings

This file was deleted.

22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,25 @@ Go to [our website](https://featureboard.app) to find out more.
## Documentation

Installation and usage instructions can be found on our [docs site](https://docs.featureboard.app).

## Open Telemetry

The FeatureBoard SDKs are instrumented with Open Telemetry natively, so you can easily integrate with your existing observability tools.

### Unit tests

To configure the SDK to use a local Open Telemetry Collector, set the following environment variables:

OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318

You can put this in a `.env` file in the root of the project.

## Debugging

To enable debug logging, set the following environment variable:

```
FEATUREBOARD_SDK_DEBUG=true
```

In the browser set `window.FEATUREBOARD_SDK_DEBUG = true`
8 changes: 7 additions & 1 deletion libs/js-sdk/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,11 @@ module.exports = {
},
},
],
ignorePatterns: ['!**/*', 'node_modules', 'out-tsc'],
ignorePatterns: [
'!**/*',
'node_modules',
'tsc-out',
'vitest.config.ts',
'test-setup.ts',
],
}
10 changes: 9 additions & 1 deletion libs/js-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,15 @@
},
"dependencies": {
"@featureboard/contracts": "workspace:*",
"debug": "^4.3.4",
"promise-completion-source": "^1.0.0"
},
"peerDependencies": {
"@opentelemetry/api": "^1.0.0"
},
"devDependencies": {
"@opentelemetry/api": "^1.7.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.45.1",
"@opentelemetry/sdk-node": "^0.45.1",
"@opentelemetry/sdk-trace-base": "^1.18.1"
}
}
10 changes: 9 additions & 1 deletion libs/js-sdk/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,13 @@
"cwd": "libs/js-sdk"
}
},
"version": {
"executor": "@nrwl/workspace:run-commands",
"options": {
"command": "echo \"export const version = '$(jq -r '.version' package.json)';\" > src/version.ts",
"cwd": "libs/js-sdk"
}
},
"package": {
"executor": "nx:run-commands",
"options": {
Expand All @@ -28,7 +35,8 @@
],
"cwd": "libs/js-sdk",
"parallel": false
}
},
"dependsOn": ["version"]
}
}
}
Loading
Loading