partitioningprocessor: implement logs partitioning#1172
partitioningprocessor: implement logs partitioning#1172axw wants to merge 1 commit intoelastic:mainfrom
Conversation
This implements the internal partitioning logic for logs. It is not wired up to the processor yet.
ac20366 to
3b3e009
Compare
📝 WalkthroughWalkthroughThe PR implements log partitioning by OTTL expressions: ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.11.4)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@processor/partitioningprocessor/partitioner.go`:
- Around line 120-123: The evaluateScope method in scopeLogsPartitioner uses
ottlscope.NewTransformContextPtr(sl.Scope(), rl.Resource(), sl), which passes
the scope as the single schema URL item so GetScopeSchemaURLItem() and
GetResourceSchemaURLItem() return the same schemaURLItem causing
resource.schema_url to read the scope schema URL; update evaluateScope (or the
context creation) to provide both resource and scope schema URL items separately
(or detect and reject expressions that reference both schema URLs) so
resource.schema_url resolves to the resource's schema URL, and add a unit test
exercising differing scope vs resource schema URLs to ensure
evaluateStringExpressions (called from evaluateScope) behaves correctly;
reference functions/types: evaluateScope, scopeLogsPartitioner,
ottlscope.NewTransformContextPtr, evaluateStringExpressions, and the
resource.schema_url / scope.schema_url getters.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: fa45cd84-8909-41eb-bba4-6d35fa22365d
⛔ Files ignored due to path filters (1)
processor/partitioningprocessor/go.sumis excluded by!**/*.sum
📒 Files selected for processing (7)
processor/partitioningprocessor/config.goprocessor/partitioningprocessor/go.modprocessor/partitioningprocessor/parser.goprocessor/partitioningprocessor/parser_test.goprocessor/partitioningprocessor/partitioner.goprocessor/partitioningprocessor/partitioner_test.goprocessor/partitioningprocessor/processor_test.go
✅ Files skipped from review due to trivial changes (2)
- processor/partitioningprocessor/processor_test.go
- processor/partitioningprocessor/parser.go
🚧 Files skipped from review as they are similar to previous changes (1)
- processor/partitioningprocessor/go.mod
This PR implements the OTTL-based partitioning logic for logs. It is not wired up to the processor yet.
Relates to open-telemetry/opentelemetry-collector-contrib#39199