Skip to content

Immutable configuration properties not shown by Actuator #18636

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

Closed
AlexFalappa opened this issue Oct 17, 2019 · 6 comments
Closed

Immutable configuration properties not shown by Actuator #18636

AlexFalappa opened this issue Oct 17, 2019 · 6 comments
Assignees
Labels
type: bug A general bug
Milestone

Comments

@AlexFalappa
Copy link
Contributor

AlexFalappa commented Oct 17, 2019

From my initial test drive of the freshly released Spring Boot 2.2.0.RELEASE it seems that @ConfigurationProperties beans declared as immutable with @ConstructorBinding show up empty in the Actuator configprops endpoint.
Example:

"ftp-af.FtpProperties": {
  "prefix": "ftp",
  "properties": {}
}

The beans are however correctly bound and their use in other beans is not impacted.

Normal, mutable beans are correctly displayed with their attributes.
Example:

"ftp-af.FtpProperties": {
  "prefix": "ftp",
  "properties": {
    "host": "andromeda",
    "dir": "/path/to/files",
    "user": "JohnSmith",
    "port": 2121,
    "passw": "Unknown"
  }
}
@snicoll
Copy link
Member

snicoll commented Oct 17, 2019

Oops. Thanks for the report!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Oct 17, 2019
@snicoll snicoll added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Oct 17, 2019
@snicoll snicoll added this to the 2.2.1 milestone Oct 17, 2019
@rhamedy
Copy link
Contributor

rhamedy commented Oct 18, 2019

@snicoll is this feasible for contribution?

I have used actuator endpoint before; however, I don't know how it works under the hood. I am curious how complicated is this task? If open for contribution, I would love to give it a shot. I would appreciate some direction in the form of guidance, previous issues/PRs I could look into, materials, classes, etc.

@snicoll
Copy link
Member

snicoll commented Oct 18, 2019

@rhamedy it's really hard to answer such question without looking at the actual problem and often we have the solution by the time we're experimenting. This one is extra special as it's assigned to 2.2.1 which we intend to release relatively soon-ish and I really would like to get that fixed.

If you have time short term, I believe the problem is this method that serializes the content of the configuration properties instance. For some reason that doesn't work if there isn't a setter? Wild guess, I haven't looked at it in more details.

If you want to contribute, we have an ideal-for-contribution label on the issue tracker.

@polarbear567
Copy link
Contributor

@snicoll I think we can use other conversion methods here.

@rhamedy
Copy link
Contributor

rhamedy commented Oct 21, 2019

Thank you both (snicoll and wilkinsona) for the comment. If not mistaken, @polarbear567 seems to have already made a PR for this issue #18659. If the PR is not related, then apologies for linking it.

I think snicoll made some good points about complexity and urgency. It would be best for me to await another opportunity to work on Actuator 🤞

snicoll added a commit to snicoll/spring-boot that referenced this issue Oct 22, 2019
This commit updates the configprops actuator endpoint to detect
configuration properties that are bound using a constructor.

See spring-projectsgh-18636
@snicoll snicoll self-assigned this Oct 22, 2019
@snicoll
Copy link
Member

snicoll commented Oct 22, 2019

I've started to hack on something in 353a30f and I've discovered some potential improvements in constructor binding in the process (#18685). I have something somewhat satisfactory except that nested types are not processed. It looks like Jackson decides that there is nothing do as there are no properties or something like that? There is a test failing on that commit.

@philwebb philwebb modified the milestones: 2.2.1, 2.2.x Oct 23, 2019
@snicoll snicoll modified the milestones: 2.2.x, 2.2.1 Oct 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

6 participants