Skip to content

Conversation

mahadzaryab1
Copy link
Collaborator

@mahadzaryab1 mahadzaryab1 commented Mar 16, 2025

Which problem is this PR solving?

Description of the changes

  • This PR implements the GetOperations call in the gRPC v2 API client
  • In the process, we also had to add a helper to convert a pcommon.Map to the proto representation []*KeyValue.

How was this change tested?

  • Added unit tests

Checklist

Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
@mahadzaryab1 mahadzaryab1 marked this pull request as draft March 16, 2025 20:53
Copy link

codecov bot commented Mar 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.13%. Comparing base (712c1bc) to head (e439cd9).
Report is 63 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6858      +/-   ##
==========================================
+ Coverage   96.03%   96.13%   +0.09%     
==========================================
  Files         367      341      -26     
  Lines       20831    19738    -1093     
==========================================
- Hits        20005    18975    -1030     
+ Misses        630      577      -53     
+ Partials      196      186      -10     
Flag Coverage Δ
badger_v1 10.20% <ø> (+0.32%) ⬆️
badger_v2 2.12% <ø> (+0.06%) ⬆️
cassandra-4.x-v1-manual 15.36% <ø> (+0.48%) ⬆️
cassandra-4.x-v2-auto 2.11% <ø> (+0.06%) ⬆️
cassandra-4.x-v2-manual 2.11% <ø> (+0.06%) ⬆️
cassandra-5.x-v1-manual 15.36% <ø> (+0.48%) ⬆️
cassandra-5.x-v2-auto 2.11% <ø> (+0.06%) ⬆️
cassandra-5.x-v2-manual 2.11% <ø> (+0.06%) ⬆️
elasticsearch-6.x-v1 20.15% <ø> (+0.60%) ⬆️
elasticsearch-7.x-v1 20.23% <ø> (+0.60%) ⬆️
elasticsearch-8.x-v1 20.40% <ø> (+0.61%) ⬆️
elasticsearch-8.x-v2 2.12% <ø> (+0.06%) ⬆️
grpc_v1 11.28% <ø> (+0.35%) ⬆️
grpc_v2 8.25% <ø> (+0.26%) ⬆️
kafka-3.x-v1 10.51% <ø> (+0.33%) ⬆️
kafka-3.x-v2 2.12% <ø> (+0.06%) ⬆️
memory_v2 2.12% <ø> (+0.06%) ⬆️
opensearch-1.x-v1 20.28% <ø> (+0.60%) ⬆️
opensearch-2.x-v1 20.28% <ø> (+0.60%) ⬆️
opensearch-2.x-v2 2.12% <ø> (+0.06%) ⬆️
tailsampling-processor 0.57% <ø> (+0.01%) ⬆️
unittests 94.92% <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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
@@ -17,20 +14,3 @@ const (
// e.g. proto, thrift, json.
FormatAttribute = "@jaeger@format"
)

func PcommonMapToPlainMap(attributes pcommon.Map) map[string]string {
Copy link
Member

Choose a reason for hiding this comment

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

I would've kept it here. Creating too many top packages at internal just creates clutter, and in this case it's a new package for just a couple of functions.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@yurishkuro I had to do this because of circular dependencies. proto-gen uses jptrace.TracesData and this package needs to use proto-gen for converting to the key-value list. Let me know if you prefer a different approach. We could create a top-level jotel and create sub-packages jptrace and jpcommon in there. Or alternatively move the TracesData out of jptrace.

Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
@mahadzaryab1 mahadzaryab1 marked this pull request as ready for review March 19, 2025 02:14
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>

func PcommonMapToPlainMap(attributes pcommon.Map) map[string]string {
mapAttributes := make(map[string]string)
attributes.Range(func(k string, v pcommon.Value) bool {
Copy link
Member

Choose a reason for hiding this comment

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

nit: I recommend using the new iterator methods, I think it will be attributes.All()

Copy link
Member

Choose a reason for hiding this comment

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

unless they still haven't merged those, I thought they did in the last release

Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
@yurishkuro yurishkuro added this pull request to the merge queue Mar 20, 2025
Merged via the queue into jaegertracing:main with commit 663e450 Mar 20, 2025
56 checks passed
@mahadzaryab1 mahadzaryab1 deleted the grpc-find-trace-id branch April 2, 2025 17:13
@mahadzaryab1 mahadzaryab1 added changelog:exprimental Change to an experimental part of the code and removed changelog:bugfix-or-minor-feature labels Apr 2, 2025
amilbcahat pushed a commit to amilbcahat/jaeger that referenced this pull request May 4, 2025
…orage api v2 (jaegertracing#6858)

<!--
!! Please DELETE this comment before posting.
We appreciate your contribution to the Jaeger project! 👋🎉
-->

## Which problem is this PR solving?
- Towards jaegertracing#6789

## Description of the changes
- This PR implements the GetOperations call in the gRPC v2 API client
- In the process, we also had to add a helper to convert a `pcommon.Map`
to the proto representation `[]*KeyValue`.

## How was this change tested?
- Added unit tests

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `npm run lint` and `npm run test`

---------

Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
amilbcahat pushed a commit to amilbcahat/jaeger that referenced this pull request May 4, 2025
…orage api v2 (jaegertracing#6858)

<!--
!! Please DELETE this comment before posting.
We appreciate your contribution to the Jaeger project! 👋🎉
-->

## Which problem is this PR solving?
- Towards jaegertracing#6789

## Description of the changes
- This PR implements the GetOperations call in the gRPC v2 API client
- In the process, we also had to add a helper to convert a `pcommon.Map`
to the proto representation `[]*KeyValue`.

## How was this change tested?
- Added unit tests

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [x] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `npm run lint` and `npm run test`

---------

Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: amol-verma-allen <amol.verma@allen.in>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/storage changelog:exprimental Change to an experimental part of the code v2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants