Skip to content
This repository has been archived by the owner on Nov 24, 2024. It is now read-only.

DropWizard 4 [Do Not Merge] #59

Closed
wants to merge 10 commits into from
Closed

DropWizard 4 [Do Not Merge] #59

wants to merge 10 commits into from

Conversation

mikebell90
Copy link
Contributor

Can be merged (refactored) after other stuff
Required for Spring Boot 2.1

Basic Changes were simple in theory

  1. Bump version
  2. Add metrics-jmx
  3. Change package .of JMXReporter (this is what breaks source and binary compatibility)

However most of a day was spent exploring why the Reconnect tests failed.

In turns out due to dropwizard/metrics#694
that all versions of DW from 3.1.3+ (3.1.2 is currently used), including the 3.2.3 override (abtest clients) were failing, because most of the logic of GraphiteSenderWrapper is redundant and broken in a refactored GraphiteReporter that connects/closes on every reporting period. Hence much of that class was gutted. Even the hourly reconnect I suspect no longer serves a purpose.

Remaining:

  • Test on Service-Demo. Namespaces and all metrics should continue to be unaffected
  • metrics-spring. We use this library to enable the annotations like @timed, which are just bare annotations with no innate functionality. Problem is it is mostly abandoned, and we'll need to fork it to fix it for DropWizard 4. 4.0 upgrade ryantenney/metrics-spring#217 gives us most of what we need and it's simple enough. It's a bit unclear to me reading through that the affected classes are even used by us but ...
  • otj-parent that simply initially copies dep.metrics.version to dep.metrics4.version and changes usage to dep.metrics4.version. Still remaining on v3, this makes it impossible to override later - which would be fatal (a backrev)
  • Test elsewhere
  • otj-parent that switches entirely

@@ -1,6 +1,15 @@
otj-metrics
===========

4.0.0
Copy link
Contributor

Choose a reason for hiding this comment

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

Not 3.0.0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@adamzr no because your changes are 3.0.0 (incompatible api change). This has the advantage of us being able to mentally say "Oh DropWizard 4.x == otj-metrics 4.x

This is an incompatible binary/source change, which will require users to import new versions, and a new
module (metrics-jmx)

In addition, a fork of metrics-spring will probably be needed
Copy link
Contributor

Choose a reason for hiding this comment

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

We should reach out to metrics-spring maintainer and suggest that he either:
a) quickly update his project
b) add us as maintainers and allow us to update his project for him
c) mark his project as abandoned in favor of a fork that we build

Otherwise, we can either give up on the library, or we can build our own fork.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@adamzr I have a fork and a PR put up. Take a look at https://github.com/ryantenney/metrics-spring the original github. Pretty much dead eh? Look at the PRs that have waited for years.

* (In DropWizard 3.1.3+, each reporting period, a new socket (including DNS resolution) is created, metrics are sent, and
* the socket is closed. All the previous issues occurred because of atttempts to reuse a socket)
* Hence, this class is now mostly a "dumb" delegator, with little extra logic other than
* metrics wrapping, and a restart per hour.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should dump the hourly restart.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's out of an excess of caution tbh. I could be argued/cajoled into it ;)

// Spin up new one
Graphite newGraphite = new Graphite(address.get());
newGraphite.connect();
//newGraphite.connect();
Copy link
Contributor

Choose a reason for hiding this comment

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

Delete it.


// Wait for graphite to connect.
Thread.sleep(reportingPeriod.multipliedBy(2).toMillis());
Assert.assertTrue(server.getBytesRead() > 0);
Assert.assertEquals(0, detectedConnectionFailures.getCount());

server.contains("wolf created but otherwise default", "foo");
Copy link
Contributor

Choose a reason for hiding this comment

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

?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added a sort of TDD like clause soo I could debug.

@mikebell90
Copy link
Contributor Author

Note #61 is a report for server 3.0. This PR will never be merged and is being kept open for @rushalias convenience for now.

@mikebell90 mikebell90 self-assigned this Nov 30, 2018
@mikebell90
Copy link
Contributor Author

Closed in favor of #61

@mikebell90 mikebell90 closed this Dec 11, 2018
@mikebell90 mikebell90 deleted the dw4 branch May 26, 2019 00:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants