Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions .chloggen/codeboten_dep-metricsstarttime.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
change_type: 'deprecation'
component: processor/metric_start_time
note: Introduce new snake case compliant name `metric_start_time`
issues: [46777]
2 changes: 1 addition & 1 deletion .chloggen/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,8 @@ components:
- processor/logdedup
- processor/logstransform
- processor/lookup
- processor/metric_start_time
- processor/metricsgeneration
- processor/metricstarttime
- processor/metricstransform
- processor/novadetector
- processor/oracleclouddetector
Expand Down
10 changes: 5 additions & 5 deletions processor/metricstarttimeprocessor/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- status autogenerated section -->
# Metric Start Time Processor

The Metric Start Time Processor (`metricstarttime`) is used to set the start
The Metric Start Time Processor (`metric_start_time`) is used to set the start
time for metric points with a cumulative aggregation temporality. It is
commonly used with the `prometheus` receiver, which usually produces metric
points without a start time.
Expand All @@ -12,7 +12,7 @@ points without a start time.
| Stability | [beta]: metrics |
| Distributions | [contrib] |
| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aprocessor%2Fmetricstarttime%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aprocessor%2Fmetricstarttime) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aprocessor%2Fmetricstarttime%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aprocessor%2Fmetricstarttime) |
| Code coverage | [![codecov](https://codecov.io/github/open-telemetry/opentelemetry-collector-contrib/graph/main/badge.svg?component=processor_metricstarttime)](https://app.codecov.io/gh/open-telemetry/opentelemetry-collector-contrib/tree/main/?components%5B0%5D=processor_metricstarttime&displayType=list) |
| Code coverage | [![codecov](https://codecov.io/github/open-telemetry/opentelemetry-collector-contrib/graph/main/badge.svg?component=processor_metric_start_time)](https://app.codecov.io/gh/open-telemetry/opentelemetry-collector-contrib/tree/main/?components%5B0%5D=processor_metric_start_time&displayType=list) |
| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@dashpole](https://www.github.com/dashpole), [@ridwanmsharif](https://www.github.com/ridwanmsharif) |

[beta]: https://github.com/open-telemetry/opentelemetry-collector/blob/main/docs/component-stability.md#beta
Expand All @@ -39,12 +39,12 @@ Example configurations:

```yaml
processors:
metricstarttime:
metric_start_time:
```

```yaml
processors:
metricstarttime:
metric_start_time:
strategy: start_time_metric
gc_interval: 1h
start_time_metric_regex: "^.+_start_time$"
Expand Down Expand Up @@ -106,7 +106,7 @@ This strategy should only be used in limited circumstances:

* When your application has a metric with the start time in Unix nanoseconds,
such as `process_start_time`.
* The metricstarttime processor is used _before_ any batching, so that the
* The `metric_start_time` processor is used _before_ any batching, so that the
batch of metrics all originate from a single application.
* This strategy can be used when the collector is run as a sidecar to the
application, where the collector's start time is a good approximation of the
Expand Down
7 changes: 5 additions & 2 deletions processor/metricstarttimeprocessor/factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/processor"
"go.opentelemetry.io/collector/processor/processorhelper"
"go.opentelemetry.io/collector/processor/xprocessor"

"github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricstarttimeprocessor/internal/metadata"
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricstarttimeprocessor/internal/starttimemetric"
Expand All @@ -20,10 +21,12 @@ import (

// NewFactory creates a new metric start time processor factory.
func NewFactory() processor.Factory {
return processor.NewFactory(
return xprocessor.NewFactory(
metadata.Type,
createDefaultConfig,
processor.WithMetrics(createMetricsProcessor, metadata.MetricsStability))
xprocessor.WithMetrics(createMetricsProcessor, metadata.MetricsStability),
xprocessor.WithDeprecatedTypeAlias(metadata.DeprecatedType),
)
}

// createMetricsProcessor creates a metrics processor based on provided config.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion processor/metricstarttimeprocessor/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ require (
go.opentelemetry.io/collector/processor v1.53.1-0.20260306010043-a44ab254898b
go.opentelemetry.io/collector/processor/processorhelper v0.147.1-0.20260306010043-a44ab254898b
go.opentelemetry.io/collector/processor/processortest v0.147.1-0.20260306010043-a44ab254898b
go.opentelemetry.io/collector/processor/xprocessor v0.147.1-0.20260306010043-a44ab254898b
go.opentelemetry.io/otel v1.41.0
go.uber.org/goleak v1.3.0
go.uber.org/zap v1.27.1
Expand Down Expand Up @@ -48,7 +49,6 @@ require (
go.opentelemetry.io/collector/pdata/testdata v0.147.1-0.20260306010043-a44ab254898b // indirect
go.opentelemetry.io/collector/pdata/xpdata v0.147.1-0.20260306010043-a44ab254898b // indirect
go.opentelemetry.io/collector/pipeline v1.53.1-0.20260306010043-a44ab254898b // indirect
go.opentelemetry.io/collector/processor/xprocessor v0.147.1-0.20260306010043-a44ab254898b // indirect
go.opentelemetry.io/otel/metric v1.41.0 // indirect
go.opentelemetry.io/otel/sdk v1.41.0 // indirect
go.opentelemetry.io/otel/sdk/metric v1.41.0 // indirect
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions processor/metricstarttimeprocessor/metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
display_name: Metric Start Time Processor
type: metricstarttime
type: metric_start_time
deprecated_type: metricstarttime


description: |
The Metric Start Time Processor (`metricstarttime`) is used to set the start
The Metric Start Time Processor (`metric_start_time`) is used to set the start
time for metric points with a cumulative aggregation temporality. It is
commonly used with the `prometheus` receiver, which usually produces metric
points without a start time.
Expand Down
18 changes: 9 additions & 9 deletions processor/metricstarttimeprocessor/testdata/config.yaml
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
metricstarttime:
metric_start_time:

metricstarttime/subtract_initial_point:
metric_start_time/subtract_initial_point:
strategy: subtract_initial_point

metricstarttime/gc_interval:
metric_start_time/gc_interval:
gc_interval: 1h

metricstarttime/negative_interval:
metric_start_time/negative_interval:
gc_interval: -1h

metricstarttime/true_reset_point:
metric_start_time/true_reset_point:
strategy: true_reset_point

metricstarttime/start_time_metric:
metric_start_time/start_time_metric:
strategy: start_time_metric
start_time_metric_regex: "^.+_process_start_time_seconds$"

metricstarttime/invalid_regex:
metric_start_time/invalid_regex:
strategy: start_time_metric
start_time_metric_regex: "(((("

metricstarttime/invalid_strategy:
metric_start_time/invalid_strategy:
strategy: bad

metricstarttime/regex_with_subtract_initial_point:
metric_start_time/regex_with_subtract_initial_point:
strategy: subtract_initial_point
start_time_metric_regex: "^.+_process_start_time_seconds$"
2 changes: 1 addition & 1 deletion receiver/prometheusreceiver/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This component has the following feature gates:
| `receiver.prometheusreceiver.EnableNativeHistograms` | stable | Converts scraped Prometheus native histograms into OpenTelemetry exponential histograms. You still need to configure 'scrape_native_histograms: true' in your Prometheus scrape config to actually scrape native histograms. For mixed histograms (both classic and native), only the native histogram buckets are used. | v0.142.0 | v0.145.0 | [Link](https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/34473) |
| `receiver.prometheusreceiver.EnableReportExtraScrapeMetrics` | deprecated | Enables reporting of extra Prometheus scrape metrics. This gate is deprecated, use the `extra_scrape_metrics` Prometheus scrape configuration instead. | v0.143.0 | v0.148.0 | [Link](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/44181) |
| `receiver.prometheusreceiver.RemoveReportExtraScrapeMetricsConfig` | stable | This gate is always enabled and cannot be turned off. The 'report_extra_scrape_metrics' configuration option is always ignored. The extra scrape metrics are controlled by the EnableReportExtraScrapeMetrics feature gate, unless otherwise specified in the Prometheus scrape configuration. | v0.143.0 | v0.148.0 | [Link](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/44181) |
| `receiver.prometheusreceiver.RemoveStartTimeAdjustment` | stable | When enabled, the Prometheus receiver will leave the start time unset. Use the metricstarttime processor instead if you need this functionality. | v0.121.0 | v0.142.0 | [Link](https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/36364) |
| `receiver.prometheusreceiver.RemoveStartTimeAdjustment` | stable | When enabled, the Prometheus receiver will leave the start time unset. Use the metric_start_time processor instead if you need this functionality. | v0.121.0 | v0.142.0 | [Link](https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/36364) |
| `receiver.prometheusreceiver.UseCreatedMetric` | deprecated | When enabled, the Prometheus receiver will retrieve the start time for Summary, Histogram and Sum metrics from _created metric. | v0.89.0 | v0.141.0 | [Link](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/21909) |

For more information about feature gates, see the [Feature Gates](https://github.com/open-telemetry/opentelemetry-collector/blob/main/featuregate/README.md) documentation.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion receiver/prometheusreceiver/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ feature_gates:
stage: stable
description: >-
When enabled, the Prometheus receiver will leave the start time unset.
Use the metricstarttime processor instead if you need this functionality.
Use the metric_start_time processor instead if you need this functionality.
from_version: v0.121.0
to_version: v0.142.0
reference_url: https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/36364
Expand Down
2 changes: 1 addition & 1 deletion reports/distributions/contrib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ components:
- isolationforest
- k8s_attributes
- logdedup
- metric_start_time
- metricsgeneration
- metricstarttime
- metricstransform
- probabilistic_sampler
- redaction
Expand Down
Loading