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

1306:Migrate TailSamplingProcessor to new OTLP-based internal data model and add Composite Sampler #1894

Merged
merged 19 commits into from
Oct 14, 2020

Conversation

vikrambe
Copy link
Contributor

@vikrambe vikrambe commented Oct 3, 2020

Description: Migrate Tail Sampling Processor to the new OTLP-based internal data model and add composite sampler
Adding a feature - Composite Sampler
**Design Doc - Added support for composite policy in tailsampling processor. This would help in grouping sampling policies and rate limiting them. https://docs.google.com/document/d/10wpIv3TtXgOik05smHm3nYeBX48Bj76TCMxPy8e1NZw/edit#heading=h.ecy5l2puwtp4

Link to tracking Issue: 1306

Testing: Unit testing

Documentation: Refer #1306, https://docs.google.com/document/d/10wpIv3TtXgOik05smHm3nYeBX48Bj76TCMxPy8e1NZw/edit#heading=h.ecy5l2puwtp4

@codecov
Copy link

codecov bot commented Oct 3, 2020

Codecov Report

Merging #1894 into master will increase coverage by 0.06%.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1894      +/-   ##
==========================================
+ Coverage   91.49%   91.56%   +0.06%     
==========================================
  Files         284      284              
  Lines       16774    16812      +38     
==========================================
+ Hits        15348    15394      +46     
+ Misses        998      981      -17     
- Partials      428      437       +9     
Impacted Files Coverage Δ
...or/tailsamplingprocessor/sampling/always_sample.go 100.00% <ø> (+50.00%) ⬆️
...or/tailsamplingprocessor/sampling/rate_limiting.go 100.00% <ø> (+100.00%) ⬆️
...ilsamplingprocessor/sampling/numeric_tag_filter.go 78.57% <64.28%> (+8.57%) ⬆️
...ailsamplingprocessor/sampling/string_tag_filter.go 83.78% <73.68%> (-1.94%) ⬇️
...mplingprocessor/tailsamplingprocessor/processor.go 77.06% <80.64%> (+2.65%) ⬆️
receiver/receiverhelper/scraper.go 94.44% <0.00%> (-5.56%) ⬇️
service/builder/exporters_builder.go 76.19% <0.00%> (-5.55%) ⬇️
service/builder/pipelines_builder.go 83.33% <0.00%> (-5.09%) ⬇️
translator/internaldata/resource_to_oc.go 91.78% <0.00%> (-2.74%) ⬇️
exporter/kafkaexporter/factory.go 100.00% <0.00%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b61151...88329f7. Read the comment docs.

@jpkrohling
Copy link
Member

Aren't we doing changes to this processor only after it's moved to -contrib?

@vikrambe
Copy link
Contributor Author

vikrambe commented Oct 5, 2020

@jpkrohling Can we merge this PR and move the changes?

@jpkrohling
Copy link
Member

The OTLP changes are probably required for the move anyway, so, I'd be OK to have them merged before the move. The inclusion of the composite sampler would probably better to have in the new repo. Are you OK in splitting those two changes?

@vikrambe
Copy link
Contributor Author

vikrambe commented Oct 5, 2020

Sure i can split them.

@vikrambe
Copy link
Contributor Author

vikrambe commented Oct 6, 2020

@jpkrohling I have removed composite policy changes from this PR. I will open a new PR on contrib repo once this gets moved.

Copy link
Member

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still a couple of left overs that don't belong to this PR. Otherwise, it's looking good. I love the fact that you added tests where it was missing!

@vikrambe
Copy link
Contributor Author

vikrambe commented Oct 8, 2020

@jpkrohling Thanks for the review. I have taken care of the review comments.

Copy link
Member

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks sane to me! Time to get a maintainer to review it now.

cc @tigrannajaryan

@vikrambe
Copy link
Contributor Author

@tigrannajaryan Thanks for the review. I have taken care of review comments. Requesting review..

for _, span := range td.Spans {
if len(span.TraceId) != 16 {
tsp.logger.Warn("Span without valid TraceId", zap.String("SourceFormat", td.SourceFormat))
func (tsp *tailSamplingSpanProcessor) groupSpansByTraceKey(resourceSpans pdata.ResourceSpans) map[traceKey][]*pdata.Span {
Copy link
Member

@jpkrohling jpkrohling Oct 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: we should probably change/remove this logic in a next iteration of the processor, especially once open-telemetry/opentelemetry-collector-contrib#1235 is done. For instance, the instrumentation library name isn't being kept by this logic here, and I think it should.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

Copy link
Member

@jpkrohling jpkrohling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vikrambe
Copy link
Contributor Author

@jpkrohling Thanks for the review
@tigrannajaryan @dmitryax - can you review and merge this PR.

@tigrannajaryan tigrannajaryan merged commit 1942ad2 into open-telemetry:master Oct 14, 2020
tigrannajaryan pushed a commit to open-telemetry/opentelemetry-collector-contrib that referenced this pull request Oct 21, 2021
Is your feature request related to a problem? Please describe.
#1410
Design Doc - Added support for composite policy in tailsampling processor. This would help in grouping sampling policies and rate limiting them. https://docs.google.com/document/d/10wpIv3TtXgOik05smHm3nYeBX48Bj76TCMxPy8e1NZw/edit#heading=h.ecy5l2puwtp4
This is a split. Refer PR open-telemetry/opentelemetry-collector#1894 (comment)

Due to EasyCLA issue opening a new PR: #4396

Link to tracking Issue: 1306
MovieStoreGuy pushed a commit to atlassian-forks/opentelemetry-collector that referenced this pull request Nov 11, 2021
Signed-off-by: Hu Shuai <hus.fnst@cn.fujitsu.com>

Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants