Skip to content

Commit daf4939

Browse files
committed
feat: Add OpenTelemetry support for node-server-sdk. (#401)
1 parent 1da3f99 commit daf4939

22 files changed

+634
-5
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: '@launchdarkly/node-server-sdk-otel Bug Report'
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: 'package: telemetry/node-server-sdk-otel, bug'
6+
assignees: ''
7+
---
8+
9+
**Is this a support request?**
10+
This issue tracker is maintained by LaunchDarkly SDK developers and is intended for feedback on the code in this library. If you're not sure whether the problem you are having is specifically related to this library, or to the LaunchDarkly service overall, it may be more appropriate to contact the LaunchDarkly support team; they can help to investigate the problem and will consult the SDK team if necessary. You can submit a support request by going [here](https://support.launchdarkly.com/) and clicking "submit a request", or by emailing [email protected].
11+
12+
Note that issues filed on this issue tracker are publicly accessible. Do not provide any private account information on your issues. If your problem is specific to your account, you should submit a support request as described above.
13+
14+
**Describe the bug**
15+
A clear and concise description of what the bug is.
16+
17+
**To reproduce**
18+
Steps to reproduce the behavior.
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Logs**
24+
If applicable, add any log output related to your problem.
25+
26+
**SDK version**
27+
The version of this SDK that you are using.
28+
29+
**Language version, developer tools**
30+
For instance, Go 1.11 or Ruby 2.5.3. If you are using a language that requires a separate compiler, such as C, please include the name and version of the compiler too.
31+
32+
**OS/platform**
33+
For instance, Ubuntu 16.04, Windows 10, or Android 4.0.3. If your code is running in a browser, please also include the browser type and version.
34+
35+
**Additional context**
36+
Add any other context about the problem here.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
name: '@launchdarkly/node-server-sdk-otel Feature Request'
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: 'package: telemetry/node-server-sdk-otel, feature'
6+
assignees: ''
7+
---
8+
9+
**Is your feature request related to a problem? Please describe.**
10+
A clear and concise description of what the problem is. Ex. I would love to see the SDK [...does something new...]
11+
12+
**Describe the solution you'd like**
13+
A clear and concise description of what you want to happen.
14+
15+
**Describe alternatives you've considered**
16+
A clear and concise description of any alternative solutions or features you've considered.
17+
18+
**Additional context**
19+
Add any other context about the feature request here.

.github/workflows/manual-publish-docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ on:
1818
- packages/sdk/akamai-edgekv
1919
- packages/store/node-server-sdk-redis
2020
- packages/store/node-server-sdk-dynamodb
21+
- packages/telemetry/node-server-sdk-otel
2122
name: Publish Documentation
2223
jobs:
2324
build-publish:

.github/workflows/manual-publish.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ on:
2121
- packages/sdk/akamai-edgekv
2222
- packages/store/node-server-sdk-redis
2323
- packages/store/node-server-sdk-dynamodb
24+
- packages/telemetry/node-server-sdk-otel
2425
prerelease:
2526
description: 'Is this a prerelease. If so, then the latest tag will not be updated in npm.'
2627
type: boolean

.github/workflows/node-otel.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: telemetry/node-server-sdk-otel
2+
3+
on:
4+
push:
5+
branches: [main, 'feat/**']
6+
paths-ignore:
7+
- '**.md' #Do not need to run CI for markdown changes.
8+
pull_request:
9+
branches: [main, 'feat/**']
10+
paths-ignore:
11+
- '**.md'
12+
13+
jobs:
14+
build-test-node-server-otel:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-node@v3
19+
with:
20+
node-version: 16
21+
registry-url: 'https://registry.npmjs.org'
22+
- id: shared
23+
name: Shared CI Steps
24+
uses: ./actions/ci
25+
with:
26+
workspace_name: '@launchdarkly/node-server-sdk-otel'
27+
workspace_path: packages/telemetry/node-server-sdk-otel

.github/workflows/release-please.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
package-akamai-edgekv-released: ${{ steps.release.outputs['packages/sdk/akamai-edgekv--release_created'] }}
2222
package-node-server-sdk-redis-release: ${{ steps.release.outputs['packages/store/node-server-sdk-redis--release_created'] }}
2323
package-node-server-sdk-dynamodb-release: ${{ steps.release.outputs['packages/store/node-server-sdk-dynamodb--release_created'] }}
24+
package-node-server-sdk-otel-release: ${{ steps.release.outputs['packages/telemetry/node-server-sdk-otel--release_created'] }}
2425
steps:
2526
- uses: google-github-actions/release-please-action@v4
2627
id: release
@@ -331,3 +332,26 @@ jobs:
331332
with:
332333
workspace_path: packages/store/node-server-sdk-dynamodb
333334
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}
335+
336+
release-node-server-sdk-otel:
337+
runs-on: ubuntu-latest
338+
needs: ['release-please']
339+
permissions:
340+
id-token: write
341+
contents: write
342+
if: ${{ needs.release-please.outputs.package-node-server-sdk-otel-release == 'true' }}
343+
steps:
344+
- uses: actions/checkout@v3
345+
- uses: actions/setup-node@v3
346+
with:
347+
node-version: 16.x
348+
registry-url: 'https://registry.npmjs.org'
349+
- uses: ./actions/install-npm-version
350+
with:
351+
npm_version: 9.5.0
352+
- id: release-node-server-sdk-otel
353+
name: Full release of packages/telemetry/node-server-sdk-otel
354+
uses: ./actions/full-release
355+
with:
356+
workspace_path: packages/telemetry/node-server-sdk-otel
357+
aws_assume_role: ${{ vars.AWS_ROLE_ARN }}

