Skip to content

Commit

Permalink
Prometheus - Wrong Encoding used by the browser (#1695)
Browse files Browse the repository at this point in the history
  • Loading branch information
k0st1x authored Feb 22, 2023
1 parent 73b922e commit 9bc509d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) { }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) { }
}
Expand Down

0 comments on commit 9bc509d

Please sign in to comment.