Skip to content

fix(telemetry): created timestamps from the collector do not reach Prometheus, so increase() still drops the first export #2506

Description

@dan-petty

Problem Description

#2039 (pull request #2366) set export_created_metric: true on the collector's prometheus_remote_write exporter in k8s/otel/values.yaml, and enable-feature: created-timestamp-zero-ingestion on the Prometheus server in k8s/monitoring/prometheus-values.yaml. The comments there say that Prometheus then records a zero sample at the start of each counter series, so increase() counts the first export. Prometheus records no such sample. The collector sends remote write 1.0, which has no field for a created timestamp. docs/TELEMETRY.md says the same as the comments.

Reproduction Steps

  1. Confirm that both settings are live: the Prometheus server runs with --enable-feature=created-timestamp-zero-ingestion, and the collector's ConfigMap has export_created_metric: true (both since 2026-10-27).
  2. Query devops_cli_github_requests_total[1d] on 2026-10-28. The three series of job devops-cli that started on that day start at 1. No series has a zero sample.
  3. Query count(last_over_time({__name__=~"devops_cli_.*_created"}[10d])). It gives no result.

Expected vs Actual Behavior

Expected: a counter series from the collector starts with a zero sample, or the comments and docs/TELEMETRY.md do not say so. Actual: the first export of each series is not in increase(), and the comments and the document say that it is.

Source: #2496

Proposed design

Problem statement

The collector's prometheus_remote_write exporter uses remote write 1.0, which has no field for a created timestamp. The export_created_metric setting and the Prometheus created-timestamp-zero-ingestion feature do not connect, so Prometheus records no zero sample at the start of each counter series. increase() drops the first export of every series. The comments in both YAML files and docs/TELEMETRY.md state that the mechanism works, which is false.

Acceptance criteria

Requirement: Remote write 2.0 enabled

The collector's prometheus_remote_write exporter SHALL use remote write 2.0 so that created timestamps are transmitted in the payload.

Scenario: Exporter config uses version 2

  • WHEN The prometheus_remote_write exporter configuration in k8s/otel/values.yaml is read
  • THEN remote_write_version is set to 2 and export_created_metric is absent

Requirement: Zero sample recorded

Prometheus SHALL record a zero-value sample at the created timestamp of each cumulative counter series received via remote write 2.0.

Scenario: New series produces zero sample

  • WHEN A new counter series arrives through the collector to Prometheus
  • THEN A sample with value 0 exists at the series start timestamp, and count(last_over_time({name=~"devops_cli_.*_created"}[10d])) returns a result

Requirement: increase counts first export

increase() SHALL include the first export of a counter series that starts within the query window.

Scenario: Single-export series counted

  • WHEN A counter series has exactly one sample in the lookback window and a zero sample at its start
  • THEN increase() over that window returns the counter value, not zero

Requirement: Documentation accurate

docs/TELEMETRY.md and the YAML comments SHALL describe the created-timestamp mechanism using remote write 2.0, not remote write 1.0.

Scenario: Docs reference remote write 2.0

  • WHEN A reader consults docs/TELEMETRY.md or the comments in k8s/otel/values.yaml and k8s/monitoring/prometheus-values.yaml
  • THEN The text states that remote write 2.0 transmits the created timestamp and Prometheus records the zero sample

Existing Tool Considered

The OpenTelemetry Collector prometheus_remote_write exporter (otel/opentelemetry-collector-contrib) covers the need. It supports remote write 2.0, which transmits created timestamps natively in the OTLP payload. The current configuration uses remote write 1.0 (the default), which has no created-timestamp field. The fix is a configuration change to set remote_write_version to 2 and remove the now-unneeded export_created_metric flag.

Key questions

  • Which remote write version does the collector's prometheus_remote_write exporter currently use?: Remote write 1.0 (the default). The configuration in k8s/otel/values.yaml sets no remote_write_version key, so the exporter uses version 1, which has no created-timestamp field in the sample payload. [sources: k8s/otel/values.yaml:89]
  • Does the Prometheus server support receiving remote write 2.0?: Yes. The server already enables the created-timestamp-zero-ingestion feature, which is a Prometheus 3.x feature that reads created timestamps from the OTLP-based remote write 2.0 payload. The web.enable-remote-write-receiver flag is also set. [sources: k8s/monitoring/prometheus-values.yaml:22]
  • How should the collector transmit created timestamps to Prometheus?: Set remote_write_version to 2 on the prometheus_remote_write exporter. Remote write 2.0 uses the OTLP data model, which carries the created timestamp natively in each cumulative metric. Remove export_created_metric because it is a remote write 1.0 workaround that exports a separate _created metric, which Prometheus's created-timestamp-zero-ingestion feature does not read. (best practice) [sources: k8s/otel/values.yaml:97, k8s/monitoring/prometheus-values.yaml:22]
    • Chosen: Remote write 2.0 (OTLP-based). Transmits created timestamps natively in the payload. Prometheus's created-timestamp-zero-ingestion feature was designed to read them from this format. This is the standard mechanism.
    • Rejected: Keep remote write 1.0 and export_created_metric. Exports a separate _created metric, which Prometheus's zero-ingestion feature does not consume. The two settings do not connect. This is the current broken state.
    • Rejected: Remove both settings and correct documentation only. Admits the mechanism does not work and relies on the alert-rule workaround in fix(monitoring): the roadmap Service alerts count the first value of a new series and see a lane of a new pod #2505. Loses the zero-sample benefit for dashboards and any future queries that use increase() directly.
  • Which files must change?: k8s/otel/values.yaml (exporter config and comment), k8s/monitoring/prometheus-values.yaml (comment), and docs/TELEMETRY.md (mechanism description). [sources: k8s/otel/values.yaml:95, k8s/monitoring/prometheus-values.yaml:20, docs/TELEMETRY.md]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    status/new
    value/medium
    effort/medium
    on Oct 28, 2026
  2. dan-petty commented on Oct 28, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.

    • Type: type/bug. The documented zero-sample mechanism does not work because remote write 1.0 has no created timestamp field.
    • Priority: P2-Medium. Metrics are inaccurate for the first export of each series but the system still functions.
    • Value: Medium. The first data point of each counter series is lost in increase() calculations.
    • Effort: Medium. Fixing requires either upgrading to remote write 2.0 or correcting multiple documentation references.
    • Related: fix(monitoring): the roadmap Service alerts count the first value of a new series and see a lane of a new pod #2505, which asks for a different change. Both address the missing zero sample that causes increase() to drop the first export, but the candidate fixes the telemetry pipeline or docs while 2505 fixes the alert rules.
  3. added
    priority/p2-medium
    on Oct 28, 2026
  4. added
    status/ready
    and removed
    status/new
    on Oct 29, 2026
  5. devops-cli-service commented on Oct 29, 2026

    @devops-cli-service
    Contributor

    Status set to Ready at 0f7bc26 (see proposed design in issue body).

  6. added 2 commits that reference this issue on Oct 29, 2026
    e84a643
    aba6069
  7. removed
    status/ready
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p2-mediumsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions