From fb6a54672b29fc8bc406e5f4fd20e1860f7e56a9 Mon Sep 17 00:00:00 2001 From: Tom Kerkhove Date: Fri, 14 Aug 2020 17:13:52 +0200 Subject: [PATCH] Ensure Prometheus metric sink does write timestamps (#1217) (#1218) --- changelog/content/experimental/unreleased.md | 1 + config/promitor/scraper/runtime.yaml | 4 ++-- .../Extensions/IServiceCollectionExtensions.cs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/changelog/content/experimental/unreleased.md b/changelog/content/experimental/unreleased.md index 7cc0a17d7..822019aca 100644 --- a/changelog/content/experimental/unreleased.md +++ b/changelog/content/experimental/unreleased.md @@ -24,6 +24,7 @@ version: queue name. [#529](https://github.com/tomkerkhove/promitor/issues/529). - {{% tag changed %}} Handle validation failures on startup more gracefully. [#1113](https://github.com/tomkerkhove/promitor/issues/1113). - {{% tag changed %}} Improve time series handling to ensure finalized time series are reported +- {{% tag fixed %}} Ensure Prometheus metric sink does write timestamps [#1217](https://github.com/tomkerkhove/promitor/issues/1217). - {{% tag removed %}} Support for Prometheus legacy configuration ([deprecation notice](https://changelog.promitor.io/#prometheus-legacy-configuration) | [migration guide](https://promitor.io/walkthrough/migrate-from-1.x-to-2.x)) - {{% tag removed %}} Support for Swagger UI 2.0 ([deprecation notice](https://changelog.promitor.io/#swagger-ui-2-0) | diff --git a/config/promitor/scraper/runtime.yaml b/config/promitor/scraper/runtime.yaml index 833b30fe7..0a99dba85 100644 --- a/config/promitor/scraper/runtime.yaml +++ b/config/promitor/scraper/runtime.yaml @@ -2,9 +2,9 @@ server: httpPort: 88 metricSinks: prometheusScrapingEndpoint: - metricUnavailableValue: NaN + metricUnavailableValue: -1 enableMetricTimestamps: true # true by default - baseUriPath: /metrics + baseUriPath: /scrape statsd: host: graphite port: 8125 diff --git a/src/Promitor.Agents.Scraper/Extensions/IServiceCollectionExtensions.cs b/src/Promitor.Agents.Scraper/Extensions/IServiceCollectionExtensions.cs index 481be2adf..96d36b1c4 100644 --- a/src/Promitor.Agents.Scraper/Extensions/IServiceCollectionExtensions.cs +++ b/src/Promitor.Agents.Scraper/Extensions/IServiceCollectionExtensions.cs @@ -155,7 +155,7 @@ public static IServiceCollection ConfigureYamlConfiguration(this IServiceCollect services.Configure(configuration.GetSection("resourceDiscovery")); services.Configure(configuration.GetSection("telemetry")); services.Configure(configuration.GetSection("server")); - services.Configure(configuration.GetSection("metricSinks:prometheus")); + services.Configure(configuration.GetSection("metricSinks:prometheusScrapingEndpoint")); services.Configure(configuration.GetSection("metricSinks:statsd")); services.Configure(configuration.GetSection("metricSinks:atlassianStatuspage")); services.Configure(configuration.GetSection("telemetry:applicationInsights"));