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

OtelTraceProvider.Builder introduce the trace rate limit property #2086

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

mariusc83
Copy link
Member

What does this PR do?

A brief description of the change being made with this pull request.

Motivation

What inspired you to submit this pull request?

Additional Notes

Anything else we should know when reviewing?

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@mariusc83 mariusc83 force-pushed the mconstantin/introduce-trace-rate-limit-property branch 2 times, most recently from d523380 to 46b4195 Compare June 14, 2024 15:33
@mariusc83 mariusc83 self-assigned this Jun 14, 2024
@mariusc83 mariusc83 force-pushed the mconstantin/introduce-trace-rate-limit-property branch from 46b4195 to 83e190e Compare June 17, 2024 07:25
@mariusc83 mariusc83 marked this pull request as ready for review June 17, 2024 07:32
@mariusc83 mariusc83 requested review from a team as code owners June 17, 2024 07:32
@codecov-commenter
Copy link

codecov-commenter commented Jun 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.00%. Comparing base (a777600) to head (275c4b3).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2086      +/-   ##
===========================================
+ Coverage    68.86%   69.00%   +0.13%     
===========================================
  Files          708      708              
  Lines        26289    26297       +8     
  Branches      4424     4422       -2     
===========================================
+ Hits         18103    18144      +41     
+ Misses        6984     6951      -33     
  Partials      1202     1202              
Files Coverage Δ
.../android/trace/opentelemetry/OtelTracerProvider.kt 96.50% <100.00%> (+0.10%) ⬆️

... and 30 files with indirect coverage changes

Copy link
Member

@0xnm 0xnm left a comment

Choose a reason for hiding this comment

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

lgtm, I've added some questions/comments

* @param traceRateLimit the trace rate limit as a value between 1 and Int.MAX_VALUE (default is Int.MAX_VALUE)
*/
fun setTraceRateLimit(
@IntRange(from = 1, to = Int.MAX_VALUE.toLong()) traceRateLimit: Int
Copy link
Member

Choose a reason for hiding this comment

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

why min value is 1? shouldn't it be 0 instead to be consistent with sample rate? there we allow setting 0, meaning no traces will be sent.

Copy link
Member Author

Choose a reason for hiding this comment

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

that's what they have in the code base

Copy link
Member Author

Choose a reason for hiding this comment

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

it is a Math.max(1, traceLimit) that it's being used in that class so 0 will not be taken into account.

@@ -769,7 +770,7 @@ internal class OtelTracerProviderTest {
}
}

@Test
@RepeatedTest(10)
Copy link
Member

Choose a reason for hiding this comment

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

do we have any added value from repeating this test, given that we already have quite large number of spans in the test itself?

Copy link
Member Author

Choose a reason for hiding this comment

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

not quite...you are right, going to lower it.

@mariusc83 mariusc83 force-pushed the mconstantin/introduce-trace-rate-limit-property branch from 83e190e to 275c4b3 Compare June 17, 2024 08:18
@mariusc83 mariusc83 merged commit 61e5b99 into develop Jun 17, 2024
20 checks passed
@mariusc83 mariusc83 deleted the mconstantin/introduce-trace-rate-limit-property branch June 17, 2024 09:51
@xgouchet xgouchet added this to the 2.11.x milestone Jul 31, 2024
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.

5 participants