From 5724f50f6a14217b5eefd70d135eabe112bd74e4 Mon Sep 17 00:00:00 2001 From: "marc.pichler" Date: Fri, 9 Sep 2022 11:39:03 +0200 Subject: [PATCH 1/2] docs(sdk-metrics): fix typos and add missing parameter docs. --- .../opentelemetry-sdk-metrics/src/aggregator/types.ts | 1 + .../opentelemetry-sdk-metrics/src/exemplar/ExemplarFilter.ts | 2 +- .../opentelemetry-sdk-metrics/src/export/MetricExporter.ts | 1 + .../src/export/PeriodicExportingMetricReader.ts | 2 +- .../opentelemetry-sdk-metrics/src/state/MeterSharedState.ts | 1 + .../src/state/TemporalMetricProcessor.ts | 4 +--- .../packages/opentelemetry-sdk-metrics/src/view/Predicate.ts | 4 ++-- 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/experimental/packages/opentelemetry-sdk-metrics/src/aggregator/types.ts b/experimental/packages/opentelemetry-sdk-metrics/src/aggregator/types.ts index 8f4f2e1acc..20c8f7ec4d 100644 --- a/experimental/packages/opentelemetry-sdk-metrics/src/aggregator/types.ts +++ b/experimental/packages/opentelemetry-sdk-metrics/src/aggregator/types.ts @@ -111,6 +111,7 @@ export interface Aggregator { * Returns the {@link MetricData} that this {@link Aggregator} will produce. * * @param descriptor the metric instrument descriptor. + * @param aggregationTemporality the temporality of the resulting {@link MetricData} * @param accumulationByAttributes the array of attributes and accumulation pairs. * @param endTime the end time of the metric data. * @return the {@link MetricData} that this {@link Aggregator} will produce. diff --git a/experimental/packages/opentelemetry-sdk-metrics/src/exemplar/ExemplarFilter.ts b/experimental/packages/opentelemetry-sdk-metrics/src/exemplar/ExemplarFilter.ts index 956025f253..ae005b4988 100644 --- a/experimental/packages/opentelemetry-sdk-metrics/src/exemplar/ExemplarFilter.ts +++ b/experimental/packages/opentelemetry-sdk-metrics/src/exemplar/ExemplarFilter.ts @@ -29,7 +29,7 @@ export interface ExemplarFilter { * @param value The value of the measurement * @param timestamp A timestamp that best represents when the measurement was taken * @param attributes The complete set of MetricAttributes of the measurement - * @param context The Context of the measurement + * @param ctx The Context of the measurement */ shouldSample( value: number, diff --git a/experimental/packages/opentelemetry-sdk-metrics/src/export/MetricExporter.ts b/experimental/packages/opentelemetry-sdk-metrics/src/export/MetricExporter.ts index 782a39ccb8..e429ba2c60 100644 --- a/experimental/packages/opentelemetry-sdk-metrics/src/export/MetricExporter.ts +++ b/experimental/packages/opentelemetry-sdk-metrics/src/export/MetricExporter.ts @@ -31,6 +31,7 @@ export interface PushMetricExporter { /** * Called to export sampled {@link ResourceMetrics}. * @param metrics the metric data to be exported. + * @param resultCallback callback for when the export has completed */ export(metrics: ResourceMetrics, resultCallback: (result: ExportResult) => void): void; diff --git a/experimental/packages/opentelemetry-sdk-metrics/src/export/PeriodicExportingMetricReader.ts b/experimental/packages/opentelemetry-sdk-metrics/src/export/PeriodicExportingMetricReader.ts index 4d2206cda0..a6e50975be 100644 --- a/experimental/packages/opentelemetry-sdk-metrics/src/export/PeriodicExportingMetricReader.ts +++ b/experimental/packages/opentelemetry-sdk-metrics/src/export/PeriodicExportingMetricReader.ts @@ -54,7 +54,7 @@ const DEFAULT_AGGREGATION_SELECTOR: AggregationSelector = Aggregation.Default; /** * {@link MetricReader} which collects metrics based on a user-configurable time interval, and passes the metrics to - * the configured {@link MetricExporter} + * the configured {@link PushMetricExporter} */ export class PeriodicExportingMetricReader extends MetricReader { private _interval?: ReturnType; diff --git a/experimental/packages/opentelemetry-sdk-metrics/src/state/MeterSharedState.ts b/experimental/packages/opentelemetry-sdk-metrics/src/state/MeterSharedState.ts index 4ddc0b8932..65ea6edde7 100644 --- a/experimental/packages/opentelemetry-sdk-metrics/src/state/MeterSharedState.ts +++ b/experimental/packages/opentelemetry-sdk-metrics/src/state/MeterSharedState.ts @@ -62,6 +62,7 @@ export class MeterSharedState { /** * @param collector opaque handle of {@link MetricCollector} which initiated the collection. * @param collectionTime the HrTime at which the collection was initiated. + * @param options options for collection. * @returns the list of metric data collected. */ async collect(collector: MetricCollectorHandle, collectionTime: HrTime, options?: MetricCollectOptions): Promise { diff --git a/experimental/packages/opentelemetry-sdk-metrics/src/state/TemporalMetricProcessor.ts b/experimental/packages/opentelemetry-sdk-metrics/src/state/TemporalMetricProcessor.ts index 6c648ac117..7e0000d775 100644 --- a/experimental/packages/opentelemetry-sdk-metrics/src/state/TemporalMetricProcessor.ts +++ b/experimental/packages/opentelemetry-sdk-metrics/src/state/TemporalMetricProcessor.ts @@ -44,7 +44,7 @@ interface LastReportedHistory> { /** * Internal interface. * - * Provides unique reporting for each collectors. Allows synchronous collection + * Provides unique reporting for each collector. Allows synchronous collection * of metrics and reports given temporality values. */ export class TemporalMetricProcessor> { @@ -57,8 +57,6 @@ export class TemporalMetricProcessor> { * Builds the {@link MetricData} streams to report against a specific MetricCollector. * @param collector The information of the MetricCollector. * @param collectors The registered collectors. - * @param resource The resource to attach these metrics against. - * @param instrumentationScope The instrumentation scope that generated these metrics. * @param instrumentDescriptor The instrumentation descriptor that these metrics generated with. * @param currentAccumulations The current accumulation of metric data from instruments. * @param collectionTime The current collection timestamp. diff --git a/experimental/packages/opentelemetry-sdk-metrics/src/view/Predicate.ts b/experimental/packages/opentelemetry-sdk-metrics/src/view/Predicate.ts index 605737b379..c12c32bbb2 100644 --- a/experimental/packages/opentelemetry-sdk-metrics/src/view/Predicate.ts +++ b/experimental/packages/opentelemetry-sdk-metrics/src/view/Predicate.ts @@ -16,7 +16,7 @@ // https://tc39.es/proposal-regex-escaping // escape ^ $ \ . + ? ( ) [ ] { } | -// do not need to escape * as we are interpret it as wildcard +// do not need to escape * as we interpret it as wildcard const ESCAPE = /[\^$\\.+?()[\]{}|]/g; export interface Predicate { @@ -24,7 +24,7 @@ export interface Predicate { } /** - * Wildcard pattern predicate, support patterns like `*`, `foo*`, `*bar`. + * Wildcard pattern predicate, supports patterns like `*`, `foo*`, `*bar`. */ export class PatternPredicate implements Predicate { private _matchAll: boolean; From 96a3d1615c6d756b37b6a32deef52b299f94ae3c Mon Sep 17 00:00:00 2001 From: "marc.pichler" Date: Fri, 9 Sep 2022 11:55:01 +0200 Subject: [PATCH 2/2] fix(changelog): add changelog entry. --- experimental/CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/experimental/CHANGELOG.md b/experimental/CHANGELOG.md index 9c3307b0b4..516190d73c 100644 --- a/experimental/CHANGELOG.md +++ b/experimental/CHANGELOG.md @@ -48,6 +48,8 @@ All notable changes to experimental packages in this project will be documented ### :books: (Refine Doc) +* docs(sdk-metrics): fix typos and add missing parameter docs. [#3244](https://github.com/open-telemetry/opentelemetry-js/pull/3244) @pichlermarc + ### :house: (Internal) ## 0.32.0