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 9 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
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',
],
}
11 changes: 10 additions & 1 deletion libs/js-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,16 @@
},
"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",
"@opentelemetry/sdk-trace-node": "^1.18.1"
}
}
1 change: 1 addition & 0 deletions libs/js-sdk/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"executor": "nx:run-commands",
"options": {
"commands": [
"echo \"export const version = '$(jq -r '.version' package.json)';\" > src/version.ts",
"tsup src/index.ts -d dist --sourcemap --format esm --legacy-output --external @featureboard/contracts --env.TEST false",
"tsup src/index.ts -d dist/legacycjs --sourcemap --format cjs --legacy-output --external @featureboard/contracts --env.TEST false",
"tsup src/index.ts -d dist --sourcemap --format esm,cjs --external @featureboard/contracts --env.TEST false",
Expand Down
Loading
Loading