-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Actuator content negotiation #1438
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, happy to see all the startup classes are gone.
Although we decided to change Steeltoe to not perform any content negotiation anymore, I'm concerned adding it later is going to be a breaking change. Therefore I opened #1445, which builds upon this PR.
src/Management/src/Endpoint/Actuators/Health/EndpointServiceCollectionExtensions.cs
Outdated
Show resolved
Hide resolved
src/Management/src/Endpoint/Actuators/Loggers/LoggersEndpointMiddleware.cs
Outdated
Show resolved
Hide resolved
src/Management/src/Endpoint/Actuators/ThreadDump/EndpointServiceCollectionExtensions.cs
Outdated
Show resolved
Hide resolved
writer.WriteStartObject(); | ||
|
||
foreach ((string detailKey, object detailValue) in value.Details) | ||
foreach (KeyValuePair<string, object> detail in value.Details) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please deconstruct into:
foreach ((string componentKey, object componentValue) in value.Details)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HealthConverter has been removed
health.Should().ContainKey("details"); | ||
var details = JsonSerializer.Deserialize<Dictionary<string, object>>(health!["details"].ToString()!); | ||
health.Should().ContainKey("components"); | ||
var details = JsonSerializer.Deserialize<Dictionary<string, object>>(health!["components"].ToString()!); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var details
var components
@@ -38,58 +38,22 @@ public static IServiceCollection AddThreadDumpActuator(this IServiceCollection s | |||
/// The incoming <paramref name="services" /> so that additional calls can be chained. | |||
/// </returns> | |||
public static IServiceCollection AddThreadDumpActuator(this IServiceCollection services, bool configureMiddleware) | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following note should be removed from the documentation at https://github.com/SteeltoeOSS/Documentation/blob/v4/api/v4/management/threaddump.md:
@@ -21,8 +21,7 @@ public sealed class EndpointMiddlewareTest : BaseTest | |||
{ | |||
["management:endpoints:enabled"] = "true", | |||
["management:endpoints:dump:enabled"] = "true", | |||
["management:endpoints:actuator:exposure:include:0"] = "threaddump", | |||
["management:endpoints:actuator:exposure:include:1"] = "dump" | |||
["management:endpoints:actuator:exposure:include:0"] = "threaddump" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find it confusing that we now have an actuator with the ID "threaddump" at /actuator/threaddump
, while its configuration key is management:endpoints:dump
, especially since we also have management:endpoints:heapdump
.
I'd like to propose changing the configuration key to match up (which is a breaking change that we should call out in the docs)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was planning to break things up a little, but this got big enough that it doesn't make sense to do separately so is now included
src/Management/test/Endpoint.Test/Actuators/ThreadDump/ThreadDumpEndpointTest.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the following tests:
- HealthActuator_ReturnsOnlyStatus
- HealthActuator_ReturnsOnlyStatus_WhenAuthorizedSetButUserIsNot
- HealthActuator_ReturnsDetailsWhenConfigured
The line:
health.Should().NotContainKey("details");
should be removed. Because details
is a child of components
, so it can never occur as a key in the health
dictionary.
And I think that comments like:
// {"status":"UP","components":{"diskSpace":{"status":"UP","details":{"total":1003588939776...
should be removed, because they are no longer correct. They add confusion as soon as the comment differs from a changed implementation, which we won't get any warnings/failures about.
a83dfac
to
50fdd11
Compare
Co-authored-by: Bart Koelman <104792814+bart-vmware@users.noreply.github.com>
…e same, single media type)
drop HealthConverter align probe contributor Ids with Spring disk contributor: add path and exists details, drop status Groups: - decouple default group and contributor names - use PostConfigure to set defaults
50fdd11
to
47d8e71
Compare
allow "v2" responses where SBA requires v2 and there is no real difference
80a3801
to
b127eee
Compare
Quality Gate passedIssues Measures |
Description
Now includes changes from #1445
Resolves #1335, Resolves #1367
Partially addresses #1440 (probes are still enabled by default, showDetails not investigated yet)
TODO:
Quality checklist
If your change affects other repositories, such as Documentation, Samples and/or MainSite, add linked PRs here.