Repository navigation
refactor: use plural logs to match otel - #1160
Conversation
Signed-off-by: AngeloDanducci <[email protected]>
jakelorocco
left a comment
There was a problem hiding this comment.
lgtm; suggested a change if you deem it necessary
| legacy_url = os.environ.get("MELLEA_LOG_WEBHOOK", "").strip() | ||
| if legacy_url: | ||
| warnings.warn( | ||
| "MELLEA_LOG_WEBHOOK is deprecated and will be removed in a future release. " | ||
| "Use MELLEA_LOGS_WEBHOOK instead.", | ||
| DeprecationWarning, | ||
| stacklevel=4, | ||
| ) | ||
| return legacy_url | ||
|
|
There was a problem hiding this comment.
Just to confirm, the stacklevel is set to 4 here since this is called by the configure_logging function, giving it +1 depth from the other calls?
| json_raw = os.environ.get("MELLEA_LOGS_JSON") | ||
| if json_raw is None: | ||
| legacy = os.environ.get("MELLEA_LOG_JSON", "") | ||
| if legacy: | ||
| warnings.warn( | ||
| "MELLEA_LOG_JSON is deprecated and will be removed in a future release. " | ||
| "Use MELLEA_LOGS_JSON instead.", | ||
| DeprecationWarning, | ||
| stacklevel=3, | ||
| ) | ||
| json_raw = legacy | ||
| use_json = _parse_bool_env(json_raw or "", default=False) |
There was a problem hiding this comment.
Might be worth extracting this grab new / legacy code into a helper function since there's so many call sites for it.
There was a problem hiding this comment.
Valid, I probably should have gone back and refactored this after repeating it for the nth time but I didn't remember there being so many.
jakelorocco
left a comment
There was a problem hiding this comment.
(meant to approve in the last review...)
Signed-off-by: AngeloDanducci <[email protected]>
ajbozarth
left a comment
There was a problem hiding this comment.
Process question before the line-by-line: in my parallel tracing work for #444 (not yet in a PR) I decided not to do back-compat for the analogous renames. Given we're still 0.x on ~4-week releases, is the ~150 lines of deprecation infrastructure here (helper + 9 fallback sites + 9 doc rows + 8 dedicated tests) worth the carrying cost vs. a clean rename + CHANGELOG entry? Worth aligning the two efforts before this sets the pattern for future env-var renames.
Comments below assume back-compat stays. The DRY helper from the second commit is a nice cleanup; a few sites still need the same treatment.
|
After discussion with @ajbozarth we agree to drop the deprecation handling and just let it play out in the 0.x release. Will update accordingly. |
Signed-off-by: AngeloDanducci <[email protected]>
Signed-off-by: AngeloDanducci <[email protected]>
|
@ajbozarth added tests for the max bytes default - I think everything else that you raised was going to be addressed by the refactor has been removed wrt deprecation helpers if you'd like to re review. |
Signed-off-by: AngeloDanducci <[email protected]>
ajbozarth
left a comment
There was a problem hiding this comment.
Cleanup looks good — code, primary test surface, and the env-var table are all in sync now. A few small leftovers below; all minor.
Signed-off-by: AngeloDanducci <[email protected]>
0fda0f2
* use plural logs to match otel Signed-off-by: AngeloDanducci <[email protected]> * make legacy log var checking dry Signed-off-by: AngeloDanducci <[email protected]> * remove deprecation helpers Signed-off-by: AngeloDanducci <[email protected]> * add tests for log max bytes and defaults Signed-off-by: AngeloDanducci <[email protected]> * remove deprcated log vars in readme Signed-off-by: AngeloDanducci <[email protected]> * additional deprecation cleanup Signed-off-by: AngeloDanducci <[email protected]> --------- Signed-off-by: AngeloDanducci <[email protected]>
Pull Request
Issue
Fixes #1055
Description
Renames instances referencing any of the MELLEA_LOG prefixed vars to MELLEA_LOGS
Testing
Attribution
Adding a new component, requirement, sampling strategy, or tool?
If your PR adds or modifies one of the types below, check the matching box. A checklist of type-specific review items will be posted as a comment.
NOTE: Please ensure you have an issue that has been acknowledged by a core contributor and routed you to open a pull request against this repository. Otherwise, please open an issue before continuing with this pull request.