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

[Bugfix] apm.DefaultTracer misbehaves when transport configuration is invalid #1618

Merged
merged 10 commits into from
May 6, 2024

Conversation

shubhamsharma7867
Copy link
Contributor

@shubhamsharma7867 shubhamsharma7867 commented Apr 28, 2024

This PR aims to fix amp.DefaultTracer misbehaves if transport specific configuration invalid, Incase of invalid config It will make transport inactive instead passing DiscardTransport

@shubhamsharma7867 shubhamsharma7867 requested a review from a team as a code owner April 28, 2024 06:43
@shubhamsharma7867 shubhamsharma7867 changed the title [Bugfix [Bugfix] apm.DefaultTracer misbehaves when transport configuration is invalid Apr 28, 2024
tracer_test.go Outdated Show resolved Hide resolved
tracer_test.go Outdated Show resolved Hide resolved
tracer_test.go Outdated
@@ -597,17 +597,11 @@ func TestTracerDefaultTransport(t *testing.T) {
require.Error(t, err)
assert.EqualError(t, err, "failed to parse ELASTIC_APM_SERVER_TIMEOUT: invalid duration never")

// Implicitly created Tracers will have a discard tracer.

Copy link
Member

Choose a reason for hiding this comment

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

I'd recommend running the go linter locally. This additional new line is not necessary.

Copy link
Member

Choose a reason for hiding this comment

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

You will also want to run the tests locally, as they currently are failing.

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 @dmathieu, I did run test before raising the PR and again. As per the code DefaultTracer is being used in three places and I ran the UT's and they are working fine
Screenshot 2024-05-04 213502

Copy link
Member

@dmathieu dmathieu May 6, 2024

Choose a reason for hiding this comment

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

make test did fail consistently in CI, as well as locally here.
This was because the tracecontext example relies on a discarded tracer.
But now, it had an inactive one (though this was due to previous tests). I've fixed it.

@dmathieu
Copy link
Member

dmathieu commented May 6, 2024

run docs-build

@dmathieu dmathieu merged commit 4b23fe9 into elastic:main May 6, 2024
13 checks passed
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.

3 participants