Skip to content

Conversation

ridwanmsharif
Copy link

This change does the following:

  • Add an interface to append a sample with CT
  • Update headAppender and initAppender to implement AppendWithCT
  • Update the RefSample to include CT
  • Update the scrape loop to add the CT to samples when CT is enabled

This change doesn't update the remote storage wlog watcher to make use of the new CT feild in the RefSample, but that can be done in a following PR.

We should compare using benchmarks how this compares to adding the CT to the metadata (which also goes in the WAL)

type AppenderWithCT interface {
Appender

AppendWithCT(ref SeriesRef, l labels.Labels, t int64, v float64, ct int64) (SeriesRef, error)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added an alternative implementation that doesn't add an interface in #15255 but its uglier IMO. I had another draft that tried to use options to do this but import cycles and other issues made that approach untennable.

cc @bwplotka @ArthurSens

@github-actions github-actions bot added the stale label Dec 30, 2024
This change does the following:
- Add an interface to append a sample with CT
- Update headAppender and initAppender to implement AppendWithCT
- Update the RefSample to include CT
- Update the scrape loop to add the CT to samples when CT is enabled

This change doesn't update the remote storage wlog watcher to make use
of the new CT feild in the RefSample, but that can be done in a
following PR.

We should compare using benchmarks how this compares to adding the CT to
the metadata (which also goes in the WAL)

Signed-off-by: Ridwan Sharif <ridwanmsharif@google.com>
@ridwanmsharif ridwanmsharif force-pushed the ridwanmsharif/ct-wal-sample-new-ct-append-interface branch from 1794995 to 10c6c0f Compare January 28, 2025 21:03
@github-actions github-actions bot removed the stale label Jan 28, 2025
Signed-off-by: Ridwan Sharif <ridwanmsharif@google.com>
@ridwanmsharif ridwanmsharif force-pushed the ridwanmsharif/ct-wal-sample-new-ct-append-interface branch from 2efa134 to 154daca Compare January 29, 2025 23:02
@ridwanmsharif
Copy link
Author

/prombench main --bench.version=bench/protofirst

@prombot
Copy link
Contributor

prombot commented Jan 29, 2025

@ridwanmsharif is not a org member nor a collaborator and cannot execute benchmarks.

@ridwanmsharif
Copy link
Author

/prombench main --bench.version=bench/protofirst

@bwplotka mind running the earlier command on the PR :)

@bwplotka
Copy link
Member

This is not so simple, I got stuck with this scenario development due to metadata bug (now should be fixed, but you need to rebase), sink lack of CT checks (now fixed & released, but I need to update prombench). I need to also think how to test it e.g. we never compared metadata-wal-records on/off, so comparing one Prometheus WITHOUT metadata-wal-records feature and second WITH plus CT in sample will give us a lot of unknowns.

Will try to progress on this today.

@bwplotka
Copy link
Member

/prombench main --bench.version=bench/cross-feature/ct

@prombot
Copy link
Contributor

prombot commented Jan 30, 2025

⏱️ Welcome to Prometheus Benchmarking Tool. ⏱️

Compared versions: PR-15254 and main

Custom benchmark version: bench/cross-feature/ct branch

After the successful deployment (check status here), the benchmarking results can be viewed at:

Available Commands:

  • To restart benchmark: /prombench restart main --bench.version=bench/cross-feature/ct
  • To stop benchmark: /prombench cancel
  • To print help: /prombench help

@bwplotka
Copy link
Member

bwplotka commented Jan 30, 2025

Quickly crafted some scenario description, likely have some bugs.. let's see.

@bwplotka
Copy link
Member

/prombench restart main --bench.version=bench/cross-feature/ct

@prombot
Copy link
Contributor

prombot commented Jan 30, 2025

⏱️ Welcome (again) to Prometheus Benchmarking Tool. ⏱️

Compared versions: PR-15254 and main

Custom benchmark version: bench/cross-feature/ct branch

After successful deployment (check status here), the benchmarking results can be viewed at:

Available Commands:

  • To restart benchmark: /prombench restart main --bench.version=bench/cross-feature/ct
  • To stop benchmark: /prombench cancel
  • To print help: /prombench help

@bwplotka
Copy link
Member

/prombench main --bench.version=bench/cross-feature/ct

@prombot
Copy link
Contributor

prombot commented Jan 30, 2025

⏱️ Welcome to Prometheus Benchmarking Tool. ⏱️

Compared versions: PR-15254 and main

