Skip to content
Discussion options

You must be logged in to vote

I wonder, why do the labels matter so much? Yes, they contain some identifiable information, but they are not meant as structured data.

To be honest, my current suggestion would be subclassing and implementing different __repr__ methods. Something like:

return json.dumps({
   field.name: getattr(self, field.name)
    for field in dataclasses.fields(self)
    if field.repr
}

However, I don't really want to change how Python decides to represent dataclasses and this package provides health checks and isn't a monitoring suite. This might go beyond the scope of this package.

Replies: 1 comment 13 replies

Comment options

You must be logged in to vote
13 replies
@codingjoe
Comment options

@christianwgd
Comment options

@janheussner
Comment options

@codingjoe
Comment options

Answer selected by codingjoe
@janheussner
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #629 on February 12, 2026 14:20.