Skip to content

Commit

Permalink
Rename @opentelemetry/sdk-metrics-base to @opentelemetry/sdk-metrics (#…
Browse files Browse the repository at this point in the history
…3162)

* Rename @opentelemetry/sdk-metrics-base to @opentelemetry/sdk-metrics

* Update all remaining references

* Addressing comments

* Add pr number in changelog

* Changing path of metrics SDK project
  • Loading branch information
hectorhdzg authored Aug 16, 2022
1 parent 3cca2ce commit 6807def
Show file tree
Hide file tree
Showing 152 changed files with 68 additions and 66 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ Maintainers ([@open-telemetry/js-maintainers](https://github.com/orgs/open-telem
| Package | Description |
| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [@opentelemetry/sdk-trace-base][otel-tracing] | This module provides a full control over instrumentation and span creation. It doesn't load [`async_hooks`](https://nodejs.org/api/async_hooks.html) or any instrumentation by default. It is intended for use both on the server and in the browser. |
| [@opentelemetry/sdk-metrics-base][otel-metrics] | This module provides instruments and meters for reporting of time series data. |
| [@opentelemetry/sdk-metrics][otel-metrics] | This module provides instruments and meters for reporting of time series data. |
| [@opentelemetry/sdk-trace-node][otel-node] | This module provides automatic tracing for Node.js applications. It is intended for use on the server only. |
| [@opentelemetry/sdk-trace-web][otel-web] | This module provides automated instrumentation and tracing for Web applications. It is intended for use in the browser only. |

Expand Down Expand Up @@ -540,7 +540,7 @@ Apache 2.0 - See [LICENSE][license-url] for more information.
[compliance-matrix]: https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix.md
[CONTRIBUTING]: https://github.com/open-telemetry/opentelemetry-js/blob/main/CONTRIBUTING.md

[otel-metrics]: https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-sdk-metrics-base
[otel-metrics]: https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-sdk-metrics
[otel-node]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node

[otel-instrumentation-fetch]: https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-instrumentation-fetch
Expand Down
6 changes: 3 additions & 3 deletions doc/processor-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Sometimes you may want to use a specific aggregator for one of your metric, expo
Here is what an aggregator that does that would look like:

```ts
import { Aggregator } from '@opentelemetry/sdk-metrics-base';
import { Aggregator } from '@opentelemetry/sdk-metrics';
import { hrTime } from '@opentelemetry/core';

export class AverageAggregator implements Aggregator {
Expand Down Expand Up @@ -54,7 +54,7 @@ import {
CounterSumAggregator,
ObserverAggregator,
MeasureExactAggregator,
} from '@opentelemetry/sdk-metrics-base';
} from '@opentelemetry/sdk-metrics';

export class CustomProcessor extends UngroupedProcessor {
aggregatorFor (metricDescriptor: MetricDescriptor) {
Expand Down Expand Up @@ -86,7 +86,7 @@ import {
MeasureExactAggregator,
MeterProvider,
Aggregator,
} from '@opentelemetry/sdk-metrics-base';
} from '@opentelemetry/sdk-metrics';
import { hrTime } from '@opentelemetry/core';

export class AverageAggregator implements Aggregator {
Expand Down
2 changes: 1 addition & 1 deletion examples/opentelemetry-web/examples/metrics/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { DiagConsoleLogger, DiagLogLevel, diag } = require('@opentelemetry/api');
const { metrics } = require('@opentelemetry/api-metrics');
const { OTLPMetricExporter } = require('@opentelemetry/exporter-metrics-otlp-http');
const { MeterProvider, PeriodicExportingMetricReader } = require('@opentelemetry/sdk-metrics-base');
const { MeterProvider, PeriodicExportingMetricReader } = require('@opentelemetry/sdk-metrics');

// Optional and only needed to see the internal diagnostic logging (during development)
diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.DEBUG);
Expand Down
4 changes: 2 additions & 2 deletions examples/opentelemetry-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "web-opentelemetry-example",
"private": true,
"version": "0.31.0",
"description": "Example of using @opentelemetry/sdk-trace-web and @opentelemetry/sdk-metrics-base in browser",
"description": "Example of using @opentelemetry/sdk-trace-web and @opentelemetry/sdk-metrics in browser",
"main": "index.js",
"scripts": {
"start": "webpack serve --progress --color --port 8090 --config webpack.dev.config.js --hot --host 0.0.0.0 --compress",
Expand Down Expand Up @@ -53,7 +53,7 @@
"@opentelemetry/instrumentation-fetch": "0.31.0",
"@opentelemetry/instrumentation-xml-http-request": "0.31.0",
"@opentelemetry/propagator-b3": "^1.0.1",
"@opentelemetry/sdk-metrics-base": "0.31.0",
"@opentelemetry/sdk-metrics": "0.31.0",
"@opentelemetry/sdk-trace-base": "^1.0.1",
"@opentelemetry/sdk-trace-web": "^1.0.1",
"@opentelemetry/semantic-conventions": "^1.0.1"
Expand Down
2 changes: 1 addition & 1 deletion examples/otlp-exporter-node/metrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { DiagConsoleLogger, DiagLogLevel, diag } = require('@opentelemetry/api');
const { OTLPMetricExporter } = require('@opentelemetry/exporter-metrics-otlp-http');
// const { OTLPMetricExporter } = require('@opentelemetry/exporter-metrics-otlp-grpc');
// const { OTLPMetricExporter } = require('@opentelemetry/exporter-metrics-otlp-proto');
const { MeterProvider, PeriodicExportingMetricReader } = require('@opentelemetry/sdk-metrics-base');
const { MeterProvider, PeriodicExportingMetricReader } = require('@opentelemetry/sdk-metrics');
const { Resource } = require('@opentelemetry/resources');
const { SemanticResourceAttributes } = require('@opentelemetry/semantic-conventions');

Expand Down
2 changes: 1 addition & 1 deletion examples/otlp-exporter-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"@opentelemetry/exporter-trace-otlp-http": "0.31.0",
"@opentelemetry/exporter-trace-otlp-proto": "0.31.0",
"@opentelemetry/resources": "1.5.0",
"@opentelemetry/sdk-metrics-base": "0.31.0",
"@opentelemetry/sdk-metrics": "0.31.0",
"@opentelemetry/sdk-trace-base": "1.5.0",
"@opentelemetry/semantic-conventions": "1.5.0"
},
Expand Down
2 changes: 2 additions & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ All notable changes to experimental packages in this project will be documented

### :boom: Breaking Change

* Rename @opentelemetry/sdk-metrics-base package to @opentelemetry/sdk-metrics [#3162](https://github.com/open-telemetry/opentelemetry-js/pull/3162) @hectorhdzg

### :rocket: (Enhancement)

* feature(add-console-metrics-exporter): add ConsoleMetricExporter [#3120](https://github.com/open-telemetry/opentelemetry-js/pull/3120) @weyert
Expand Down
2 changes: 1 addition & 1 deletion experimental/examples/prometheus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ If you are using the default configurations, the prometheus client will be avail
## Useful links

- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>
- For more information on OpenTelemetry metrics, visit: <https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-sdk-metrics-base>
- For more information on OpenTelemetry metrics, visit: <https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-sdk-metrics>
- For more information on OpenTelemetry for Node.js, visit: <https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node>

## LICENSE
Expand Down
2 changes: 1 addition & 1 deletion experimental/examples/prometheus/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

const { DiagConsoleLogger, DiagLogLevel, diag } = require('@opentelemetry/api');
const { MeterProvider } = require('@opentelemetry/sdk-metrics-base');
const { MeterProvider } = require('@opentelemetry/sdk-metrics');
const { PrometheusExporter } = require('@opentelemetry/exporter-prometheus');

// Optional and only needed to see the internal diagnostic logging (during development)
Expand Down
4 changes: 2 additions & 2 deletions experimental/packages/opentelemetry-api-metrics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ To get started you need to install the SDK and instrumentations, create a MeterP
$ # Install metrics dependencies
$ npm install \
@opentelemetry/api-metrics \
@opentelemetry/sdk-metrics-base \
@opentelemetry/sdk-metrics \
@opentelemetry/exporter-prometheus # add exporters as needed
```

Expand All @@ -35,7 +35,7 @@ To collect traces and metrics, you will have to tell the SDK where to export tel

```javascript
const api = require("@opentelemetry/api-metrics");
const { MeterProvider } = require("@opentelemetry/sdk-metrics-base");
const { MeterProvider } = require("@opentelemetry/sdk-metrics");
const { PrometheusExporter } = require("@opentelemetry/exporter-prometheus");

const meterProvider = new MeterProvider({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To see sample code and documentation for the traces exporter, as well as instruc
The OTLPMetricsExporter in Node expects the URL to only be the hostname. It will not work with `/v1/metrics`. All options that work with trace also work with metrics.

```js
const { MeterProvider, PeriodicExportingMetricReader } = require('@opentelemetry/sdk-metrics-base');
const { MeterProvider, PeriodicExportingMetricReader } = require('@opentelemetry/sdk-metrics');
const { OTLPMetricExporter } = require('@opentelemetry/exporter-metrics-otlp-grpc');
const collectorOptions = {
// url is optional and can be omitted - default is http://localhost:4317
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"@opentelemetry/otlp-grpc-exporter-base": "0.31.0",
"@opentelemetry/otlp-transformer": "0.31.0",
"@opentelemetry/resources": "1.5.0",
"@opentelemetry/sdk-metrics-base": "0.31.0"
"@opentelemetry/sdk-metrics": "0.31.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-exporter-metrics-otlp-grpc"
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
OTLPMetricExporterBase,
OTLPMetricExporterOptions
} from '@opentelemetry/exporter-metrics-otlp-http';
import { ResourceMetrics } from '@opentelemetry/sdk-metrics-base';
import { ResourceMetrics } from '@opentelemetry/sdk-metrics';
import {
OTLPGRPCExporterConfigNode,
OTLPGRPCExporterNodeBase,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
mockHistogram,
mockObservableGauge, setUp, shutdown,
} from './metricsHelper';
import { AggregationTemporality, ResourceMetrics } from '@opentelemetry/sdk-metrics-base';
import { AggregationTemporality, ResourceMetrics } from '@opentelemetry/sdk-metrics';
import { IExportMetricsServiceRequest, IResourceMetrics } from '@opentelemetry/otlp-transformer';

const metricsServiceProtoPath =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
MeterProvider,
MetricReader,
View,
} from '@opentelemetry/sdk-metrics-base';
} from '@opentelemetry/sdk-metrics';
import { IKeyValue, IMetric, IResource } from '@opentelemetry/otlp-transformer';

