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

Use official OTLP types in api_v3 and avoid triple-marshaling #5098

Merged
merged 9 commits into from
Jan 15, 2024

Conversation

yurishkuro
Copy link
Member

@yurishkuro yurishkuro commented Jan 14, 2024

Which problem is this PR solving?

Description of the changes

How was this change tested?

  • Unit tests

Signed-off-by: Yuri Shkuro <github@ysh.us>
Copy link

github-actions bot commented Jan 14, 2024

Test Results

2 085 tests   - 1   2 075 ✅  - 1   1m 8s ⏱️ -1s
  220 suites ±0      10 💤 ±0 
    1 files   ±0       0 ❌ ±0 

Results for commit a9bb33e. ± Comparison against base commit 09f7a30.

This pull request removes 2 and adds 1 tests. Note that renamed tests count towards both.
github.com/jaegertracing/jaeger/pkg/testutils ‑ TestIgnoreGlogFlushDaemonLeak
github.com/jaegertracing/jaeger/pkg/testutils ‑ TestIgnoreOpenCensusWorkerLeak
github.com/jaegertracing/jaeger/cmd/query/app/internal/api_v3 ‑ TestTracesData

♻️ This comment has been updated with latest results.

Copy link

codecov bot commented Jan 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (09f7a30) 95.55% compared to head (a9bb33e) 95.61%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5098      +/-   ##
==========================================
+ Coverage   95.55%   95.61%   +0.05%     
==========================================
  Files         319      320       +1     
  Lines       18379    18394      +15     
==========================================
+ Hits        17562    17587      +25     
+ Misses        655      649       -6     
+ Partials      162      158       -4     
Flag Coverage Δ
cassandra-3.x 25.58% <0.00%> (-0.01%) ⬇️
cassandra-4.x 25.58% <0.00%> (-0.01%) ⬇️
elasticsearch-5.x 19.87% <0.00%> (-0.01%) ⬇️
elasticsearch-6.x 19.85% <0.00%> (-0.03%) ⬇️
elasticsearch-7.x 19.99% <0.00%> (-0.03%) ⬇️
elasticsearch-8.x 20.09% <0.00%> (-0.01%) ⬇️
grpc-badger 19.50% <0.00%> (-0.01%) ⬇️
kafka 14.09% <0.00%> (-0.01%) ⬇️
opensearch-1.x 20.00% <0.00%> (-0.01%) ⬇️
opensearch-2.x 20.00% <0.00%> (-0.01%) ⬇️
unittests 93.30% <100.00%> (+0.05%) ⬆️

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.

Signed-off-by: Yuri Shkuro <github@ysh.us>
Signed-off-by: Yuri Shkuro <github@ysh.us>
Signed-off-by: Yuri Shkuro <github@ysh.us>
Signed-off-by: Yuri Shkuro <github@ysh.us>
Signed-off-by: Yuri Shkuro <github@ysh.us>
Signed-off-by: Yuri Shkuro <github@ysh.us>
@yurishkuro yurishkuro added the changelog:breaking-change Change that is breaking public APIs or established behavior label Jan 14, 2024
yurishkuro added a commit to jaegertracing/jaeger-idl that referenced this pull request Jan 14, 2024
Signed-off-by: Yuri Shkuro <github@ysh.us>
@yurishkuro yurishkuro changed the title Use OTLP Use official OTLP types in api_v3 and void triple-marshaling Jan 14, 2024
@yurishkuro yurishkuro marked this pull request as ready for review January 14, 2024 19:26
@yurishkuro yurishkuro requested a review from a team as a code owner January 14, 2024 19:26
cp -R idl/opentelemetry-proto/* $(PATCHED_OTEL_PROTO_DIR)
find $(PATCHED_OTEL_PROTO_DIR) -name "*.proto" | xargs -L 1 $(SED) -i 's+go.opentelemetry.io/proto/otlp+github.com/jaegertracing/jaeger/proto-gen/otel+g'

$(call proto_compile, proto-gen/api_v3, idl/proto/api_v3/query_service.proto, -I$(PATCHED_OTEL_PROTO_DIR))
Copy link
Member Author

Choose a reason for hiding this comment

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

  • enriching is no longer needed
  • types are generated into an internal module now

@@ -180,9 +179,11 @@ func getServicesAPIV3(t *testing.T) {
require.NoError(t, err)
body, _ := io.ReadAll(resp.Body)

var servicesResponse api_v3.GetServicesResponse
Copy link
Member Author

Choose a reason for hiding this comment

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

This was unnecessary coupling. api_v3 is not internal and not accessible from here.

if err := proto.Unmarshal(b, &chunk); err != nil {
return nil, fmt.Errorf("cannot marshal OTLP: %w", err)
}
return chunk.ResourceSpans, nil
Copy link
Member Author

Choose a reason for hiding this comment

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

no triple marshaling!

Signed-off-by: Yuri Shkuro <github@ysh.us>
@yurishkuro yurishkuro changed the title Use official OTLP types in api_v3 and void triple-marshaling Use official OTLP types in api_v3 and avoid triple-marshaling Jan 14, 2024
Copy link
Contributor

@jkowall jkowall left a comment

Choose a reason for hiding this comment

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

LGTM! pretty big PR and chunk of work. Nice job.

@yurishkuro yurishkuro merged commit 2f592b8 into jaegertracing:main Jan 15, 2024
39 checks passed
@yurishkuro yurishkuro deleted the use-otlp branch January 15, 2024 15:51
yurishkuro added a commit that referenced this pull request Jan 16, 2024
## Description of the changes
- Remove unused internal OTLP types, as a follow-up on #5098
- Marking it "breaking" to show up next to #5098 in the changelog, since
technically these are exposed APIs from Jaeger-as-a-library

## How was this change tested?
- CI

Signed-off-by: Yuri Shkuro <github@ysh.us>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:breaking-change Change that is breaking public APIs or established behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants