You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `extract_count_metric` function creates a new Sum metric from a Histogram, ExponentialHistogram or Summary's count value. A metric will only be created if there is at least one data point.
302
304
303
305
`is_monotonic`is a boolean representing the monotonicity of the new metric.
306
+
`suffix`is an optional string that defines the suffix for the metric name. By default, it is set to `_count`.
307
+
For backward compatibility, this default does not follow the [semantic naming conventions](https://opentelemetry.io/docs/specs/semconv/general/naming/#general-naming-considerations) and should ideally be `.count` instead. This default is expected to change in a future release.
304
308
305
-
The name for the new metric will be `<original metric name>_count`. The fields that are copied are: `timestamp`, `starttimestamp`, `attributes`, `description`, and `aggregation_temporality`. As metrics of type Summary don't have an `aggregation_temporality` field, this field will be set to `AGGREGATION_TEMPORALITY_CUMULATIVE` for those metrics.
309
+
The name for the new metric will be `<original metric name><suffix>`. The fields that are copied are: `timestamp`, `starttimestamp`, `attributes`, `description`, and `aggregation_temporality`. As metrics of type Summary don't have an `aggregation_temporality` field, this field will be set to `AGGREGATION_TEMPORALITY_CUMULATIVE` for those metrics.
306
310
307
311
The new metric that is created will be passed to all subsequent statements in the metrics statements list.
308
312
@@ -311,22 +315,24 @@ The new metric that is created will be passed to all subsequent statements in th
311
315
312
316
Examples:
313
317
314
-
- `extract_count_metric(true)`
318
+
- `extract_count_metric(true, ".count")`
315
319
316
-
- `extract_count_metric(false)`
320
+
- `extract_count_metric(false, ".count")`
317
321
318
322
### extract_sum_metric
319
323
320
324
> [!NOTE]
321
325
> This function supports Histograms, ExponentialHistograms and Summaries.
The `extract_sum_metric` function creates a new Sum metric from a Histogram, ExponentialHistogram or Summary's sum value. If the sum value of a Histogram or ExponentialHistogram data point is missing, no data point is added to the output metric. A metric will only be created if there is at least one data point.
326
330
327
331
`is_monotonic`is a boolean representing the monotonicity of the new metric.
332
+
`suffix`is an optional string that defines the suffix for the metric name. By default, it is set to `_sum`.
333
+
For backward compatibility, this default does not follow the [semantic naming conventions](https://opentelemetry.io/docs/specs/semconv/general/naming/#general-naming-considerations) and should ideally be `.sum` instead. This default is expected to change in a future release.
328
334
329
-
The name for the new metric will be `<original metric name>_sum`. The fields that are copied are: `timestamp`, `starttimestamp`, `attributes`, `description`, and `aggregation_temporality`. As metrics of type Summary don't have an `aggregation_temporality` field, this field will be set to `AGGREGATION_TEMPORALITY_CUMULATIVE` for those metrics.
335
+
The name for the new metric will be `<original metric name><suffix>`. The fields that are copied are: `timestamp`, `starttimestamp`, `attributes`, `description`, and `aggregation_temporality`. As metrics of type Summary don't have an `aggregation_temporality` field, this field will be set to `AGGREGATION_TEMPORALITY_CUMULATIVE` for those metrics.
330
336
331
337
The new metric that is created will be passed to all subsequent statements in the metrics statements list.
332
338
@@ -335,47 +341,50 @@ The new metric that is created will be passed to all subsequent statements in th
The `convert_summary_count_val_to_sum` function creates a new Sum metric from a Summary's count value.
347
353
348
354
`aggregation_temporality`is a string (`"cumulative"` or `"delta"`) representing the desired aggregation temporality of the new metric. `is_monotonic` is a boolean representing the monotonicity of the new metric.
349
355
350
-
The name for the new metric will be `<summary metric name>_count`. The fields that are copied are: `timestamp`, `starttimestamp`, `attributes`, and `description`. The new metric that is created will be passed to all functions in the metrics statements list. Function conditions will apply.
356
+
`suffix`is an optional string that defines the suffix for the metric name. By default, it is set to `_count`.
357
+
For backward compatibility, this default does not follow the [semantic naming conventions](https://opentelemetry.io/docs/specs/semconv/general/naming/#general-naming-considerations) and should ideally be `.count` instead. This default is expected to change in a future release.
358
+
359
+
The name for the new metric will be `<summary metric name><suffix>`. The fields that are copied are: `timestamp`, `starttimestamp`, `attributes`, and `description`. The new metric that is created will be passed to all functions in the metrics statements list. Function conditions will apply.
351
360
352
361
**NOTE:** This function may cause a metric to break semantics for [Sum metrics](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/data-model.md#sums). Use at your own risk.
The `convert_summary_sum_val_to_sum` function creates a new Sum metric from a Summary's sum value.
366
374
367
375
`aggregation_temporality`is a string (`"cumulative"` or `"delta"`) representing the desired aggregation temporality of the new metric. `is_monotonic` is a boolean representing the monotonicity of the new metric.
376
+
`suffix`is an optional string that defines the suffix for the metric name. By default, it is set to `_sum`.
377
+
For backward compatibility, this default does not follow the [semantic naming conventions](https://opentelemetry.io/docs/specs/semconv/general/naming/#general-naming-considerations) and should ideally be `.sum` instead. This default is expected to change in a future release.
368
378
369
-
The name for the new metric will be `<summary metric name>_sum`. The fields that are copied are: `timestamp`, `starttimestamp`, `attributes`, and `description`. The new metric that is created will be passed to all functions in the metrics statements list. Function conditions will apply.
379
+
The name for the new metric will be `<summary metric name><suffix>`. The fields that are copied are: `timestamp`, `starttimestamp`, `attributes`, and `description`. The new metric that is created will be passed to all functions in the metrics statements list. Function conditions will apply.
370
380
371
381
**NOTE:** This function may cause a metric to break semantics for [Sum metrics](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/data-model.md#sums). Use at your own risk.
0 commit comments