class TestMetricReader extends MetricReader {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"path": "../opentelemetry-exporter-metrics-otlp-http"
},
{
"path": "../opentelemetry-sdk-metrics-base"
"path": "../opentelemetry-sdk-metrics"
},
{
"path": "../otlp-grpc-exporter-base"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ To see sample code and documentation for the traces exporter, visit the [Collect
The OTLPMetricExporter in Web expects the endpoint to end in `/v1/metrics`.

```js
import { MeterProvider, PeriodicExportingMetricReader } from '@opentelemetry/sdk-metrics-base';
import { MeterProvider, PeriodicExportingMetricReader } from '@opentelemetry/sdk-metrics';
import { OTLPMetricExporter } from '@opentelemetry/exporter-metrics-otlp-http';
const collectorOptions = {
url: '<opentelemetry-collector-url>', // url is optional and can be omitted - default is http://localhost:4318/v1/metrics
Expand All @@ -47,7 +47,7 @@ counter.add(10, { 'key': 'value' });
## Metrics in Node

```js
const { MeterProvider, PeriodicExportingMetricReader } = require('@opentelemetry/sdk-metrics-base');
const { MeterProvider, PeriodicExportingMetricReader } = require('@opentelemetry/sdk-metrics');
const { OTLPMetricExporter } = require('@opentelemetry/exporter-metrics-otlp-http');
const collectorOptions = {
url: '<opentelemetry-collector-url>', // url is optional and can be omitted - default is http://localhost:4318/v1/metrics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
"@opentelemetry/otlp-exporter-base": "0.31.0",
"@opentelemetry/otlp-transformer": "0.31.0",
"@opentelemetry/resources": "1.5.0",
"@opentelemetry/sdk-metrics-base": "0.31.0"
"@opentelemetry/sdk-metrics": "0.31.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-exporter-metrics-otlp-http"
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {
InstrumentType,
PushMetricExporter,
ResourceMetrics
} from '@opentelemetry/sdk-metrics-base';
} from '@opentelemetry/sdk-metrics';
import { defaultOptions, OTLPMetricExporterOptions } from './OTLPMetricExporterOptions';
import { OTLPExporterBase } from '@opentelemetry/otlp-exporter-base';
import { IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { AggregationTemporality } from '@opentelemetry/sdk-metrics-base';
import { AggregationTemporality } from '@opentelemetry/sdk-metrics';
import { OTLPExporterConfigBase } from '@opentelemetry/otlp-exporter-base';

export interface OTLPMetricExporterOptions extends OTLPExporterConfigBase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { ResourceMetrics } from '@opentelemetry/sdk-metrics-base';
import { ResourceMetrics } from '@opentelemetry/sdk-metrics';
import { baggageUtils, getEnv } from '@opentelemetry/core';
import { defaultOptions, OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';
import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import { ResourceMetrics } from '@opentelemetry/sdk-metrics-base';
import { ResourceMetrics } from '@opentelemetry/sdk-metrics';
import { getEnv, baggageUtils} from '@opentelemetry/core';
import { defaultOptions, OTLPMetricExporterOptions } from '../../OTLPMetricExporterOptions';
import { OTLPMetricExporterBase } from '../../OTLPMetricExporterBase';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { diag, DiagLogger, DiagLogLevel } from '@opentelemetry/api';
import { Counter, Histogram, } from '@opentelemetry/api-metrics';
import { ExportResultCode, hrTimeToNanoseconds } from '@opentelemetry/core';
import { AggregationTemporality, ResourceMetrics, } from '@opentelemetry/sdk-metrics-base';
import { AggregationTemporality, ResourceMetrics, } from '@opentelemetry/sdk-metrics';
import * as assert from 'assert';
import * as sinon from 'sinon';
import { OTLPMetricExporter } from '../../src/platform/browser';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import { ExportResultCode } from '@opentelemetry/core';
import {
ResourceMetrics,
} from '@opentelemetry/sdk-metrics-base';
} from '@opentelemetry/sdk-metrics';
import * as assert from 'assert';
import * as sinon from 'sinon';
import { collect, mockCounter, mockObservableGauge, setUp, shutdown } from '../metricsHelper';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
MeterProvider,
MetricReader,
View
} from '@opentelemetry/sdk-metrics-base';
} from '@opentelemetry/sdk-metrics';
import {
IExportMetricsServiceRequest,
IKeyValue,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import {
HISTOGRAM_AGGREGATION_VIEW,
} from '../metricsHelper';
import { MockedResponse } from './nodeHelpers';
import { AggregationTemporality, ResourceMetrics } from '@opentelemetry/sdk-metrics-base';
import { AggregationTemporality, ResourceMetrics } from '@opentelemetry/sdk-metrics';
import { Stream, PassThrough } from 'stream';
import { OTLPExporterError, OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';
import { IExportMetricsServiceRequest } from '@opentelemetry/otlp-transformer';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"path": "../opentelemetry-api-metrics"
},
{
"path": "../opentelemetry-sdk-metrics-base"
"path": "../opentelemetry-sdk-metrics"
},
{
"path": "../otlp-exporter-base"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ To see sample code and documentation for the traces exporter, visit the [Collect
## Metrics in Node - PROTO over http

```js
const { MeterProvider, PeriodicExportingMetricReader } = require('@opentelemetry/sdk-metrics-base');
const { MeterProvider, PeriodicExportingMetricReader } = require('@opentelemetry/sdk-metrics');
const { OTLPMetricExporter } = require('@opentelemetry/exporter-metrics-otlp-proto');
const collectorOptions = {
url: '<opentelemetry-collector-url>', // url is optional and can be omitted - default is http://localhost:4318/v1/metrics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"@opentelemetry/otlp-proto-exporter-base": "0.31.0",
"@opentelemetry/otlp-transformer": "0.31.0",
"@opentelemetry/resources": "1.5.0",
"@opentelemetry/sdk-metrics-base": "0.31.0",
"@opentelemetry/sdk-metrics": "0.31.0",
"protobufjs": "^6.9.0"
},
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/experimental/packages/opentelemetry-exporter-metrics-otlp-proto"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import {
OTLPMetricExporterOptions
} from '@opentelemetry/exporter-metrics-otlp-http';
import { ServiceClientType, OTLPProtoExporterNodeBase } from '@opentelemetry/otlp-proto-exporter-base';
import { getEnv, baggageUtils} from '@opentelemetry/core';
import { ResourceMetrics} from '@opentelemetry/sdk-metrics-base';
import { getEnv, baggageUtils } from '@opentelemetry/core';
import { ResourceMetrics } from '@opentelemetry/sdk-metrics';
import { OTLPMetricExporterBase } from '@opentelemetry/exporter-metrics-otlp-http';
import {
OTLPExporterNodeConfigBase,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
mockObservableGauge,
mockHistogram, collect, setUp, shutdown,
} from './metricsHelper';
import { AggregationTemporality, ResourceMetrics } from '@opentelemetry/sdk-metrics-base';
import { AggregationTemporality, ResourceMetrics } from '@opentelemetry/sdk-metrics';
import { OTLPMetricExporterOptions } from '@opentelemetry/exporter-metrics-otlp-http';
import { Stream, PassThrough } from 'stream';
import { OTLPExporterNodeConfigBase } from '@opentelemetry/otlp-exporter-base';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
MeterProvider,
MetricReader,
View
} from '@opentelemetry/sdk-metrics-base';
} from '@opentelemetry/sdk-metrics';
import { IExportMetricsServiceRequest, IKeyValue, IMetric } from '@opentelemetry/otlp-transformer';
import { Stream } from 'stream';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"path": "../opentelemetry-exporter-metrics-otlp-http"
},
{
"path": "../opentelemetry-sdk-metrics-base"
"path": "../opentelemetry-sdk-metrics"
},
{
"path": "../otlp-exporter-base"
Expand Down
Loading

0 comments on commit 6807def

Please sign in to comment.