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.
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
1306: Adding support for composite sampling policy to the tailsampler #4396
1306: Adding support for composite sampling policy to the tailsampler #4396
Changes from 1 commit
9932c8a
dfde6d6
17535bf
3980805
b33e8e1
1794b75
dabe5ce
61df388
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would probably be better to reuse the existing logic from the main processor. Perhaps extract it as part of the utils.go in the internal package?
opentelemetry-collector-contrib/processor/tailsamplingprocessor/processor.go
Lines 116 to 138 in 36a7da6
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, i tried to move it to internal/sampling/utils.go but i run into below error...
import cycle not allowed
This needs some refactoring, i will pick this and pulling config to common struct in the next refactoring PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you define a common struct for them, embedding it into the PolicyCfg and here? This way, there's no risk of getting one updated and not the other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use same struct and eliminate subPolicyCfg, but before that we need to fix field checks in configcheck in opentelemetry-collector codebase. It does not support composites at the moment . With take this refactoring in next PR
goroutine 1 [running]:
reflect.name.tag(0x3374265, 0x0, 0x0)
/usr/local/go/src/reflect/type.go:502 +0x85 fp=0xc020c00388 sp=0xc020c00380 pc=0x497745
reflect.(*structType).Field(0x38d6aa0, 0x0, 0x3374268, 0xb, 0x0, 0x0, 0x45d29c8, 0x3535de0, 0x0, 0x0, ...)
/usr/local/go/src/reflect/type.go:1197 +0x116 fp=0xc020c003e0 sp=0xc020c00388 pc=0x49a8f6
reflect.(*rtype).Field(0x38d6aa0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/usr/local/go/src/reflect/type.go:923 +0x8c fp=0xc020c004d0 sp=0xc020c003e0 pc=0x4991cc
go.opentelemetry.io/collector/config/configcheck.validateConfigDataType(0x45d29c8, 0x38d6aa0, 0x4488cf6, 0x1)
/home/obelix/go/pkg/mod/go.opentelemetry.io/collector@v0.33.1-0.20210827152330-09258f969908/config/configcheck/configcheck.go:92 +0xfa fp=0xc020c00648 sp=0xc020c004d0 pc=0xb6603a
go.opentelemetry.io/collector/config/configcheck.checkStructFieldTags(0x3332187, 0xa, 0x0, 0x0, 0x45d29c8, 0x38d6aa0, 0x3332193, 0x16, 0x20, 0xc000b4a488, ...)