Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # 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 <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>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
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.

Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
// 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

mahadzaryab1 and others added 2 commits December 15, 2024 18:12
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
@@ -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?

Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
mahadzaryab1 and others added 2 commits December 15, 2024 21:28
Signed-off-by: Mahad Zaryab <mahadzaryab1@gmail.com>
@mahadzaryab1 mahadzaryab1 merged commit ef799d1 into jaegertracing:main Dec 16, 2024
54 checks passed
@mahadzaryab1 mahadzaryab1 deleted the adjuster-interface branch January 6, 2025 00:42
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants