diff --git a/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/PrometheusExporterOptions.cs b/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/PrometheusExporterOptions.cs index bf7576117b1..248b991f4c5 100644 --- a/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/PrometheusExporterOptions.cs +++ b/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/PrometheusExporterOptions.cs @@ -25,7 +25,7 @@ public class PrometheusExporterOptions { internal const string DefaultScrapeEndpointPath = "/metrics"; - private int scrapeResponseCacheDurationMilliseconds = 10 * 1000; + private int scrapeResponseCacheDurationMilliseconds = 300; /// /// Gets or sets the path to use for the scraping endpoint. Default value: "/metrics". @@ -33,7 +33,7 @@ public class PrometheusExporterOptions public string ScrapeEndpointPath { get; set; } = DefaultScrapeEndpointPath; /// - /// Gets or sets the cache duration in milliseconds for scrape responses. Default value: 10,000 (10 seconds). + /// Gets or sets the cache duration in milliseconds for scrape responses. Default value: 300. /// /// /// Note: Specify 0 to disable response caching. diff --git a/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/README.md b/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/README.md index 855c20637a6..d9cb8bfdc1a 100644 --- a/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/README.md +++ b/src/OpenTelemetry.Exporter.Prometheus.AspNetCore/README.md @@ -15,15 +15,15 @@ to scrape. ### Step 1: Install Package -Install - ```shell dotnet add package OpenTelemetry.Exporter.Prometheus.AspNetCore ``` ### Step 2: Configure OpenTelemetry MeterProvider -* When using OpenTelemetry.Extensions.Hosting package on .NET Core 3.1+: +* When using + [OpenTelemetry.Extensions.Hosting](../OpenTelemetry.Extensions.Hosting/README.md) + package on .NET Core 3.1+: ```csharp services.AddOpenTelemetryMetrics(builder => @@ -34,7 +34,7 @@ dotnet add package OpenTelemetry.Exporter.Prometheus.AspNetCore * Or configure directly: - Call the `AddPrometheusExporter` `MeterProviderBuilder` extension to + Call the `MeterProviderBuilder.AddPrometheusExporter` extension to register the Prometheus exporter. ```csharp @@ -94,8 +94,7 @@ registered by Configures scrape endpoint response caching. Multiple scrape requests within the cache duration time period will receive the same previously generated response. -The default value is `10000` (10 seconds). Set to `0` to disable response -caching. +The default value is `300`. Set to `0` to disable response caching. ## Troubleshooting