Skip to content

Commit

Permalink
Merge branch 'main' into xhr-semconv
Browse files Browse the repository at this point in the history
  • Loading branch information
pichlermarc authored Jun 4, 2024
2 parents f13b18b + be9d11c commit b59d296
Show file tree
Hide file tree
Showing 168 changed files with 6,579 additions and 15,455 deletions.
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
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/
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "experimental/packages/otlp-proto-exporter-base/protos"]
path = experimental/packages/otlp-proto-exporter-base/protos
url = https://github.com/open-telemetry/opentelemetry-proto.git
[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.

29 changes: 22 additions & 7 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 @@ -11,20 +12,33 @@ For experimental package changes, see the [experimental CHANGELOG](experimental/

### :rocket: (Enhancement)

* feat(instrumentation): generic config type in instrumentation base [#4659](https://github.com/open-telemetry/opentelemetry-js/pull/4659) @blumamir
* feat: support node 22 [#4666](https://github.com/open-telemetry/opentelemetry-js/pull/4666) @dyladan
* feat(sdk-trace-node): support `xray` Propagator via `OTEL_PROPAGATORS` environment variable [#4602](https://github.com/open-telemetry/opentelemetry-js/pull/4602) @anuraags
* 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

### :bug: (Bug Fix)

### :books: (Refine Doc)

* refactor(examples): use new exported string constants for semconv in examples/http [#4750](https://github.com/open-telemetry/opentelemetry-js/pull/4750) @Zen-cronic

### :house: (Internal)

## 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`

### :books: (Refine Doc)

### :house: (Internal)
* 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

Expand Down Expand Up @@ -61,6 +75,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 @@ -1912,7 +1927,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
7 changes: 7 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
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
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ The above example will emit auto-instrumented telemetry about your Node.js appli

## Library Author

If you are a library author looking to build OpenTelemetry into your library, please see [the documentation][docs]. As a library author, it is important that you only depend on properties and methods published on the public API. If you use any properties or methods from the SDK that are not officially a part of the public API, your library may break if an [Application Owner](#application-owner) uses a different SDK implementation.
If you are a library author looking to build OpenTelemetry into your library, please see [the documentation][docs]. As a library author, it is important that you only depend on properties and methods published on the public API. If you use any properties or methods from the SDK that are not officially a part of the public API, your library may break if an application owner uses a different SDK implementation.

## Supported Runtimes

Expand Down Expand Up @@ -205,8 +205,8 @@ We have a weekly SIG meeting! See the [community page](https://github.com/open-t

#### Maintainers ([@open-telemetry/javascript-maintainers](https://github.com/orgs/open-telemetry/teams/javascript-maintainers))

- [Amir Blum](https://github.com/blumamir), Keyval
- [Chengzhong Wu](https://github.com/legendecas), Alibaba
- [Amir Blum](https://github.com/blumamir), Odigos
- [Chengzhong Wu](https://github.com/legendecas), Bloomberg
- [Daniel Dyla](https://github.com/dyladan), Dynatrace
- [Marc Pichler](https://github.com/pichlermarc), Dynatrace

Expand Down Expand Up @@ -252,7 +252,7 @@ We have a weekly SIG meeting! See the [community page](https://github.com/open-t
#### Thanks to all the people who already contributed

<a href="https://github.com/open-telemetry/opentelemetry-js/graphs/contributors">
<img src="https://contributors-img.web.app/image?repo=open-telemetry/opentelemetry-js" />
<img alt="Repo contributors" src="https://contributors-img.web.app/image?repo=open-telemetry/opentelemetry-js" />
</a>

## Packages
Expand Down Expand Up @@ -349,6 +349,5 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[otel-web]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-web
[otel-api]: https://github.com/open-telemetry/opentelemetry-js/tree/main/api
[otel-core]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-core
[otel-propagator-b3]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-propagator-b3

[spec-versioning]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/versioning-and-stability.md
8 changes: 6 additions & 2 deletions api/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 @@ -8,6 +9,9 @@ All notable changes to this project will be documented in this file.

### :rocket: (Enhancement)

* feat(metrics): added synchronous gauge [#4528](https://github.com/open-telemetry/opentelemetry-js/pull/4528) @clintonb
* feat(api): allow adding span links after span creation [#4536](https://github.com/open-telemetry/opentelemetry-js/pull/4536) @seemk
* This change is non-breaking for end-users, but breaking for Trace SDK implmentations in accordance with the [specification](https://github.com/open-telemetry/opentelemetry-specification/blob/a03382ada8afa9415266a84dafac0510ec8c160f/specification/upgrading.md?plain=1#L97-L122) as new features need to be implemented.
* feat: support node 22 [#4666](https://github.com/open-telemetry/opentelemetry-js/pull/4666) @dyladan

### :bug: (Bug Fix)
Expand Down Expand Up @@ -95,13 +99,13 @@ All notable changes to this project will be documented in this file.

* export tracer options ([#154](https://www.github.com/open-telemetry/opentelemetry-js-api/issues/154)) ([b125324](https://www.github.com/open-telemetry/opentelemetry-js-api/commit/b125324438fb2f24eb80c7c6673afc8cfc99575e))

### [1.0.4](https://www.github.com/open-telemetry/opentelemetry-js-api/compare/v1.0.3...v1.0.4) (2021-12-18)
## [1.0.4](https://www.github.com/open-telemetry/opentelemetry-js-api/compare/v1.0.3...v1.0.4) (2021-12-18)

### Bug Fixes

* align globalThis fallbacks with otel-core ([#126](https://www.github.com/open-telemetry/opentelemetry-js-api/issues/126)) ([3507de7](https://www.github.com/open-telemetry/opentelemetry-js-api/commit/3507de7c3b95396696657c021953b0b24a63a029))

### [1.0.3](https://www.github.com/open-telemetry/opentelemetry-js-api/compare/v1.0.2...v1.0.3) (2021-08-30)
## [1.0.3](https://www.github.com/open-telemetry/opentelemetry-js-api/compare/v1.0.2...v1.0.3) (2021-08-30)

### Bug Fixes

Expand Down
1 change: 0 additions & 1 deletion api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,5 @@ Apache 2.0 - See [LICENSE][license-url] for more information.

[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions
[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/api/LICENSE
[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat
[docs-tracing]: https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/tracing.md
[docs-sdk-registration]: https://github.com/open-telemetry/opentelemetry-js/blob/main/doc/sdk-registration.md
8 changes: 4 additions & 4 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@
"devDependencies": {
"@types/mocha": "10.0.6",
"@types/node": "18.6.5",
"@types/sinon": "10.0.20",
"@types/sinon": "17.0.3",
"@types/webpack": "5.28.5",
"@types/webpack-env": "1.16.3",
"babel-plugin-istanbul": "6.1.1",
"codecov": "3.8.3",
"cross-var": "1.1.0",
"dpdm": "3.13.1",
"karma": "6.4.2",
"karma": "6.4.3",
"karma-chrome-launcher": "3.1.0",
"karma-coverage": "2.2.1",
"karma-mocha": "2.0.1",
Expand All @@ -101,10 +101,10 @@
"mocha": "10.2.0",
"nyc": "15.1.0",
"sinon": "15.1.2",
"ts-loader": "8.4.0",
"ts-loader": "9.5.1",
"ts-mocha": "10.0.0",
"typescript": "4.4.4",
"unionfs": "4.5.1",
"unionfs": "4.5.4",
"webpack": "5.89.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/api",
Expand Down
1 change: 1 addition & 0 deletions api/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export { MeterProvider } from './metrics/MeterProvider';
export {
ValueType,
Counter,
Gauge,
Histogram,
MetricOptions,
Observable,
Expand Down
11 changes: 11 additions & 0 deletions api/src/metrics/Meter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import {
BatchObservableCallback,
Counter,
Gauge,
Histogram,
MetricAttributes,
MetricOptions,
Expand Down Expand Up @@ -45,6 +46,16 @@ export interface MeterOptions {
* for the exported metric are deferred.
*/
export interface Meter {
/**
* Creates and returns a new `Gauge`.
* @param name the name of the metric.
* @param [options] the metric options.
*/
createGauge<AttributesTypes extends MetricAttributes = MetricAttributes>(
name: string,
options?: MetricOptions
): Gauge<AttributesTypes>;

/**
* Creates and returns a new `Histogram`.
* @param name the name of the metric.
Expand Down
9 changes: 9 additions & 0 deletions api/src/metrics/Metric.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ export interface UpDownCounter<
add(value: number, attributes?: AttributesTypes, context?: Context): void;
}

export interface Gauge<
AttributesTypes extends MetricAttributes = MetricAttributes,
> {
/**
* Records a measurement.
*/
record(value: number, attributes?: AttributesTypes, context?: Context): void;
}

export interface Histogram<
AttributesTypes extends MetricAttributes = MetricAttributes,
> {
Expand Down
17 changes: 15 additions & 2 deletions api/src/metrics/NoopMeter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ import { Meter } from './Meter';
import {
BatchObservableCallback,
Counter,
Gauge,
Histogram,
MetricAttributes,
MetricOptions,
Observable,
ObservableCallback,
ObservableCounter,
ObservableGauge,
ObservableUpDownCounter,
UpDownCounter,
MetricAttributes,
Observable,
} from './Metric';

/**
Expand All @@ -36,6 +37,13 @@ import {
export class NoopMeter implements Meter {
constructor() {}

/**
* @see {@link Meter.createGauge}
*/
createGauge(_name: string, _options?: MetricOptions): Gauge {
return NOOP_GAUGE_METRIC;
}

/**
* @see {@link Meter.createHistogram}
*/
Expand Down Expand Up @@ -114,6 +122,10 @@ export class NoopUpDownCounterMetric
add(_value: number, _attributes: MetricAttributes): void {}
}

export class NoopGaugeMetric extends NoopMetric implements Gauge {
record(_value: number, _attributes: MetricAttributes): void {}
}

export class NoopHistogramMetric extends NoopMetric implements Histogram {
record(_value: number, _attributes: MetricAttributes): void {}
}
Expand All @@ -140,6 +152,7 @@ export const NOOP_METER = new NoopMeter();

// Synchronous instruments
export const NOOP_COUNTER_METRIC = new NoopCounterMetric();
export const NOOP_GAUGE_METRIC = new NoopGaugeMetric();
export const NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric();
export const NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric();

Expand Down
Loading

0 comments on commit b59d296

Please sign in to comment.