.release-please-manifest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
"packages/store/node-server-sdk-dynamodb": "6.1.7",
1212
"packages/store/node-server-sdk-redis": "4.1.7",
1313
"packages/shared/sdk-client": "1.1.1",
14-
"packages/sdk/react-native": "10.1.1"
14+
"packages/sdk/react-native": "10.1.1",
15+
"packages/telemetry/node-server-sdk-otel": "0.0.1"
1516
}

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ This includes shared libraries, used by SDKs and other tools, as well as SDKs.
2626
| [@launchdarkly/node-server-sdk-redis](packages/store/node-server-sdk-redis/README.md) | [![NPM][node-redis-npm-badge]][node-redis-npm-link] | [Node Redis][node-redis-issues] | [![Actions Status][node-redis-ci-badge]][node-redis-ci] |
2727
| [@launchdarkly/node-server-sdk-dynamodb](packages/store/node-server-sdk-dynamodb/README.md) | [![NPM][node-dynamodb-npm-badge]][node-dynamodb-npm-link] | [Node DynamoDB][node-dynamodb-issues] | [![Actions Status][node-dynamodb-ci-badge]][node-dynamodb-ci] |
2828

29+
| Telemetry Packages | npm | issues | tests |
30+
| ------------------------------------------------------------------------------------------- | --------------------------------------------------------- | ------------------------------------- | ------------------------------------------------------------- |
31+
| [@launchdarkly/node-server-sdk-otel](packages/telemetry/node-server-sdk-otel/README.md) | [![NPM][node-otel-npm-badge]][node-otel-npm-link] | [Node OTel][node-otel-issues] | [![Actions Status][node-otel-ci-badge]][node-otel-ci] |
32+
2933
## Organization
3034

3135
`packages` Top level directory containing package implementations.
@@ -36,6 +40,8 @@ This includes shared libraries, used by SDKs and other tools, as well as SDKs.
3640

3741
`packages/store` Persistent store packages for use with SDKs in this repository.
3842

43+
`packages/telemetry` Packages for adding telemetry support to SDKs.
44+
3945
## LaunchDarkly overview
4046

4147
[LaunchDarkly](https://www.launchdarkly.com) is a feature management platform that serves trillions of feature flags daily to help teams build better software, faster. [Get started](https://docs.launchdarkly.com/home/getting-started) using LaunchDarkly today!
@@ -157,3 +163,9 @@ We encourage pull requests and other contributions from the community. Check out
157163
[node-dynamodb-npm-badge]: https://img.shields.io/npm/v/@launchdarkly/node-server-sdk-dynamodb.svg?style=flat-square
158164
[node-dynamodb-npm-link]: https://www.npmjs.com/package/@launchdarkly/node-server-sdk-dynamodb
159165
[node-dynamodb-issues]: https://github.com/launchdarkly/js-core/issues?q=is%3Aissue+is%3Aopen+label%3A%22package%3A+store%2Fnode-server-sdk-dynamodb%22+
166+
[//]: # 'telemetry/node-server-sdk-otel'
167+
[node-otel-ci-badge]: https://github.com/launchdarkly/js-core/actions/workflows/node-otel.yml/badge.svg
168+
[node-otel-ci]: https://github.com/launchdarkly/js-core/actions/workflows/node-otel.yml
169+
[node-otel-npm-badge]: https://img.shields.io/npm/v/@launchdarkly/node-server-sdk-otel.svg?style=flat-square
170+
[node-otel-npm-link]: https://www.npmjs.com/package/@launchdarkly/node-server-sdk-otel
171+
[node-otel-issues]: https://github.com/launchdarkly/js-core/issues?q=is%3Aissue+is%3Aopen+label%3A%22package%3A+telemetry%2Fnode-server-sdk-otel%22+

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,13 @@
1313
"packages/sdk/react-native",
1414
"packages/sdk/react-native/example",
1515
"packages/sdk/vercel",
16-
"packages/sdk/vercel/examples/complete",
17-
"packages/sdk/vercel/examples/route-handler",
1816
"packages/sdk/akamai-base",
1917
"packages/sdk/akamai-base/example",
2018
"packages/sdk/akamai-edgekv",
2119
"packages/sdk/akamai-edgekv/example",
2220
"packages/store/node-server-sdk-redis",
23-
"packages/store/node-server-sdk-dynamodb"
21+
"packages/store/node-server-sdk-dynamodb",
22+
"packages/telemetry/node-server-sdk-otel"
2423
],
2524
"private": true,
2625
"scripts": {
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright 2024 Catamorphic, Co.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.

0 commit comments

Comments
 (0)