Skip to content
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

structured logging: refactor logic of MonitoredResourceUtil#getValue() to avoid long switch #710

Closed
minherz opened this issue Oct 14, 2021 · 0 comments · Fixed by #716
Closed
Assignees
Labels
api: logging Issues related to the googleapis/java-logging API. lang: java Issues specific to Java. type: cleanup An internal cleanup or hygiene concern.

Comments

@minherz
Copy link
Contributor

minherz commented Oct 14, 2021

Current implementation (see #685) of MonitoredResourceUtil#getValue() is hard to maintain or understand. The code should be refactored, so each label is built in the designated function.
One of possible approaches would be using a visitor pattern.

Such change will simplify further maintenance (e.g. adding new labels) as well as exposing this functionality for external use.

@product-auto-label product-auto-label bot added the api: logging Issues related to the googleapis/java-logging API. label Oct 14, 2021
@minherz minherz assigned minherz and unassigned simonz130 Oct 14, 2021
@minherz minherz added lang: java Issues specific to Java. type: cleanup An internal cleanup or hygiene concern. labels Oct 14, 2021
@minherz minherz changed the title chore: refactor logic of MonitoredResourceUtil#getValue() to avoid long switch structured logging: refactor logic of MonitoredResourceUtil#getValue() to avoid long switch Oct 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: logging Issues related to the googleapis/java-logging API. lang: java Issues specific to Java. type: cleanup An internal cleanup or hygiene concern.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants