Skip to content

Avoid using Gson instance in Datadog Traces#171

Merged
drodriguezhdez merged 1 commit into
masterfrom
drodriguezhdez/fix_gson_classnotfound
Jan 18, 2021
Merged

Avoid using Gson instance in Datadog Traces#171
drodriguezhdez merged 1 commit into
masterfrom
drodriguezhdez/fix_gson_classnotfound

Conversation

@drodriguezhdez

@drodriguezhdez drodriguezhdez commented Jan 18, 2021

Copy link
Copy Markdown
Collaborator

Requirements for Contributing to this repository

  • Fill out the template below. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • The pull request must only fix one issue at the time.
  • The pull request must update the test suite to demonstrate the changed functionality.
  • After you create the pull request, all status checks must be pass before a maintainer reviews your contribution. For more details, please see CONTRIBUTING.

What does this PR do?

Detected java.lang.NoClassDefFoundError: com/google/gson/GsonBuilder error.

Caused: java.lang.NoClassDefFoundError: com/google/gson/GsonBuilder
        at org.datadog.jenkins.plugins.datadog.traces.DatadogTraceBuildLogic.<init>(DatadogTraceBuildLogic.java:40)
        at org.datadog.jenkins.plugins.datadog.clients.DogStatsDClient.reinitializeTracer(DogStatsDClient.java:270)
        at org.datadog.jenkins.plugins.datadog.clients.DogStatsDClient.getInstance(DogStatsDClient.java:126)
        at org.datadog.jenkins.plugins.datadog.clients.ClientFactory.getClient(ClientFactory.java:52)
        at org.datadog.jenkins.plugins.datadog.clients.ClientFactory.getClient(ClientFactory.java:84)
        at org.datadog.jenkins.plugins.datadog.publishers.DatadogCountersPublisher.execute(DatadogCountersPublisher.java:59)
        at hudson.model.AsyncPeriodicWork$1.run(AsyncPeriodicWork.java:101)
        at java.lang.Thread.run(Thread.java:745)

To fix that this PR:

  • Remove the use of Gson instance in the DatadogTraceBuildLogic class.
  • Build the stage_breakdown json manually.

Description of the Change

Alternate Designs

Possible Drawbacks

Verification Process

Additional Notes

Release Notes

Review checklist (to be filled by reviewers)

  • Feature or bug fix MUST have appropriate tests (unit, integration, etc...)
  • PR title must be written as a CHANGELOG entry (see why)
  • Files changes must correspond to the primary purpose of the PR as described in the title (small unrelated changes should have their own PR)
  • PR must have one changelog/ label attached. If applicable it should have the backward-incompatible label attached.
  • PR should not have do-not-merge/ label attached.
  • If Applicable, issue must have kind/ and severity/ labels attached at least.

@drodriguezhdez drodriguezhdez added the changelog/Fixed Fixed features results into a bug fix version bump label Jan 18, 2021
@drodriguezhdez drodriguezhdez self-assigned this Jan 18, 2021
@drodriguezhdez
drodriguezhdez merged commit 73817d6 into master Jan 18, 2021
@drodriguezhdez
drodriguezhdez deleted the drodriguezhdez/fix_gson_classnotfound branch January 18, 2021 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/Fixed Fixed features results into a bug fix version bump

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants