Skip to content

Commit

Permalink
update docs, env variables
Browse files Browse the repository at this point in the history
add node 23 to ci
  • Loading branch information
seemk committed Dec 10, 2024
1 parent 5de1056 commit 2edfa02
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 45 deletions.
26 changes: 7 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,7 @@ jobs:
fail-fast: false
matrix:
container: ['node:16.0.0']
node_api_target: ['18.0.0']
include:
- container: 'node:16.0.0'
node_api_target: '20.0.0'
- container: 'node:16.0.0'
node_api_target: '21.2.0'
- container: 'node:16.0.0'
node_api_target: '22.0.0'
node_api_target: ['18.0.0', '20.0.0', '21.2.0', '22.0.0', '23.0.0']
container: ${{ matrix.container }}
steps:
- name: Checkout
Expand All @@ -43,14 +36,7 @@ jobs:
fail-fast: false
matrix:
container: ['node:16.0.0']
node_api_target: ['18.0.0']
include:
- container: 'node:16.0.0'
node_api_target: '20.0.0'
- container: 'node:16.0.0'
node_api_target: '21.2.0'
- container: 'node:16.0.0'
node_api_target: '22.0.0'
node_api_target: ['18.0.0', '20.0.0', '21.2.0', '22.0.0', '23.0.0']
container: ${{ matrix.container }}
steps:
- name: Checkout
Expand All @@ -71,7 +57,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-2019, macos-12]
node_api_target: ['18.0.0', '20.0.0', '21.2.0', '22.0.0']
node_api_target: ['18.0.0', '20.0.0', '21.2.0', '22.0.0', '23.0.0']
include:
- os: macos-12
python_version: '3.11'
Expand Down Expand Up @@ -135,7 +121,7 @@ jobs:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest']
nodejs: ['18', '20', '21', '22']
nodejs: ['18', '20', '21', '22', '23']
include:
- os: 'macos-latest'
python_version: '3.11'
Expand All @@ -147,6 +133,8 @@ jobs:
nodejs: '21.7.2'
- os: 'windows-2019'
nodejs: '22.10.0'
- os: 'windows-2019'
nodejs: '23.0.0'
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -172,7 +160,7 @@ jobs:
fail-fast: false
matrix:
os: ['ARM64']
nodejs: ['18', '20', '21', '22']
nodejs: ['18', '20', '21', '22', '23']
container: node:${{ matrix.nodejs }}
steps:
- name: Checkout
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ WORKDIR /splunk-otel-js
COPY . .
RUN npm install
RUN npm run compile
RUN npm run prebuild:os '14.0.0' '15.0.0' '16.0.0' '17.0.1' '18.0.0'
RUN npm run prebuild:os '18.0.0' '20.0.0' '21.2.0' '22.0.0'
RUN npm pack && tar xf splunk-otel-$(npm view @splunk/otel version).tgz
RUN npm prune --omit=dev && cp -r node_modules/ package

Expand All @@ -13,7 +13,7 @@ WORKDIR /splunk-otel-js
COPY . .
RUN npm install
RUN npm run compile
RUN npm run prebuild:os '14.0.0' '15.0.0' '16.0.0' '17.0.1' '18.0.0'
RUN npm run prebuild:os '18.0.0' '20.0.0' '21.2.0' '22.0.0'
RUN npm pack && tar xf splunk-otel-$(npm view @splunk/otel version).tgz
RUN npm prune --omit=dev && cp -r node_modules/ package

Expand All @@ -22,7 +22,7 @@ WORKDIR /splunk-otel-js
COPY . .
RUN npm install
RUN npm run compile
RUN npm run prebuild:os '14.0.0' '15.0.0' '16.0.0' '17.0.1' '18.0.0'
RUN npm run prebuild:os '18.0.0' '20.0.0' '21.2.0' '22.0.0'
RUN npm pack && tar xf splunk-otel-$(npm view @splunk/otel version).tgz
RUN npm prune --omit=dev && cp -r node_modules/ package

