Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

ingest_delay=true not working for some metrics

Aperta
#442 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
gcp, go, prometheus

Direzione di ricerca

Inizia tracciando il percorso del Go GCP exporter che legge i metadati ingestDelay, usando stackdriver_bigquery_dataset_bigquery_googleapis_com_storage_uploaded_bytes come caso di riproduzione. Confronta il relativo timestamp esportato con quello di altre metriche ritardate quando ingest_delay=true; il lavoro è completato quando questa metrica ha un timestamp coerente senza compromettere le metriche che già funzionano.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Problem: the exporter doesn't fix metric timestamp for all delayed metrics

Expected: ingest_delay works for all GCP metrics which have ingestDelay metadata available from the GCP API

When using the [gcp/stackdriver exporter], (https://grafana.com/docs/alloy/latest/reference/components/prometheus/prometheus.exporter.gcp/) with ingest_delay=true, at least some of the publisher-delayed metrics still don't appear as expected. Setting ingest_delay=true fixes timestamps for most delayed metrics but not all.

Example affected metric: stackdriver_bigquery_dataset_bigquery_googleapis_com_storage_uploaded_bytes

This seems to be an exporter issue, because the offset time is visible when visiting exporter endpoint directly and checking timestamps. This metric alone has the old timestamp, other metrics behave as expected.

This metric has the expected notice in GCP docs: "After sampling, data is not visible for up to 21720 seconds"

I also verified that the metric has this metadata and should be respected by the exporter. Here's the metric descriptor:

# List all BigQuery metric descriptors
curl -H "Authorization: Bearer $(gcloud auth print-access-token)" \
     "https://monitoring.googleapis.com/v3/projects/my-project-id/metricDescriptors?filter=metric.type%3Dstarts_with(%22bigquery.googleapis.com%22)"

    {
      "name": "projects/my-project/metricDescriptors/bigquery.googleapis.com/storage/uploaded_bytes",
      "labels": [
        {
          "key": "api",
          "description": "Api used to upload the data (batch import or streaming)"
        },
        {
          "key": "table",
          "description": "Table name."
        }
      ],
      "metricKind": "DELTA",
      "valueType": "INT64",
      "unit": "By",
      "description": "Uploaded bytes.",
      "displayName": "Uploaded bytes",
      "type": "bigquery.googleapis.com/storage/uploaded_bytes",
      "metadata": {
        "launchStage": "GA",
        "samplePeriod": "60s",
        "ingestDelay": "21720s",
        "timeSeriesResourceHierarchyLevel": [
          "PROJECT"
        ]
      },
      "launchStage": "GA",
      "monitoredResourceTypes": [
        "bigquery_dataset"
      ]
    },

However, despite the presence of this metadata and setting ingest_delay=true, the metric is not scraped by the collector because its timestamp is always 6 hours old in the GCP exporter.

Workaround: in the Alloy collector, scrape the exporter twice, use honor_timestamps to further control the timestamp to set it to current time for this one metric. This works for now:

prometheus.scrape "test_exporter_main" {
  targets = [
    {"__address__" = "localhost:8081"},
  ]
  honor_timestamps = true
  forward_to = [prometheus.relabel.filter_main.receiver]
}

prometheus.scrape "test_exporter_lagging" {
  targets = [
    {"__address__" = "localhost:8081"},
  ]
  honor_timestamps = false
  forward_to = [prometheus.relabel.filter_lagging.receiver]
}

prometheus.relabel "filter_main" {
  rule {
    source_labels = ["__name__"]
    regex = "old_metric_with_past_timestamp"
    action = "drop"
  }
  forward_to = [prometheus.remote_write.metrics_service.receiver]
}

prometheus.relabel "filter_lagging" {
  rule {
    source_labels = ["__name__"]
    regex = "old_metric_with_past_timestamp"
    action = "keep"
  }
  forward_to = [prometheus.remote_write.metrics_service.receiver]
}

Please let me know if I can provide more information about this issue. Thank you!

Lingua principale
Go
Stelle
298
Fork
119
Merge medio
4g 8h
PR unite (30g)
8

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di prometheus-community/stackdriver_exporter

Tutte le issue di prometheus-community/stackdriver_exporter

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.