Custom benchmark version: bench/cross-feature/ct branch

After the successful deployment (check status here), the benchmarking results can be viewed at:

Available Commands:

  • To restart benchmark: /prombench restart main --bench.version=bench/cross-feature/ct
  • To stop benchmark: /prombench cancel
  • To print help: /prombench help

@bwplotka
Copy link
Member

Ok, sink does not see any CTs.


time=2025-01-30T13:59:20.854Z level=WARN msg="received remote write request with some issues" source=test-pr proto=io.prometheus.write.v2.Request series=2000 samples=2000 histograms=0 exemplars=0 details="series codelab_api_request_duration_seconds_bucket{instance=\"10.52.19.35:8081\", job=\"fake-webservers-18\", le=\"1.683411219602823\", method=\"GET\", nodeName=\"gke-test-infra-nodes-15254-d01405b9-zhvd\", path=\"/api/boom\", status=\"500\"}: no created timestamp\n,series codelab_api_request_duration_seconds_bucket{instance=\"10.52.19.35:8081\", job=\"fake-webservers-18\", le=\"+Inf\", method=\"GET\", nodeName=\"gke-test-infra-nodes-15254-d01405b9-zhvd\", path=\"/api/boom\", status=\"500\"}: no created timestamp\n,series codelab_api_request_duration_seconds_bucket{instance=\"10.52.19.35:8081\", job=\"fake-webservers-18\", le=\"0.00015000000000000001\", method=\"GET\", nodeName=\"gke-test-infra-nodes-15254-d01405b9-zhvd\", path=\"/api/foo\", status=\"200\"}: no created timestamp\n,series codelab_api_request_duration_seconds_bucket{instance=\"10.52.19.35:8081\", job=\"fake-webservers-18\", le=\"0.00022500000000000002\", method=\"GET\", nodeName=\"gke-test-infra-nodes-15254-d01405b9-zhvd\", path=\"/api/foo\", status=\"200\"}: no created timestamp\n,series codelab_api_request_duration_seconds_sum{instance=\"10.52.19.35:8081\", job=\"fake-webservers-18\", method=\"GET\", nodeName=\"gke-test-infra-nodes-15254-d01405b9-zhvd\", path=\"/api/foo\", status=\"200\"}: no created timestamp\n,series codelab_api_request_duration_seconds_bucket{instance=\"10.52.19.35:8081\", job=\"fake-webservers-18\", le=\"0.0001\", method=\"GET\", nodeName=\"gke-test-infra-nodes-15254-d01405b9-zhvd\", path=\"/api/foo\", status=\"200\"}: no created timestamp\n,series codelab_api_request_duration_seconds_bucket{instance=\"10.52.19.35:8081\", job=\"fake-webservers-18\", le=\"0.49878850951194753\", method=\"GET\", nodeName=\"gke-test-infra-nodes-15254-d01405b9-zhvd\", path=\"/api/boom\", status=\"500\"}: no created timestamp\n,series codelab_api_request_duration_seconds_bucket{instance=\"10.52.19.35:8081\", job=\"fake-webservers-18\", le=\"0.7481827642679213\", method=\"GET\", nodeName=\"gke-test-infra-nodes-15254-d01405b9-zhvd\", path=\"/api/boom\", status=\"500\"}: no created timestamp\n,series codelab_api_request_duration_seconds_bucket{instance=\"10.52.19.35:8081\", job=\"fake-webservers-18\", le=\"1.122274146401882\", method=\"GET\", nodeName=\"gke-test-infra-nodes-15254-d01405b9-zhvd\", path=\"/api/boom\", status=\"500\"}: no created timestamp\n,series codelab_api_request_duration_seconds_count{instance=\"10.52.19.35:8081\", job=\"fake-webservers-18\", method=\"GET\", nodeName=\"gke-test-infra-nodes-15254-d01405b9-zhvd\", path=\"/api/foo\", status=\"200\"}: no created timestamp\n" series-without-unit=1980 cumulative-without-ct=1852

Looks like I forgot to enable created-timestamp-zero-ingestion feature... This really has to be another flag, quite confusing.

@bwplotka
Copy link
Member

/prombench restart main --bench.version=bench/cross-feature/ct

@prombot
Copy link
Contributor

prombot commented Jan 30, 2025

⏱️ Welcome (again) to Prometheus Benchmarking Tool. ⏱️

Compared versions: PR-15254 and main

Custom benchmark version: bench/cross-feature/ct branch

