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

[v2][adjuster] Rework adjuster interface and refactor adjusters to return implemented struct #6362

Merged
merged 16 commits into from
Dec 16, 2024

Conversation

mahadzaryab1
Copy link
Collaborator

Which problem is this PR solving?

Description of the changes

  • This PR performs the following refactorings to the adjuster package
    • Remove the Func alias
    • Change the implemented adjusters to return a struct that implements the Adjuster interface
    • Change the interface to only return an error to indicate that traces are modified in place
    • Move the warnings utility to cmd/query/app/internal/jotlp

How was this change tested?

  • CI and unit tests

Checklist

Signed-off-by: Mahad Zaryab <[email protected]>
Signed-off-by: Mahad Zaryab <[email protected]>
Signed-off-by: Mahad Zaryab <[email protected]>
Signed-off-by: Mahad Zaryab <[email protected]>
Copy link

codecov bot commented Dec 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.14%. Comparing base (dad636b) to head (e26acdd).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6362   +/-   ##
=======================================
  Coverage   96.14%   96.14%           
=======================================
  Files         360      360           
  Lines       20479    20485    +6     
=======================================
+ Hits        19689    19695    +6     
  Misses        603      603           
  Partials      187      187           
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.62% <ø> (+<0.01%) ⬆️
elasticsearch-7.x-v1 18.70% <ø> (ø)
elasticsearch-8.x-v1 18.85% <ø> (ø)
elasticsearch-8.x-v2 1.63% <ø> (ø)
grpc_v1 10.58% <ø> (-0.01%) ⬇️
grpc_v2 7.95% <ø> (ø)
kafka-v1 9.28% <ø> (ø)
kafka-v2 1.63% <ø> (ø)
memory_v2 1.63% <ø> (ø)
opensearch-1.x-v1 18.75% <ø> (ø)
opensearch-2.x-v1 18.75% <ø> (+<0.01%) ⬆️
opensearch-2.x-v2 1.62% <ø> (-0.01%) ⬇️
tailsampling-processor 0.45% <ø> (ø)
unittests 95.02% <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.

cmd/query/app/internal/jotlp/package_test.go Outdated Show resolved Hide resolved
cmd/query/app/internal/jotlp/warning.go Outdated Show resolved Hide resolved
cmd/query/app/querysvc/adjuster/adjuster.go Outdated Show resolved Hide resolved
Signed-off-by: Mahad Zaryab <[email protected]>
Signed-off-by: Mahad Zaryab <[email protected]>
Signed-off-by: Mahad Zaryab <[email protected]>
cmd/query/app/querysvc/adjuster/adjuster.go Outdated Show resolved Hide resolved
cmd/query/app/querysvc/adjuster/adjuster.go Show resolved Hide resolved
// Copyright (c) 2024 The Jaeger Authors.
// SPDX-License-Identifier: Apache-2.0

package jotlp
Copy link
Member

Choose a reason for hiding this comment

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

on reflection, I think we should name this package jpdata, since that's the name of the data model we use

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 since we're usually operating on ptrace.Traces - should we call it jptrace?

Copy link
Member

Choose a reason for hiding this comment

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

ah, yeah, that's better

internal/jotlp/warning.go Outdated Show resolved Hide resolved
@@ -101,13 +102,13 @@ func TestResourceAttributesAdjuster_SpanWithConflictingLibraryAttributes(t *test
require.True(t, ok)
require.Equal(t, "Java", val.Str())

val, ok = resultSpanAttributes.Get("jaeger.adjuster.warning")
val, ok = resultSpanAttributes.Get(jptrace.WarningsAttribute)
Copy link
Member

Choose a reason for hiding this comment

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

nit: we should have GetWarnings() method instead (and the actual tag name could be private to the package)

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 implemented - can you take a look?

cmd/query/app/querysvc/adjuster/resourceattributes_test.go Outdated Show resolved Hide resolved
Signed-off-by: Mahad Zaryab <[email protected]>
@mahadzaryab1 mahadzaryab1 merged commit ef799d1 into jaegertracing:main Dec 16, 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