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

Migrate Jaeger internal packages to OTEL contrib and update import paths #37999

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

AdityaS8804
Copy link

TODO : Fix metrics -> use OTEL SDK for metrics

Description

Refer to this jaeger issue : jaegertracing/jaeger#6704. Author of the issue: yurishkuro

This PR is a follow-up to the PR - #37956 -> It deviates too much from it's initial description.

This PR moves the necessary Jaeger internal code, into the OTEL collector contrib repository in reference to the mentioned Jaeger Issue. The goal is to move certain dependencies as mentioned in the above issue from jaeger to this codebase :

  • Code Migration:
    Files moved to
    receiver/jaegerreceiver/internal and cmd,internal, pkg directories contain the files from jaeger codebase. The choice of the folder names and structure was in conjecture to the format used in jaeger codebase.
    The files were then imported to receiver/jaegerreceiver/jaeger_agent_test.go and receiver/jaegerreceiver/trace_receiver.go

  • Import Path Updates:
    All import statements have been modified as needed to make it work smoothly.

  • Dependency Cleanup:
    Removing dependencies on Jaeger’s internal packages, thereby resolving build issues related to importing internal modules from an external repository.

  • Coordination with Jaeger:
    This change is part of a broader effort affecting both Jaeger and OTEL contrib. The corresponding Jaeger PR that updates its references to the new OTEL contrib location is tracked separately.

Link to tracking issue

Fixes Jaeger issue #6408

Testing

  • Required test files have been moved from jaeger codebase and is ensured to work.

Documentation

  • No changes to external documentation are required at this time.

}

// Factory creates new metrics
type Factory interface {
Copy link
Author

Choose a reason for hiding this comment

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

Hey @yurishkuro, you recommended replacing the metrics with the OTEL metrics SDK. With respect to that I have a quick question—should we be relying on the metric tags (like service=my_service) for setting the OTEL service, or do we have a dedicated service input (maybe from config/env) that sets the OTEL resource’s service.name?
Could you please point to where we might be getting this service information.
And could you clarify if I am on the right track.
Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

In agent metrics the service is from the observed spans, not the collector service.

Copy link
Author

@AdityaS8804 AdityaS8804 Feb 19, 2025

Choose a reason for hiding this comment

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

Yeah I looked into it and I tried an implementation with otel. Please review the same

Copy link
Member

Choose a reason for hiding this comment

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

Can you remove all the metrics packages from this PR? Leave only the business logic you're adding.

Copy link
Author

@AdityaS8804 AdityaS8804 Feb 20, 2025

Choose a reason for hiding this comment

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

Hey, so I reverted to the old metric implementation and kept the rest of the business logic as is.
Does that align with the requirements?

@@ -1,6 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
//
// Copyright The OpenTelemetry Authors
Copy link
Member

Choose a reason for hiding this comment

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

rm

Copy link
Author

Choose a reason for hiding this comment

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

done

@AdityaS8804 AdityaS8804 reopened this Feb 20, 2025
@github-actions github-actions bot added the extension/healthcheck Health Check Extension label Feb 20, 2025
// but not the metrics wrapper (because its metric names are specific to agent).

// ClientConfigManager decides which sampling strategy a given service should be using.
type ClientConfigManager interface {
Copy link
Member

Choose a reason for hiding this comment

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

We said this isn't needed in jaeger receiver


"github.com/stretchr/testify/require"

"github.com/jaegertracing/jaeger/pkg/testutils"
Copy link
Member

Choose a reason for hiding this comment

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

Don't bring more dependencies from jaeger

)

// ConnBuilder Struct to hold configurations
type ConnBuilder struct {
Copy link
Member

Choose a reason for hiding this comment

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

Why is this needed at all? It's for communicating out of the agent to the collector, such function does not exist in OTEL receiver

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove dependencies on Jaeger from opentelemetry-collector-contrib
2 participants