After successful deployment (check status here), the benchmarking results can be viewed at:

Available Commands:

  • To restart benchmark: /prombench restart main --bench.version=bench/cross-feature/ct
  • To stop benchmark: /prombench cancel
  • To print help: /prombench help

@bwplotka
Copy link
Member

image

var ct int64
var appWithCT storage.AppenderWithCT
var canEncodeCT bool

if sl.enableCTZeroIngestion {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's maybe create another feature flag as ageed.

@bwplotka
Copy link
Member

/prombench cancel

@prombot
Copy link
Contributor

prombot commented Jan 31, 2025

Benchmark cancel is in progress.

bwplotka pushed a commit that referenced this pull request Feb 17, 2025
Fixes #14218 and #14220

Rebased version of #15254 with improvements.

This change does the following:
- Change appender interface to be CT aware (optional CT)
- Add created-timestamp-per-sample feature flag
- Add new sample record used only if CT is appended with the sample.
- Remote Write awareness of CT.

Signed-off-by: Ridwan Sharif <ridwanmsharif@google.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
@bwplotka
Copy link
Member

bwplotka commented Feb 17, 2025

Thanks! Superseded with #16046 - as discussed internally.

@bwplotka bwplotka closed this Feb 17, 2025
bwplotka pushed a commit that referenced this pull request Feb 17, 2025
Fixes #14218 and #14220

Rebased version of #15254 with improvements.

This change does the following:
- Change appender interface to be CT aware (optional CT)
- Add created-timestamp-per-sample feature flag
- Add new sample record used only if CT is appended with the sample.
- Remote Write awareness of CT.

Signed-off-by: Ridwan Sharif <ridwanmsharif@google.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
bwplotka pushed a commit that referenced this pull request Feb 17, 2025
Fixes #14218 and #14220

Rebased version of #15254 with improvements.

This change does the following:
- Change appender interface to be CT aware (optional CT)
- Add created-timestamp-per-sample feature flag
- Add new sample record used only if CT is appended with the sample.
- Remote Write awareness of CT.

Signed-off-by: Ridwan Sharif <ridwanmsharif@google.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
bwplotka pushed a commit that referenced this pull request Feb 17, 2025
Fixes #14218 and #14220

Rebased version of #15254 with improvements.

This change does the following:
- Change appender interface to be CT aware (optional CT)
- Add created-timestamp-per-sample feature flag
- Add new sample record used only if CT is appended with the sample.
- Remote Write awareness of CT.

Signed-off-by: Ridwan Sharif <ridwanmsharif@google.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
bwplotka pushed a commit that referenced this pull request Feb 17, 2025
Fixes #14218 and #14220

Rebased version of #15254 with improvements.

This change does the following:
- Change appender interface to be CT aware (optional CT)
- Add created-timestamp-per-sample feature flag
- Add new sample record used only if CT is appended with the sample.
- Remote Write awareness of CT.

Signed-off-by: Ridwan Sharif <ridwanmsharif@google.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
bwplotka pushed a commit that referenced this pull request Feb 17, 2025
Fixes #14218 and #14220

Rebased version of #15254 with improvements.

This change does the following:
- Change appender interface to be CT aware (optional CT)
- Add created-timestamp-per-sample feature flag
- Add new sample record used only if CT is appended with the sample.
- Remote Write awareness of CT.

Signed-off-by: Ridwan Sharif <ridwanmsharif@google.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
bwplotka pushed a commit that referenced this pull request Feb 17, 2025
Fixes #14218 and #14220

Rebased version of #15254 with improvements.

This change does the following:
- Change appender interface to be CT aware (optional CT)
- Add created-timestamp-per-sample feature flag
- Add new sample record used only if CT is appended with the sample.
- Remote Write awareness of CT.

Signed-off-by: Ridwan Sharif <ridwanmsharif@google.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>
bwplotka pushed a commit that referenced this pull request Feb 28, 2025
Fixes #14218 and #14220

Rebased version of #15254 with improvements.

This change does the following:
- Change appender interface to be CT aware (optional CT)
- Add created-timestamp-per-sample feature flag
- Add new sample record used only if CT is appended with the sample.
- Remote Write awareness of CT.

Signed-off-by: Ridwan Sharif <ridwanmsharif@google.com>
Signed-off-by: bwplotka <bwplotka@gmail.com>

# Conflicts:
#	cmd/prometheus/main.go
#	scrape/helpers_test.go
#	storage/remote/write_handler_test.go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants