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

fix(sdk-metrics): InMemoryMetricExporter clear metrics after shutdown #5214

Open
wants to merge 44 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
699b919
fix(sdk-node): fix typo `FomEnv` → `FromEnv` (#5146)
Delapouite Nov 13, 2024
4afc190
fix(sdk-trace-base): pass BatchSpanProcessor#forceFlush() errors on v…
pichlermarc Nov 14, 2024
56a0308
fix(sdk-trace): performance.now() may return the same value for conse…
dyladan Nov 14, 2024
c78a02f
Track request body size in XHR and Fetch instrumentations (#4706)
MustafaHaddara Nov 14, 2024
d51fa95
test(instrumentation): skip unwrap tests for esm (#5153)
pichlermarc Nov 14, 2024
5bf7e89
chore(deps): update dependency chromedriver to v131 (#5156)
renovate-bot Nov 14, 2024
4446508
chore(config): migrate renovate config (#5158)
renovate-bot Nov 14, 2024
0c268e7
feat: improve bug template (#5086)
pichlermarc Nov 15, 2024
363c003
fix(semantic-conventions): update deprecated messages for some old co…
trentm Nov 15, 2024
1aa158b
chore(deps): update babel monorepo (#5161)
renovate-bot Nov 15, 2024
6096f72
chore(deps): update dependency mocha to v10.8.2 (#5162)
renovate-bot Nov 15, 2024
23a47d3
chore(deps): update dependency webpack to v5.96.1 (#5164)
renovate-bot Nov 15, 2024
473bb5e
chore(deps): lock file maintenance (#5157)
renovate-bot Nov 15, 2024
09a630d
chore(deps): lock file maintenance (#5171)
renovate-bot Nov 18, 2024
d3630af
doc: document breaking change in 0.54 (#5169)
dyladan Nov 18, 2024
9e4d36c
fix(otlp-exporter-base): fix unhandled error when writing to destroye…
pichlermarc Nov 18, 2024
4b1ad3f
chore: prepare next release (#5141)
opentelemetrybot Nov 18, 2024
1370810
chore(deps): update codecov/codecov-action action to v5 (#5170)
renovate-bot Nov 18, 2024
7e98761
feat(exporters)!: collapse base classes into one (#5031)
pichlermarc Nov 19, 2024
2a5e0d8
chore(deps): update dependency markdownlint-cli2 to v0.15.0 (#5176)
renovate-bot Nov 19, 2024
8ad1304
chore(deps): update dependency linkinator to v6.1.2 (#5175)
renovate-bot Nov 19, 2024
0ee9a27
chore(deps): update dependency gh-pages to v6.2.0 (#5174)
renovate-bot Nov 19, 2024
b7c03d2
chore(semantic-conventions): docs on entry-points, deprecations; impr…
trentm Nov 20, 2024
91b9abd
feat(otlp-transformer)!: accept ResourceMetrics instead of ResoruceMe…
pichlermarc Nov 20, 2024
a834861
feat(sdk-metrics): add aggregation cardinality limit (#5128)
povilasv Nov 20, 2024
dd5b5fb
feat(otlp-exporter-base): internally accept a http header provider fu…
pichlermarc Nov 20, 2024
ef30dbc
docs: fix changelog formatting (#5185)
pichlermarc Nov 20, 2024
d8bc6b2
feat(semconv): update semantic conventions to 1.28.0 (#5181)
trentm Nov 20, 2024
e97cc2e
chore: prepare next release (#5186)
opentelemetrybot Nov 20, 2024
ef80821
chore(deps): update all patch versions (#5189)
renovate-bot Nov 21, 2024
1e312c2
refactor(otlp-exporter-base): don't create blob before sending xhr (#…
pichlermarc Nov 25, 2024
3a20ed6
chore(deps): lock file maintenance (#5194)
renovate-bot Nov 25, 2024
e250a0f
chore: update prettier to 3.3.3 (#5195)
pichlermarc Nov 25, 2024
556eecf
chore(otlp-exporter-*-proto): clean up tests (#5199)
pichlermarc Nov 26, 2024
e35f3d6
chore(exporter-otlp-*-http): clean up tests (#5198)
pichlermarc Nov 26, 2024
c9fa209
chore(otlp-exporter-*-grpc): clean up tests (#5196)
pichlermarc Nov 26, 2024
e80879e
fix(deps): update dependency axios to v1.7.8 (#5202)
renovate-bot Nov 26, 2024
561f8ad
fix(docs): broken link for community contribution lifecycle and proce…
trivikr Nov 27, 2024
3bf1284
feat(otlp-exporter-base): add http response body to exporter error (#…
pichlermarc Nov 27, 2024
5ad0aa5
chore: replace deprecated String.prototype.substr() with substring() …
trivikr Nov 27, 2024
1249e34
refactor(otlp-exporter-base): remove exports that were meant to be in…
pichlermarc Nov 27, 2024
17bf0d9
chore(deps): update dependency @bufbuild/buf to v1.47.2 (#5210)
renovate-bot Nov 27, 2024
fd7f2d9
fix(deps): update dependency zone.js to v0.15.0 (#5213)
renovate-bot Nov 27, 2024
c91f1d7
fix(sdk-metrics): InMemoryMetricExporter clear metrics after shutdown
paper2 Nov 27, 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
74 changes: 58 additions & 16 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,61 @@ body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
Please make sure to fill out the entire form below,
providing as much context as you can in order to help us
triage and track down your bug as quickly as possible.
> [!IMPORTANT]
> **Please read all parts of this form carefully.** By following the instructions carefully, you ensure that we
> can get started fixing your bug, instead of being stuck at trying to reproduce your issue. Please provide
> all requested information, even if you think it does not apply to your problem.
>
> **If you use a third-party package that re-distributes OpenTelemetry, open the bug ticket with that third party unless you can provide steps to reproduce this with pure OpenTelemetry.**
> Digging into third-party distributions of OpenTelemetry is not in scope for this project.

Before filing a bug, please be sure you have searched through
[existing bugs](https://github.com/open-telemetry/opentelemetry-js/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Abug)
to see if your bug is already addressed.

If your bug is related to an instrumentation or plugin in [opentelemetry-js-contrib](https://github.com/open-telemetry/opentelemetry-js-contrib)
please be sure to file it there.
Before filing a bug, please be sure you have searched through [existing open bugs](https://github.com/open-telemetry/opentelemetry-js/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Abug)
to see if this bug has already been filed.
- type: markdown
attributes:
value: |
## Bug Reproduction
- type: textarea
attributes:
label: What happened?
description: Please provide as much detail as you reasonably can.
description: |
> [!IMPORTANT]
> **Please provide as much detail as you reasonably can.**
> We all know the complexities of developing with JavaScript/TypeScript. **Be specific** about your setup and **DO NOT** assume that the person handling your bug report knows how to use your specific combination of tooling. Always provide build instructions and config files.
value: |
## Steps to Reproduce

<!--
The most effective way to solve a bug is to provide a link to a reproducer repository. It is extremely difficult to exactly reproduce problems
and doing so can take multiple hours for us. You know your tooling and setup and we know OpenTelemetry JavaScript internals.
Let's help each other! :)
-->
## Expected Result

## Actual Result

## Additional Details
<!--
Anything you can think of that will help us reproduce and understand your problem:
- details about the behavior of the bug
- code to reproduce, if not provided via a repository above (including setting up any frameworks you may be using, we likely don't use the same tech-stack that you're using on the daily)
- which tooling you use and how you're using it
- config files for your tooling (typescript, bundlers, ...)
- how you run your code (example: `node -r otel.js ./index.js`).
- which module type you are you using (`module` or `commonjs`)
-->


validations:
required: true
- type: textarea
attributes:
label: OpenTelemetry Setup Code
description: Please provide the code you use to set up OpenTelemetry
description: |
Please provide the code you use to set up OpenTelemetry.
If you use `@opentelemetry/auto-instrumentations-node/register`, please state so here.
You may omit this step if you have provided a reproducer repository.
placeholder: | # This comes from our README.md
// tracing.js
// otel.js

'use strict'

Expand Down Expand Up @@ -75,13 +98,15 @@ body:
- type: textarea
attributes:
label: package.json
description: If possible, please provide your full package.json. If not, please provide at least your list of dependencies and their versions, especially OpenTelemetry versions.
description: |
Please provide your the full package.json needed to reproduce the issue.
You may omit this step if you provided a reproducer repository.
render: "JSON"
placeholder: |
{
"name": "my-app",
"scripts": {
"start": "node -r tracing.js app.js"
"start": "node -r otel.js app.js"
},
"dependencies": {
"@opentelemetry/api": "^1.3.0",
Expand All @@ -95,3 +120,20 @@ body:
description: |
Please copy and paste any relevant log output.
render: shell
- type: markdown
attributes:
value: |
## System Details
System Details help us when we cannot reproduce your problem with the information provided above. Sometimes bugs only surface on specific platforms and runtime versions.
- type: textarea
attributes:
label: Operating System and Version
placeholder: Ubuntu 24.04, Windows 11 Build 26100.2033, macOS 15.0.1
validations:
required: false
- type: textarea
attributes:
label: Runtime and Version
placeholder: Node.js v20.12.1, Node.js v18.18.2, Firefox 130, Chrome 132, ...
validations:
required: false
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Before creating a pull request, please make sure:
- You have read the guide for contributing
- See https://github.com/open-telemetry/opentelemetry-js/blob/main/CONTRIBUTING.md
- You signed all your commits (otherwise we won't be able to merge the PR)
- See https://github.com/open-telemetry/community/blob/master/CONTRIBUTING.md#sign-the-cla
- See https://github.com/open-telemetry/community/blob/main/guides/contributor#sign-the-cla
- You added unit tests for the new functionality
- You mention in the PR description which issue it is addressing, e.g. "Fixes #xxx". This will auto-close
the issue that your PR fixes (if such)
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: Unit tests
run: npm run test
- name: Report Coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
- name: Unit tests
run: npm run test:browser
- name: Report Coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:
- name: Unit tests
run: npm run test:webworker
- name: Report Coverage
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
Expand Down
20 changes: 16 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,19 @@ For semantic convention package changes, see the [semconv CHANGELOG](packages/se

### :boom: Breaking Change

* feat(sdk-metrics): Add support for aggregation cardinality limit with a default limit of 2000. This limit can be customized via views [#5182](https://github.com/open-telemetry/opentelemetry-js/pull/5128)
* fix(sdk-metrics): InMemoryMetricExporter clear metrics after shutdown to align with other exporters [#5131](https://github.com/open-telemetry/opentelemetry-js/issues/5131) @paper2

### :rocket: (Enhancement)

### :bug: (Bug Fix)

### :books: (Refine Doc)

### :house: (Internal)

## 1.28.0

### :rocket: (Enhancement)

* feat(sdk-metrics, sdk-trace): add `mergeResourceWithDefaults` flag, which allows opting-out of resources getting merged with the default resource [#4617](https://github.com/open-telemetry/opentelemetry-js/pull/4617)
Expand All @@ -22,10 +35,9 @@ For semantic convention package changes, see the [semconv CHANGELOG](packages/se
### :bug: (Bug Fix)

* fix(sdk-metrics): await exports in `PeriodicExportingMetricReader` when async resource attributes have not yet settled [#5119](https://github.com/open-telemetry/opentelemetry-js/pull/5119/) @pichlermarc

### :books: (Refine Doc)

### :house: (Internal)
* fix(sdk-trace): performance.now() may return the same value for consecutive calls [#5150](https://github.com/open-telemetry/opentelemetry-js/pull/5150) @dyladan
* fix(sdk-trace-base): pass BatchSpanProcessor#forceFlush() errors on visibilitychange/pagehide to globalErrorHandler [#5143](https://github.com/open-telemetry/opentelemetry-js/pull/5143) @pichlermarc
* fixes a bug where switching browser tabs with a failing exporter would cause an unhandled error

## 1.27.0

Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Reporting bugs is an important contribution. Please make sure to include:
### Before you start

Please read project contribution
[guide](https://github.com/open-telemetry/community/blob/master/CONTRIBUTING.md)
[guide](https://github.com/open-telemetry/community/blob/main/guides/contributor)
for general practices for OpenTelemetry project.

#### Conventional commit
Expand Down Expand Up @@ -145,7 +145,7 @@ git merge upstream/main

Remember to always work in a branch of your local copy, as you might otherwise have to contend with conflicts in main.

Please also see [GitHub workflow](https://github.com/open-telemetry/community/blob/master/CONTRIBUTING.md#github-workflow) section of general project contributing guide.
Please also see [GitHub workflow](https://github.com/open-telemetry/community/blob/main/guides/contributor/processes.md#github-workflow) section of general project contributing guide.

## Development

Expand Down
6 changes: 3 additions & 3 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"access": "public"
},
"devDependencies": {
"@types/mocha": "10.0.8",
"@types/mocha": "10.0.10",
"@types/node": "18.6.5",
"@types/sinon": "17.0.3",
"@types/webpack": "5.28.5",
Expand All @@ -94,13 +94,13 @@
"karma-webpack": "5.0.1",
"lerna": "6.6.2",
"memfs": "3.5.3",
"mocha": "10.7.3",
"mocha": "10.8.2",
"nyc": "15.1.0",
"sinon": "15.1.2",
"ts-loader": "9.5.1",
"typescript": "4.4.4",
"unionfs": "4.5.4",
"webpack": "5.94.0"
"webpack": "5.96.1"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/api",
"sideEffects": false
Expand Down
12 changes: 6 additions & 6 deletions api/src/platform/browser/globalThis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export const _globalThis: typeof globalThis =
typeof globalThis === 'object'
? globalThis
: typeof self === 'object'
? self
: typeof window === 'object'
? window
: typeof global === 'object'
? global
: ({} as typeof globalThis);
? self
: typeof window === 'object'
? window
: typeof global === 'object'
? global
: ({} as typeof globalThis);
16 changes: 8 additions & 8 deletions examples/esm-http-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "esm-http-ts",
"private": true,
"version": "0.54.2",
"version": "0.55.0",
"description": "Example of HTTP integration with OpenTelemetry using ESM and TypeScript",
"main": "build/index.js",
"type": "module",
Expand Down Expand Up @@ -32,12 +32,12 @@
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/",
"dependencies": {
"@opentelemetry/api": "1.9.0",
"@opentelemetry/exporter-trace-otlp-proto": "0.54.2",
"@opentelemetry/instrumentation": "0.54.2",
"@opentelemetry/instrumentation-http": "0.54.2",
"@opentelemetry/resources": "1.27.0",
"@opentelemetry/sdk-trace-base": "1.27.0",
"@opentelemetry/sdk-trace-node": "1.27.0",
"@opentelemetry/semantic-conventions": "1.27.0"
"@opentelemetry/exporter-trace-otlp-proto": "0.55.0",
"@opentelemetry/instrumentation": "0.55.0",
"@opentelemetry/instrumentation-http": "0.55.0",
"@opentelemetry/resources": "1.28.0",
"@opentelemetry/sdk-trace-base": "1.28.0",
"@opentelemetry/sdk-trace-node": "1.28.0",
"@opentelemetry/semantic-conventions": "1.28.0"
}
}
18 changes: 9 additions & 9 deletions examples/http/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "http-example",
"private": true,
"version": "0.54.2",
"version": "0.55.0",
"description": "Example of HTTP integration with OpenTelemetry",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -30,14 +30,14 @@
},
"dependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/exporter-jaeger": "1.27.0",
"@opentelemetry/exporter-zipkin": "1.27.0",
"@opentelemetry/instrumentation": "0.54.2",
"@opentelemetry/instrumentation-http": "0.54.2",
"@opentelemetry/resources": "1.27.0",
"@opentelemetry/sdk-trace-base": "1.27.0",
"@opentelemetry/sdk-trace-node": "1.27.0",
"@opentelemetry/semantic-conventions": "1.27.0"
"@opentelemetry/exporter-jaeger": "1.28.0",
"@opentelemetry/exporter-zipkin": "1.28.0",
"@opentelemetry/instrumentation": "0.55.0",
"@opentelemetry/instrumentation-http": "0.55.0",
"@opentelemetry/resources": "1.28.0",
"@opentelemetry/sdk-trace-base": "1.28.0",
"@opentelemetry/sdk-trace-node": "1.28.0",
"@opentelemetry/semantic-conventions": "1.28.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/http",
"devDependencies": {
Expand Down
18 changes: 9 additions & 9 deletions examples/https/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "https-example",
"private": true,
"version": "0.54.2",
"version": "0.55.0",
"description": "Example of HTTPs integration with OpenTelemetry",
"main": "build/src/index.js",
"types": "build/src/index.d.ts",
Expand Down Expand Up @@ -34,14 +34,14 @@
},
"dependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/exporter-jaeger": "1.27.0",
"@opentelemetry/exporter-zipkin": "1.27.0",
"@opentelemetry/instrumentation": "0.54.2",
"@opentelemetry/instrumentation-http": "0.54.2",
"@opentelemetry/resources": "1.27.0",
"@opentelemetry/sdk-trace-base": "1.27.0",
"@opentelemetry/sdk-trace-node": "1.27.0",
"@opentelemetry/semantic-conventions": "1.27.0"
"@opentelemetry/exporter-jaeger": "1.28.0",
"@opentelemetry/exporter-zipkin": "1.28.0",
"@opentelemetry/instrumentation": "0.55.0",
"@opentelemetry/instrumentation-http": "0.55.0",
"@opentelemetry/resources": "1.28.0",
"@opentelemetry/sdk-trace-base": "1.28.0",
"@opentelemetry/sdk-trace-node": "1.28.0",
"@opentelemetry/semantic-conventions": "1.28.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/https",
"devDependencies": {
Expand Down
30 changes: 15 additions & 15 deletions examples/opentelemetry-web/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "web-opentelemetry-example",
"private": true,
"version": "0.54.2",
"version": "0.55.0",
"description": "Example of using @opentelemetry/sdk-trace-web and @opentelemetry/sdk-metrics in browser",
"main": "index.js",
"scripts": {
Expand Down Expand Up @@ -45,20 +45,20 @@
},
"dependencies": {
"@opentelemetry/api": "^1.3.0",
"@opentelemetry/context-zone": "1.27.0",
"@opentelemetry/core": "1.27.0",
"@opentelemetry/exporter-metrics-otlp-http": "0.54.2",
"@opentelemetry/exporter-trace-otlp-http": "0.54.2",
"@opentelemetry/exporter-trace-otlp-proto": "0.54.2",
"@opentelemetry/exporter-zipkin": "1.27.0",
"@opentelemetry/instrumentation": "0.54.2",
"@opentelemetry/instrumentation-fetch": "0.54.2",
"@opentelemetry/instrumentation-xml-http-request": "0.54.2",
"@opentelemetry/propagator-b3": "1.27.0",
"@opentelemetry/sdk-metrics": "1.27.0",
"@opentelemetry/sdk-trace-base": "1.27.0",
"@opentelemetry/sdk-trace-web": "1.27.0",
"@opentelemetry/semantic-conventions": "1.27.0"
"@opentelemetry/context-zone": "1.28.0",
"@opentelemetry/core": "1.28.0",
"@opentelemetry/exporter-metrics-otlp-http": "0.55.0",
"@opentelemetry/exporter-trace-otlp-http": "0.55.0",
"@opentelemetry/exporter-trace-otlp-proto": "0.55.0",
"@opentelemetry/exporter-zipkin": "1.28.0",
"@opentelemetry/instrumentation": "0.55.0",
"@opentelemetry/instrumentation-fetch": "0.55.0",
"@opentelemetry/instrumentation-xml-http-request": "0.55.0",
"@opentelemetry/propagator-b3": "1.28.0",
"@opentelemetry/sdk-metrics": "1.28.0",
"@opentelemetry/sdk-trace-base": "1.28.0",
"@opentelemetry/sdk-trace-web": "1.28.0",
"@opentelemetry/semantic-conventions": "1.28.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/tracer-web"
}
Loading
Loading