Skip to content

Commit

Permalink
Merge pull request #4887 from dynatrace-oss-contrib/next-main-2024-07-30
Browse files Browse the repository at this point in the history
[next] merge latest changes from `main`
  • Loading branch information
pichlermarc authored Jul 31, 2024
2 parents 55f15e9 + eee78fa commit bb9caaf
Show file tree
Hide file tree
Showing 523 changed files with 22,102 additions and 29,020 deletions.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ body:
const { getNodeAutoInstrumentations } = require('@opentelemetry/auto-instrumentations-node');
const { ConsoleSpanExporter } = require('@opentelemetry/sdk-trace-base');
const { Resource } = require('@opentelemetry/resources');
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');
const { SEMRESATTRS_SERVICE_NAME } = require('@opentelemetry/semantic-conventions');
// configure the SDK to export telemetry data to the console
// enable all auto-instrumentations from the meta package
const traceExporter = new ConsoleSpanExporter();
const sdk = new opentelemetry.NodeSDK({
resource: new Resource({
[SemanticResourceAttributes.SERVICE_NAME]: 'my-service',
[SEMRESATTRS_SERVICE_NAME]: 'my-service',
}),
traceExporter,
instrumentations: [getNodeAutoInstrumentations()]
Expand Down
26 changes: 13 additions & 13 deletions .github/repository-settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ No changes

## Collaborators and Teams

* There is currently no `javascript-triagers` role
* `javascript-maintainers` has `Admin` permission
- There is currently no `javascript-triagers` role
- `javascript-maintainers` has `Admin` permission

## Branches

## Branch protection rules

### `main`

* Uncheck "Restrict who can push to matching branches"
* Check "Require merge queue"
* Build concurrency: 5
* Minimum pull requests to merge: 1 or after 5 minutes
* Maximum pull requests to merge: 5
* Check "Only merge non-failing pull requests"
* Status check timeout: 60 minutes
- Uncheck "Restrict who can push to matching branches"
- Check "Require merge queue"
- Build concurrency: 5
- Minimum pull requests to merge: 1 or after 5 minutes
- Maximum pull requests to merge: 5
- Check "Only merge non-failing pull requests"
- Status check timeout: 60 minutes

### `dependabot/**/**`

Expand All @@ -36,10 +36,10 @@ Our dependencies are managed by a bot which creates PRs from a fork.

This is a special branch which we use to publish the automatically generated docs.
It is exempt from most protections.
* "Allow force pushes from everyone" (requires write permission)

- "Allow force pushes from everyone" (requires write permission)

## Pages

* Source: Deploy from a branch
* Branch: `gh-pages` `/ (root)`
- Source: Deploy from a branch
- Branch: `gh-pages` `/ (root)`
17 changes: 1 addition & 16 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,29 +21,14 @@ jobs:
package-lock.json
node-version: '20'

- name: Lint changelog file
uses: avto-dev/markdown-lint@v1
with:
# Commenting due to
# https://github.com/avto-dev/markdown-lint/blob/aab9be9823fcd706f6da3e6ad6c64874c23fbd4c/lint/rules/changelog.js#L51-L71
# TODO: adhere to, or overwrite above rule and uncomment rules
# rules: "/lint/rules/changelog.js"
config: "/lint/config/changelog.yml"
args: "./CHANGELOG.md"

- name: Lint markdown files
uses: avto-dev/markdown-lint@v1
with:
args: "./**/*.md"
ignore: './CHANGELOG.md ./experimental/packages/opentelemetry-exporter-metrics-otlp-grpc/protos ./experimental/packages/opentelemetry-exporter-metrics-otlp-proto/protos ./packages/exporter-trace-otlp-grpc/protos ./packages/exporter-trace-otlp-proto/protos'

- name: Bootstrap
run: npm ci

- name: Lint
run: |
npm run lint
npm run lint:examples
npm run lint:markdown
- name: Lint doc files
run: |
Expand Down
79 changes: 79 additions & 0 deletions .github/workflows/sbom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: SBOM
on:
release:
types: [published]

permissions: read-all

jobs:
generate-sboms:
runs-on: ubuntu-latest
env:
NPM_CONFIG_UNSAFE_PERM: true
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 20

- run: npm install -g npm@latest

- name: Bootstrap
run: npm ci

- name: Generate SBOM for core packages
if: ${{ ! startsWith(github.ref, 'refs/tags/experimental') && ! startsWith(github.ref, 'refs/tags/api') }}
run: |
for dir in $(find packages -mindepth 1 -maxdepth 1 -type d)
do
dir_name=$(basename "$dir")
echo "Generating SBOM for $dir_name"
npm sbom --sbom-format=spdx --legacy-peer-deps --workspace ${dir} > "opentelemetry-js_${dir_name}.spdx.json"
done
- name: Generate SBOM for the API package
if: startsWith(github.ref, 'refs/tags/api/')
run: |
npm sbom --sbom-format=spdx --legacy-peer-deps --workspace api > opentelemetry-js_api.spdx.json
- name: Generate SBOMs for experimental packages
if: startsWith(github.ref, 'refs/tags/experimental/')
run: |
for dir in $(find experimental/packages -mindepth 1 -maxdepth 1 -type d)
do
dir_name=$(basename "$dir")
echo "Generating SBOM for $dir_name"
npm sbom --sbom-format=spdx --legacy-peer-deps --workspace ${dir} > "opentelemetry-js_${dir_name}.spdx.json"
done
- name: Zip all SBOM files
run: |
zip sbom.zip *.spdx.json
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: SBOM.zip
path: ./sbom.zip

add-release-artifact:
needs: generate-sboms
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifact from generate-sboms
uses: actions/download-artifact@v4
with:
name: SBOM.zip
- name: Upload release asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./sbom.zip
asset_name: SBOM.zip
asset_content_type: application/zip
5 changes: 2 additions & 3 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
node_version:
- "18"
- "20"
- "22"
runs-on: ubuntu-latest
env:
NPM_CONFIG_UNSAFE_PERM: true
Expand Down Expand Up @@ -130,8 +131,6 @@ jobs:
- "8"
- "10"
- "12"
- "14"
- "16"
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -148,7 +147,7 @@ jobs:
working-directory: ./api
run: |
npm install --ignore-scripts
npm install @types/mocha@^7 mocha@^7 ts-loader@^8 ts-mocha@^8
npm install @types/mocha@^7 mocha@^7 ts-loader@^8
node ../scripts/version-update.js
npx tsc --build tsconfig.json tsconfig.esm.json
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,6 @@ package.json.lerna_backup

# non-aggregated benchmark results
.benchmark-results.txt

# release notes for release creation
.tmp/
7 changes: 2 additions & 5 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "experimental/packages/otlp-grpc-exporter-base/protos"]
path = experimental/packages/otlp-grpc-exporter-base/protos
url = https://github.com/open-telemetry/opentelemetry-proto.git
[submodule "experimental/packages/otlp-proto-exporter-base/protos"]
path = experimental/packages/otlp-proto-exporter-base/protos
[submodule "experimental/packages/otlp-transformer/protos"]
path = experimental/packages/otlp-transformer/protos
url = https://github.com/open-telemetry/opentelemetry-proto.git
15 changes: 15 additions & 0 deletions .markdownlint-cli2.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// https://github.com/DavidAnson/markdownlint-cli2#markdownlint-cli2jsonc
{
"config": {
// https://github.com/DavidAnson/markdownlint/blob/main/README.md#rules--aliases
"MD013": false,
"MD024": false,
"MD033": false,
"MD041": false,
"MD026": false,
"MD004": { "style": "dash" } // ul-style
},
"gitignore": true,
"noBanner": true,
"noProgress": true
}
7 changes: 0 additions & 7 deletions .markdownlint.json

This file was deleted.

1 change: 1 addition & 0 deletions .mocharc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require: 'ts-node/register'
82 changes: 80 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<!-- markdownlint-disable MD004 -->
# CHANGELOG

All notable changes to this project will be documented in this file.
Expand All @@ -15,14 +16,90 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/

### :rocket: (Enhancement)

* feat: include instrumentation scope info in console span and log record exporters [#4848](https://github.com/open-telemetry/opentelemetry-js/pull/4848) @blumamir

### :bug: (Bug Fix)

* fix(sdk-metrics): increase the depth of the output to the console such that objects in the metric are printed fully to the console [#4522](https://github.com/open-telemetry/opentelemetry-js/pull/4522) @JacksonWeber
* fix(sdk-node): avoid spurious diag errors for unknown OTEL_NODE_RESOURCE_DETECTORS values [#4879](https://github.com/open-telemetry/opentelemetry-js/pull/4879) @trentm
* deps(opentelemetry-instrumentation): Bump `shimmer` types to 1.2.0 [#4865](https://github.com/open-telemetry/opentelemetry-js/pull/4865) @lforst

### :books: (Refine Doc)

### :house: (Internal)

* refactor: Simplify the code for the `getEnv` function [#4799](https://github.com/open-telemetry/opentelemetry-js/pull/4799) @danstarns

## 1.25.1

### :books: (Refine Doc)

* refactor(examples): added usage of @opentelemetry/semantic-conventions and @opentelemetry/resources to the examples in examples/opentelemetry-web for maintaining consistency across all examples. [#4764](https://github.com/open-telemetry/opentelemetry-js/pull/4764) @Zen-cronic

### :house: (Internal)

* refactor(context-zone-peer-dep): use explicit exports [#4785](https://github.com/open-telemetry/opentelemetry-js/pull/4787) @pichlermarc
* refactor(context-async-hooks): use explicit exports [#4785](https://github.com/open-telemetry/opentelemetry-js/pull/4786) @pichlermarc

## 1.25.0

### :rocket: (Enhancement)

* feat: support node 22 [#4666](https://github.com/open-telemetry/opentelemetry-js/pull/4666) @dyladan
* feat(context-zone*): support zone.js 0.12.x [#4376](https://github.com/open-telemetry/opentelemetry-js/pull/4736) @maldago
* refactor(core): Use tree-shakeable string constants for semconv [#4739](https://github.com/open-telemetry/opentelemetry-js/pull/4739) @JohannesHuster
* refactor(shim-opentracing): Use tree-shakeable string constants for semconv [#4746](https://github.com/open-telemetry/opentelemetry-js/pull/4746) @JohannesHuster
* refactor(sdk-trace-web): Use tree-shakeable string constants for semconv [#4747](https://github.com/open-telemetry/opentelemetry-js/pull/4747) @JohannesHuster
* refactor(sdk-trace-node): Use tree-shakeable string constants for semconv [#4748](https://github.com/open-telemetry/opentelemetry-js/pull/4748) @JohannesHuster
* refactor(sdk-trace-base): Use tree-shakeable string constants for semconv [#4749](https://github.com/open-telemetry/opentelemetry-js/pull/4749) @JohannesHuster
* refactor(resources): update deprecated semconv to use exported strings [#4755](https://github.com/open-telemetry/opentelemetry-js/pull/#4755) @JamieDanielson
* refactor(exporters): update deprecated semconv to use exported strings [#4756](https://github.com/open-telemetry/opentelemetry-js/pull/#4756) @JamieDanielson

### :books: (Refine Doc)

* refactor(examples): use new exported string constants for semconv in examples/esm-http-ts [#4758](https://github.com/open-telemetry/opentelemetry-js/pull/4758) @Zen-cronic
* refactor(examples): use new exported string constants for semconv in examples/basic-tracer-node [#4759](https://github.com/open-telemetry/opentelemetry-js/pull/4759#pull) @Zen-cronic
* refactor(examples): use new exported string constants for semconv in examples/http [#4750](https://github.com/open-telemetry/opentelemetry-js/pull/4750) @Zen-cronic
* refactor(examples): use new exported string constants for semconv in examples/grpc-js [#4760](https://github.com/open-telemetry/opentelemetry-js/pull/4760#pull) @Zen-cronic
* refactor(examples): use new exported string constants for semconv in examples/otlp-exporter-node [#4762](https://github.com/open-telemetry/opentelemetry-js/pull/4762) @Zen-cronic
* refactor(examples): use new exported string constants for semconv in examples/opentracing-shim [#4761](https://github.com/open-telemetry/opentelemetry-js/pull/4761) @Zen-cronic

## 1.24.1

### :bug: (Bug Fix)

* fix(core): align inconsistent behavior of `getEnv()` and `getEnvWithoutDefaults()` when a `process` polyfill is used [#4648](https://github.com/open-telemetry/opentelemetry-js/pull/4648) @pichlermarc
* `getEnvWithoutDefaults()` would use `process.env` if it was defined when running in a browser, while `getEnv()` would always use `_globalThis`. Now both use `_globalThis` when running in a browser.
* fix(resources): prevent circular import (resource -> detector -> resource -> ...) [#4653](https://github.com/open-telemetry/opentelemetry-js/pull/4653) @pichlermarc
* fixes a circular import warning which would appear in rollup when bundling `@opentelemetry/resources`
* fix(exporter-metrics-otlp-grpc): add explicit otlp-exporter-base dependency to exporter-metrics-otlp-grpc [#4678](https://github.com/open-telemetry/opentelemetry-js/pull/4678) @AkselAllas

## 1.24.0

### :rocket: (Enhancement)

* feat(sdk-trace-base): log resource attributes in ConsoleSpanExporter [#4605](https://github.com/open-telemetry/opentelemetry-js/pull/4605) @pichlermarc
* feat(propagator-aws-xray): moved AWS Xray propagator from contrib [4603](https://github.com/open-telemetry/opentelemetry-js/pull/4603) @martinkuba
* feat(resources): new experimental detector ServiceInstanceIdDetectorSync that sets the value for `service.instance.id` as random UUID. [#4608](https://github.com/open-telemetry/opentelemetry-js/pull/4608) @maryliag

### :bug: (Bug Fix)

* fix(sdk-trace-web): fix invalid timings in span events [#4486](https://github.com/open-telemetry/opentelemetry-js/pull/4486) @Abinet18
* fix(resources): ensure BrowserDetector does not think Node.js v21 is a browser [#4561](https://github.com/open-telemetry/opentelemetry-js/issues/4561) @trentm
* fix(core): align inconsistent behavior of `getEnv()` and `getEnvWithoutDefaults()` when a `process` polyfill is used [#4648](https://github.com/open-telemetry/opentelemetry-js/pull/4648) @pichlermarc
* `getEnvWithoutDefaults()` would use `process.env` if it was defined when running in a browser, while `getEnv()` would always use `_globalThis`. Now both use `_globalThis` when running in a browser.

## 1.23.0

### :rocket: (Enhancement)

* perf(sdk-trace-base): do not allocate arrays if resource has no pending async attributes [#4576](https://github.com/open-telemetry/opentelemetry-js/pull/4576) @Samuron
* feat(sdk-metrics): added experimental synchronous gauge to SDK [#4565](https://github.com/open-telemetry/opentelemetry-js/pull/4565) @clintonb
* this change will become user-facing in an upcoming release

### :bug: (Bug Fix)

* fix(sdk-metrics): increase the depth of the output to the console such that objects in the metric are printed fully to the console [#4522](https://github.com/open-telemetry/opentelemetry-js/pull/4522) @JacksonWeber

## 1.22.0

### :rocket: (Enhancement)
Expand All @@ -31,6 +108,7 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/
* feat(instrumentation): Make `init()` method public [#4418](https://github.com/open-telemetry/opentelemetry-js/pull/4418)
* feat(context-zone-peer-dep, context-zone): support zone.js 0.13.x, 0.14.x [#4469](https://github.com/open-telemetry/opentelemetry-js/pull/4469) @pichlermarc
* chore: Semantic Conventions export individual strings [4185](https://github.com/open-telemetry/opentelemetry-js/issues/4185)
* feat(sdk-trace-base): allow adding span links after span creation [#4536](https://github.com/open-telemetry/opentelemetry-js/pull/4536) @seemk

### :bug: (Bug Fix)

Expand Down Expand Up @@ -1882,7 +1960,7 @@ No changes
* `opentelemetry-api`, `opentelemetry-exporter-prometheus`, `opentelemetry-metrics`
* [#1137](https://github.com/open-telemetry/opentelemetry-js/pull/1137) Batch observer ([@obecny](https://github.com/obecny))
* `opentelemetry-exporter-collector`
* [#1256](https://github.com/open-telemetry/opentelemetry-js/pull/1256) feat: [Collector Metric Exporter][1/x] Rename CollectorExporter to CollectorTraceExporter ([@davidwitten](https://github.com/davidwitten))
* [#1256](https://github.com/open-telemetry/opentelemetry-js/pull/1256) feat: Collector Metric Exporter [1/x] Rename CollectorExporter to CollectorTraceExporter ([@davidwitten](https://github.com/davidwitten))

### :rocket: (Enhancement)

Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG_NEXT.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<!-- markdownlint-disable MD004 -->

## 2.0

### :boom: Breaking Change
Expand Down
9 changes: 8 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ An entry into `CHANGELOG.md` or `experimental/CHANGELOG.md` is required for the
- Changes to default settings
- New components being added

It is reasonable to omit an entry to the changelog under these circuimstances:
It is reasonable to omit an entry to the changelog under these circumstances:

- Updating test to remove flakiness or improve coverage
- Updates to the CI/CD process
Expand Down Expand Up @@ -247,6 +247,13 @@ cd packages/opentelemetry-module-name
npm run lint:fix
```

Similarly, Markdown files (such as README.md files) can be linted:

```sh
npm run lint:markdown
npm run lint:markdown:fix # can automatically fix some Markdown rules
```

### Generating docs

We use [typedoc](https://www.npmjs.com/package/typedoc) to generate the api documentation.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# OpenTelemetry JavaScript SDK 2.0

> [!WARNING]
> [!WARNING]
> You have found the working branch for the work in progress 2.0 SDK.
> If you are a user, you are probably looking for the 1.x SDK on the main branch.
Loading

0 comments on commit bb9caaf

Please sign in to comment.