Expand Down
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ The Splunk Distribution of [OpenTelemetry JS](https://github.com/open-telemetry/
This distribution comes with the following defaults:

- [W3C tracecontext and baggage propagation](https://www.w3.org/TR/trace-context)
- [OTLP exporter](https://www.npmjs.com/package/@opentelemetry/exporter-trace-otlp-grpc)
configured to send spans to a locally running OpenTelemetry Collector over gRPC
- [OTLP exporter](https://www.npmjs.com/package/@opentelemetry/exporter-trace-otlp-proto) configured to send spans to a locally running OpenTelemetry Collector over HTTP.
- Many bundled [instrumentations](#default-instrumentation-packages)

If you're using the SignalFx Tracing Library for Node and want to migrate to the Splunk Distribution of OpenTelemetry Node, see [Migrate from the SignalFx Tracing Library for NodeJS](https://quickdraw.splunk.com/redirect/?product=Observability&version=current&location=nodejs.application.migrate) in the official documentation.
Expand Down Expand Up @@ -82,7 +81,7 @@ You can find more instrumentation packages in the [OpenTelemetry Registry](https

For troubleshooting issues with the Splunk Distribution of OpenTelemetry JS, see [Troubleshoot Node.js instrumentation for Splunk Observability Cloud](https://quickdraw.splunk.com/redirect/?product=Observability&version=current&location=nodejs.application.tshoot) in the official documentation.

> Examples and developer documentation for version 1.x is available at [/tree/1.x](https://github.com/signalfx/splunk-otel-js/tree/1.x).
> Examples and developer documentation for version 2.x is available at [/tree/2.x](https://github.com/signalfx/splunk-otel-js/tree/2.x).
# License

Expand Down
2 changes: 0 additions & 2 deletions RELEASING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,3 @@ Once the PR is approved, you need to merge it. The rest of the process is automa
Go to the internal Splunk mirror of this repository and verify that the pipeline job for your new version was successful.

Go to [https://www.npmjs.com/package/@splunk/otel](https://www.npmjs.com/package/@splunk/otel) and verify the new package was published. It may take a few minutes for the npmjs.com web interface to reflect the new package but it should be installable instantly.

Navigate to all `examples/*`, install dependencies and manually verify that the examples are working as expected per README. `@splunk/otel` version in package.json in `examples/*` is updated while [generating changelog](#step-2).
8 changes: 5 additions & 3 deletions docs/advanced-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ This distribution supports all the configuration options supported by the compon
| `OTEL_ATTRIBUTE_COUNT_LIMIT` | | Stable | Maximum allowed span attribute count
| `OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT` | `12000`\* | Stable | Maximum allowed attribute value size
| `OTEL_EXPORTER_OTLP_ENDPOINT`<br>`endpoint` | `http://localhost:4318` | Stable | The OTLP endpoint to export to.
| `OTEL_LOG_LEVEL` | | Stable | Log level to use in diagnostics logging. **Does not set the logger.**
| `OTEL_LOG_LEVEL` | | Stable | Log level to use in diagnostics logging.
| `OTEL_PROPAGATORS`<br>`tracing.propagators` | `tracecontext,baggage` | Stable | Comma-delimited list of propagators to use. Valid keys: `baggage`, `tracecontext`, `b3multi`, `b3`.
| `OTEL_RESOURCE_ATTRIBUTES` | | Stable | Comma-separated list of resource attributes added to every reported span. <details><summary>Example</summary>`key1=val1,key2=val2`</details>
| `OTEL_SERVICE_NAME`<br>`serviceName` | `unnamed-node-service` | Stable | The service name of this Node service.
Expand All @@ -65,6 +65,7 @@ This distribution supports all the configuration options supported by the compon
| `OTEL_SPAN_EVENT_COUNT_LIMIT` | `128` | Stable |
| `OTEL_SPAN_LINK_COUNT_LIMIT` | `1000`\* | Stable |
| `OTEL_TRACES_EXPORTER`<br>`tracing.spanExporterFactory` | `otlp` | Stable | Chooses the trace exporters. Shortcut for setting `spanExporterFactory`. Comma-delimited list of exporters. Currently supported values: `otlp`, `console`, `none`.
| `OTEL_EXPORTER_OTLP_TRACES_PROTOCOL` | `http/protobuf` | Stable | Metric exporter protocol. Supported values: `http/protobuf`, `grpc`.
| `OTEL_TRACES_SAMPLER` | `parentbased_always_on` | Stable | Sampler to be used for traces. See [Sampling](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#sampling)
| `OTEL_TRACES_SAMPLER_ARG` | | Stable | String value to be used as the sampler argument. Only be used if OTEL_TRACES_SAMPLER is set.
| `SPLUNK_ACCESS_TOKEN`<br>`accessToken` | | Stable | The optional access token for exporting signal data directly to SignalFx API.
Expand All @@ -78,8 +79,6 @@ This distribution supports all the configuration options supported by the compon

The following config options can be set by passing them as tracing arguments to `start()`.

- `tracing.tracerConfig`: A JS object that is merged into the default tracer config replacing any existing keys. It's passed to the tracer provider during initialization. This can be used to customize the tracer provider or tracer. Must satisfy [`TracerConfig` interface](https://github.com/open-telemetry/opentelemetry-js/blob/71ba83a0dc51118e08e3148c788b81fe711003e7/packages/opentelemetry-tracing/src/types.ts#L26)

- `tracing.resourceFactory`: A function that is invoked with the default resource detected from the environment. Can be used to change the detected attributes or return a completely new resource.

- `tracing.spanExporterFactory`: A function that accepts the tracing options. Returns a new instance of SpanExporter. When set, this function is used to create a new exporter and the returned exporter will be used in the pipeline.
Expand All @@ -92,6 +91,9 @@ The following config options can be set by passing them as tracing arguments to

- `tracing.captureHttpRequestUriParams`: Either a list of keys (case-sensitive) of HTTP query parameters to capture or a function that gets invoked with the current span and query parameters to set a custom span attribute. When using the former, parameters are set as span attributes as `http.request.param.${key}`. Attribute keys are normalized at capture time, meaning `.` is replaced with `_` to avoid any attribute namespacing issues.

- `tracing.tracerConfig`: An object that is merged into the default tracer config replacing any existing keys. It's passed to the tracer provider during initialization. This can be used to customize the tracer provider or tracer. Must satisfy [`TracerConfig` interface](https://open-telemetry.github.io/opentelemetry-js/interfaces/_opentelemetry_sdk_trace_base.TracerConfig.html)


### Metrics

| Environment variable<br>``start()`` argument | Default value | Support | Notes
Expand Down
2 changes: 1 addition & 1 deletion examples/mixed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This example showcases a more extensive integration with OpenTelemetry(OTel):
2. manual instrumentation: [index.js](./index.js) manually creates spans for custom "work",
3. log injection: the example is using a logging library `pino` for structured logging, `trace_id` and `span_id` properties are added to every log line automatically.

By default it requires OTel Collector to be running with OTLP reciever open on `localhost:4317`.
By default it requires OTel Collector to be running with OTLP reciever open on `localhost:4318`.

```shell
# Exposing ports for OTLP/gRPC and OTLP/HTTP from collector
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@splunk/otel",
"version": "2.13.0",
"version": "3.0.0",
"description": "The Splunk distribution of OpenTelemetry Node Instrumentation provides a Node agent that automatically instruments your Node application to capture and report distributed traces to Splunk APM.",
"repository": "[email protected]:signalfx/splunk-otel-js.git",
"author": "Splunk <[email protected]>",
Expand Down Expand Up @@ -37,7 +37,7 @@
"stats"
],
"engines": {
"node": ">=14"
"node": ">=18"
},
"files": [
"binding.gyp",
Expand Down
1 change: 0 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export type ResourceFactory = (resource: Resource) => Resource;

export type EnvVarKey =
| 'OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT'
| 'OTEL_BSP_SCHEDULE_DELAY'
| 'OTEL_EXPORTER_OTLP_CERTIFICATE'
| 'OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE'
| 'OTEL_EXPORTER_OTLP_CLIENT_KEY'
Expand Down
14 changes: 7 additions & 7 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ export function listEnvVars() {
property: '',
description:
'The delay in milliseconds between 2 consecutive bath span processor exports.',
default: '500',
default: '5000',
type: 'number',
category: 'instrumentation',
},
Expand Down Expand Up @@ -283,7 +283,7 @@ export function listEnvVars() {
name: 'OTEL_EXPORTER_OTLP_ENDPOINT',
property: 'endpoint',
description: 'The OTLP endpoint to export to.',
default: 'http://localhost:4317',
default: 'http://localhost:4318',
type: 'string',
category: 'exporter',
},
Expand All @@ -292,7 +292,7 @@ export function listEnvVars() {
property: '',
description:
'Chooses the trace exporter protocol. Allowed values are grpc and http/protobuf',
default: 'grpc',
default: 'http/protobuf',
type: 'string',
category: 'exporter',
},
Expand All @@ -301,23 +301,23 @@ export function listEnvVars() {
property: 'metrics.metricReaderFactory',
description:
'Chooses the metric exporter protocol. Allowed values are grpc and http/protobuf',
default: 'grpc',
default: 'http/protobuf',
type: 'string',
category: 'exporter',
},
{
name: 'OTEL_EXPORTER_OTLP_PROTOCOL',
property: '',
description: 'The protocol to use for OTLP exports.',
default: 'grpc',
default: 'http/protobuf',
type: 'string',
category: 'exporter',
},
{
name: 'OTEL_EXPORTER_OTLP_TRACES_ENDPOINT',
property: '',
description: 'The traces OTLP endpoint to export to.',
default: 'http://localhost:4317',
default: 'http://localhost:4318',
type: 'string',
category: 'exporter',
},
Expand Down Expand Up @@ -439,7 +439,7 @@ export function listEnvVars() {
name: 'SPLUNK_PROFILER_LOGS_ENDPOINT',
property: 'profiling.endpoint',
description: 'The collector endpoint for profiler logs.',
default: 'http://localhost:4317',
default: 'http://localhost:4318',
type: 'string',
category: 'profiler',
},
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
* limitations under the License.
*/

export const VERSION = '2.13.0';
export const VERSION = '3.0.0';

0 comments on commit 2edfa02

Please sign in to comment.