Skip to content

Commit

Permalink
Merge branch 'main' into meterprovider-dependencyinjection
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeBlanch authored Sep 12, 2022
2 parents 88b20cf + cea14d3 commit 91494c5
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/OpenTelemetry.Exporter.Prometheus.AspNetCore/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

* Bug fix for Prometheus Exporter reporting StatusCode 204
instead of 200, when no metrics are collected
([#3643](https://github.com/open-telemetry/opentelemetry-dotnet/pull/3643))

## 1.4.0-alpha.2

Released 2022-Aug-18
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public async Task InvokeAsync(HttpContext httpContext)
else
{
// It's not expected to have no metrics to collect, but it's not necessarily a failure, either.
response.StatusCode = 204;
response.StatusCode = 200;
PrometheusExporterEventSource.Log.NoMetrics();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

* Bug fix for Prometheus Exporter reporting StatusCode 204
instead of 200, when no metrics are collected
([#3643](https://github.com/open-telemetry/opentelemetry-dotnet/pull/3643))

## 1.4.0-alpha.2

Released 2022-Aug-18
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ private async Task ProcessRequestAsync(HttpListenerContext context)
else
{
// It's not expected to have no metrics to collect, but it's not necessarily a failure, either.
context.Response.StatusCode = 204;
context.Response.StatusCode = 200;
PrometheusExporterEventSource.Log.NoMetrics();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ private static async Task RunPrometheusExporterMiddlewareIntegrationTest(
}
else
{
Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
}

validateResponse?.Invoke(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private async Task RunPrometheusExporterHttpServerIntegrationTest(bool skipMetri
}
else
{
Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
}
}
}
Expand Down

0 comments on commit 91494c5

Please sign in to comment.