Enhanced logging for Grafana observability (Issue #11) #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Implements comprehensive logging infrastructure for Grafana monitoring (Issue #11).
Changes
Files Modified
Source Files (77 new logger calls)
src/schema-manager.js- 21 calls (table creation, schema migration, BigQuery introspection)src/config-loader.js- 16 calls (config loading, validation, normalization)src/type-converter.js- 20 calls (value conversion, edge cases, batch processing)src/query-builder.js- 10 calls (SQL query construction, column formatting)src/type-mapper.js- 7 calls (type mapping decisions, unsupported types)src/globals.js- 3 calls (key-value state management)Test Files (logger mocks added)
test/config-loader.test.jstest/schema-manager.test.jstest/type-converter.test.jstest/type-mapper.test.jstest/query-builder.test.jsResearch Documentation
GLOBALS_LOGGING_RESEARCH.md- Comprehensive analysis of globals system and singleton patternLOGGING_ANALYSIS_BY_FILE.md- File-by-file logging coverage breakdownLogging Format
All logging follows HarperDB conventions for Grafana integration:
Singleton Pattern Evaluation
Decision: Keep singleton pattern in globals.js
Rationale:
Test Coverage
Grafana Integration
The structured logging format enables:
{module="SchemaManager", operation="ensureTable"}Future Work (Optional)