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 to otel API #7547

Merged
merged 1 commit into from
Mar 12, 2024
Merged

Conversation

kmjayadeep
Copy link
Contributor

Changes

OpenTelemetry has deprecated the use of jaeger exporter directly and it has been removed from the library since 1.20 (changelog)

This PR migrates the code to make it compatible with the recommended oltptracehttp exporter instead. Also fixes issues with broken imports when upgrading to otel 1.21

Fixes #7464

/kind bug

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs if any changes are user facing, including updates to minimum requirements e.g. Kubernetes version bumps
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings). See some examples of good release notes.
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

NONE

@tekton-robot tekton-robot added release-note-none Denotes a PR that doesnt merit a release note. kind/bug Categorizes issue or PR as related to a bug. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jan 8, 2024
@tekton-robot
Copy link
Collaborator

Hi @kmjayadeep. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot tekton-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 8, 2024
@tekton-robot tekton-robot requested review from abayer and jerop January 8, 2024 04:39
@kmjayadeep
Copy link
Contributor Author

/kind bug

@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 8, 2024
return trace.NewNoopTracerProvider(), nil
return noop.NewTracerProvider(), nil
}
u, err := url.Parse(cfg.Endpoint)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Jaeger exporter expected a complete URL path like http://website.com:port/path, while otlp exporter accepts host and path as separate arguments. This URL parsing is added to ensure that user experience has not changed.

@vdemeester
Copy link
Member

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 8, 2024
@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/tracing/tracing.go 77.2% 78.3% 1.1

@vdemeester
Copy link
Member

/test pull-tekton-pipeline-go-coverage-df

@tekton-robot
Copy link
Collaborator

@vdemeester: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test pull-tekton-pipeline-alpha-integration-tests
  • /test pull-tekton-pipeline-beta-integration-tests
  • /test pull-tekton-pipeline-build-tests
  • /test pull-tekton-pipeline-integration-tests
  • /test pull-tekton-pipeline-unit-tests

The following commands are available to trigger optional jobs:

  • /test pull-tekton-pipeline-go-coverage

Use /test all to run all jobs.

In response to this:

/test pull-tekton-pipeline-go-coverage-df

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/tracing/tracing.go 77.2% 78.3% 1.1

@chitrangpatel chitrangpatel added this to the Pipelines v0.56 milestone Jan 9, 2024
@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 16, 2024
@afrittoli
Copy link
Member

@kmjayadeep Could you please rebase this PR, so we merge it in time for v0.58?

Otel SDK is upgraded from 1.19 to 1.21
Jaeger exporter is deprecated in otel 1.20, in favor of otel exporter
Migrated jaeger to otel http exporter

Signed-off-by: Jayadeep KM <[email protected]>
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 5, 2024
@kmjayadeep
Copy link
Contributor Author

@afrittoli The PR branch is rebased with main

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/tracing/tracing.go 77.2% 78.3% 1.1

@tekton-robot
Copy link
Collaborator

The following is the coverage report on the affected files.
Say /test pull-tekton-pipeline-go-coverage-df to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/tracing/tracing.go 77.2% 78.3% 1.1

@@ -150,12 +153,32 @@ func createTracerProvider(service string, cfg *config.Tracing, user, pass string
if !cfg.Enabled {
return noop.NewTracerProvider(), nil
}
u, err := url.Parse(cfg.Endpoint)
Copy link
Member

Choose a reason for hiding this comment

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

@kmjayadeep question: why do we need the additional configuration and the config-tracing configmap when it seems like otel can be configured with env vars (https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp#pkg-overview)?

Should we just have one way to configure tracing? (the env vars seem to support more options too e.g. client certs etc. vs the config map which only supports basic auth)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @dibyom, we have used env vars initially. Then we decided to move to configmap to make it consistent with how other configurations are managed in the project. Also, env variables requires the user to restart the controller when the configuration needs to be changed.
Env variables are still supported. We can also add more parameters in the configmap as needed.

Comment on lines +170 to +177
if user != "" && pass != "" {
creds := fmt.Sprintf("%s:%s", user, pass)
enc := base64.StdEncoding.EncodeToString([]byte(creds))
o := otlptracehttp.WithHeaders(map[string]string{
"Authorization": fmt.Sprintf("Basic %s", enc),
})
opts = append(opts, o)
}
Copy link
Member

Choose a reason for hiding this comment

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

Is it an option to have a user with empty password?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What I found during testing with jaeger and nginx is that if the username or password is configured to be empty, the server just ignores the whole authorization header. So no need to pass the header in code.

Copy link
Member

@afrittoli afrittoli left a comment

Choose a reason for hiding this comment

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

Thanks @kmjayadeep - looks good to me!
/approve

@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afrittoli

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 11, 2024
@chitrangpatel
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 11, 2024
@chitrangpatel
Copy link
Contributor

/test pull-tekton-pipeline-beta-integration-tests

@tekton-robot
Copy link
Collaborator

The following Tekton test failed:

Test name Commit Details Required Rerun command
pull-tekton-pipeline-go-coverage-df 987aa15 link true /test pull-tekton-pipeline-go-coverage-df

@chitrangpatel
Copy link
Contributor

/test pull-tekton-pipeline-go-coverage-df

@tekton-robot
Copy link
Collaborator

@chitrangpatel: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test pull-tekton-pipeline-alpha-integration-tests
  • /test pull-tekton-pipeline-beta-integration-tests
  • /test pull-tekton-pipeline-build-tests
  • /test pull-tekton-pipeline-integration-tests
  • /test pull-tekton-pipeline-unit-tests

The following commands are available to trigger optional jobs:

  • /test pull-tekton-pipeline-go-coverage

Use /test all to run all jobs.

In response to this:

/test pull-tekton-pipeline-go-coverage-df

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@chitrangpatel
Copy link
Contributor

/retest

@chitrangpatel
Copy link
Contributor

chitrangpatel commented Mar 11, 2024

Not sure why the test is failing. Seems like a glitch. It is unable to run the second Task I think: https://dashboard.dogfooding.tekton.dev/#/namespaces/tekton-ci/pipelineruns/run-go-coverage-hswz7?pipelineTask=split-full-repo-name&step=split-name

I wonder if closing and reopening the PR will help her 🤔 ?

@kmjayadeep
Copy link
Contributor Author

@chitrangpatel I have raised an identical PR in #7748. Please feel free to close this one if that one gets through

@kmjayadeep kmjayadeep mentioned this pull request Mar 12, 2024
7 tasks
@tekton-robot tekton-robot merged commit d1d689f into tektoncd:main Mar 12, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesnt merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken imports of go.opentelemetry.io/otel/sdk for 1.21.0
6 participants