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

Feat: Add time window for GetTrace of anonymizer #6368

Merged

Conversation

rim99
Copy link
Contributor

@rim99 rim99 commented Dec 16, 2024

Which problem is this PR solving?

Description of the changes

  • Add optional time window for GetTrace of anonymizer

How was this change tested?

  • unit test

Checklist

Signed-off-by: Zhang Xin <[email protected]>
@rim99 rim99 requested a review from a team as a code owner December 16, 2024 13:22
@rim99 rim99 requested a review from pavolloffay December 16, 2024 13:22
Copy link

codecov bot commented Dec 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.16%. Comparing base (d8984bb) to head (f316405).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6368   +/-   ##
=======================================
  Coverage   96.16%   96.16%           
=======================================
  Files         360      360           
  Lines       20484    20496   +12     
=======================================
+ Hits        19698    19710   +12     
  Misses        601      601           
  Partials      185      185           
Flag Coverage Δ
badger_v1 8.96% <ø> (ø)
badger_v2 1.63% <ø> (ø)
cassandra-4.x-v1-manual 14.93% <ø> (ø)
cassandra-4.x-v2-auto 1.57% <ø> (ø)
cassandra-4.x-v2-manual 1.57% <ø> (ø)
cassandra-5.x-v1-manual 14.93% <ø> (ø)
cassandra-5.x-v2-auto 1.57% <ø> (ø)
cassandra-5.x-v2-manual 1.57% <ø> (ø)
elasticsearch-6.x-v1 18.61% <ø> (ø)
elasticsearch-7.x-v1 18.70% <ø> (ø)
elasticsearch-8.x-v1 18.85% <ø> (-0.01%) ⬇️
elasticsearch-8.x-v2 1.63% <ø> (ø)
grpc_v1 10.60% <ø> (-0.01%) ⬇️
grpc_v2 7.95% <ø> (ø)
kafka-v1 9.29% <ø> (ø)
kafka-v2 1.63% <ø> (ø)
memory_v2 1.63% <ø> (ø)
opensearch-1.x-v1 18.75% <ø> (ø)
opensearch-2.x-v1 18.75% <ø> (ø)
opensearch-2.x-v2 1.62% <ø> (ø)
tailsampling-processor 0.45% <ø> (ø)
unittests 95.04% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rim99 rim99 changed the title Add time window for GetTrace of anonymizer Feat: Add time window for GetTrace of anonymizer Dec 16, 2024
command.Flags().Int64Var(
&o.StartTime,
startTime,
-1,
Copy link
Member

Choose a reason for hiding this comment

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

why not 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, 0 makes things easier

@@ -53,7 +54,9 @@ func main() {
logger.Fatal("error while creating query object", zap.Error(err))
}

spans, err := query.QueryTrace(options.TraceID)
startTime := time.Unix(0, options.StartTime)
Copy link
Member

Choose a reason for hiding this comment

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

shouldn't this check for sentinel value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed default value as 0, so no need to check then

Copy link
Member

Choose a reason for hiding this comment

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

still need to check, time 0 is not the same as epoch 0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Signed-off-by: Zhang Xin <[email protected]>
Signed-off-by: Zhang Xin <[email protected]>
@rim99 rim99 force-pushed the add-time-window-get-trace-anonymizer branch from 2b2e461 to f7d3789 Compare December 17, 2024 12:37
cmd/anonymizer/main.go Outdated Show resolved Hide resolved
Signed-off-by: Yuri Shkuro <[email protected]>
@yurishkuro yurishkuro enabled auto-merge (squash) December 17, 2024 14:31
@yurishkuro yurishkuro merged commit 988ce8a into jaegertracing:main Dec 17, 2024
54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants