diff --git a/src/HealthChecks.Prometheus.Metrics/LivenessPrometheusMetrics.cs b/src/HealthChecks.Prometheus.Metrics/LivenessPrometheusMetrics.cs index 1a3d3dd805..13b646090e 100644 --- a/src/HealthChecks.Prometheus.Metrics/LivenessPrometheusMetrics.cs +++ b/src/HealthChecks.Prometheus.Metrics/LivenessPrometheusMetrics.cs @@ -5,7 +5,7 @@ namespace HealthChecks.Prometheus.Metrics; public abstract class LivenessPrometheusMetrics { - protected const string CONTENT_TYPE = "text/plain; version=0.0.4"; + protected const string CONTENT_TYPE = PrometheusConstants.TextContentTypeWithVersionAndEncoding; private const string HEALTH_CHECK_LABEL_NAME = "healthcheck"; private readonly Gauge _healthChecksDuration; private readonly Gauge _healthChecksResult; diff --git a/src/HealthChecks.Publisher.Prometheus/LivenessPrometheusMetrics.cs b/src/HealthChecks.Publisher.Prometheus/LivenessPrometheusMetrics.cs index 2ef0a88a31..956272d4c7 100644 --- a/src/HealthChecks.Publisher.Prometheus/LivenessPrometheusMetrics.cs +++ b/src/HealthChecks.Publisher.Prometheus/LivenessPrometheusMetrics.cs @@ -5,7 +5,7 @@ namespace HealthChecks.Publisher.Prometheus; public abstract class LivenessPrometheusMetrics { - protected const string CONTENT_TYPE = "text/plain; version=0.0.4"; + protected const string CONTENT_TYPE = PrometheusConstants.TextContentTypeWithVersionAndEncoding; private const string HEALTH_CHECK_LABEL_NAME = "healthcheck"; private readonly Gauge _healthChecksDuration; private readonly Gauge _healthChecksResult; diff --git a/test/HealthChecks.Prometheus.Metrics.Tests/HealthChecks.Prometheus.Metrics.approved.txt b/test/HealthChecks.Prometheus.Metrics.Tests/HealthChecks.Prometheus.Metrics.approved.txt index 61a6663466..aa75eb6308 100644 --- a/test/HealthChecks.Prometheus.Metrics.Tests/HealthChecks.Prometheus.Metrics.approved.txt +++ b/test/HealthChecks.Prometheus.Metrics.Tests/HealthChecks.Prometheus.Metrics.approved.txt @@ -2,7 +2,7 @@ namespace HealthChecks.Prometheus.Metrics { public abstract class LivenessPrometheusMetrics { - protected const string CONTENT_TYPE = "text/plain; version=0.0.4"; + protected const string CONTENT_TYPE = "text/plain; version=0.0.4; charset=utf-8"; protected readonly Prometheus.CollectorRegistry Registry; protected void WriteMetricsFromHealthReport(Microsoft.Extensions.Diagnostics.HealthChecks.HealthReport report) { } } diff --git a/test/HealthChecks.Publisher.Prometheus.Tests/HealthChecks.Publisher.Prometheus.approved.txt b/test/HealthChecks.Publisher.Prometheus.Tests/HealthChecks.Publisher.Prometheus.approved.txt index 3fe7136602..d80ec8a8c4 100644 --- a/test/HealthChecks.Publisher.Prometheus.Tests/HealthChecks.Publisher.Prometheus.approved.txt +++ b/test/HealthChecks.Publisher.Prometheus.Tests/HealthChecks.Publisher.Prometheus.approved.txt @@ -2,7 +2,7 @@ namespace HealthChecks.Publisher.Prometheus { public abstract class LivenessPrometheusMetrics { - protected const string CONTENT_TYPE = "text/plain; version=0.0.4"; + protected const string CONTENT_TYPE = "text/plain; version=0.0.4; charset=utf-8"; protected readonly Prometheus.CollectorRegistry Registry; protected void WriteMetricsFromHealthReport(Microsoft.Extensions.Diagnostics.HealthChecks.HealthReport report) { } }