micrometer icon indicating copy to clipboard operation
micrometer copied to clipboard

Datadog Dogstatsd support.

Open platinummonkey opened this issue 2 years ago β€’ 13 comments

ref https://github.com/micrometer-metrics/micrometer-docs/pull/225 discussion

Make the smallest compatible change for users to migrate to dogstatsd approach. This still defaults to the prior API method currently. Many of our users already have the datadog-agent already installed collecting traces, logs and profiling information. This result in a positive performance and reliability benefit as your datadog-agent requires less network hops, and is configured to automatically handle edge related to retries and failure scenarios.

This allows them to update their configuration as follows:

Instead of

datadog.uri = https://api.datadoghq.com
datadog.apiKey = secret

For autodiscovery these environment variables should exist: https://github.com/DataDog/java-dogstatsd-client/blob/master/src/main/java/com/timgroup/statsd/NonBlockingStatsDClient.java#L53-L58

# note the 3rd `/` to satisfy java.net.URI
datadog.uri = discovery:///

For specifying exactly (example named pipe):

datadog.uri = unix:///var/run/datadog.sock

another example for udp to the listening port

datadog.uri = udp://localhost:8125/

platinummonkey avatar Aug 03 '22 13:08 platinummonkey

@platinummonkey Please sign the Contributor License Agreement!

Click here to manually synchronize the status of this Pull Request.

See the FAQ for frequently asked questions.

pivotal-cla avatar Aug 03 '22 13:08 pivotal-cla

@platinummonkey Thank you for signing the Contributor License Agreement!

pivotal-cla avatar Aug 03 '22 13:08 pivotal-cla

bump - any takers for review?

platinummonkey avatar Aug 15 '22 16:08 platinummonkey

@shakuzen will this make it into an upcoming release? Or is there some more work left on it?

I am looking forward to this landing as my team and I are having some issues using DataDog via Micrometer in our Spring Boot application, we don't see the same issue when using java-dogstatsd-client and I would very much like us to keep using Micrometer with Spring Boot. I am thinking might just solve our problem.

The issue is that when we use Micrometer, we observe data loss. When we compare events as recorded in Splunk (our logging tool), versus Datadog, we see 2 or 4 times more events in Splunk than Datadog. And the loss factor correlates to the size of our ECS cluster. When we had our app on 4 nodes in our ECS cluster, we had 4x data loss. After scaling down to 2 nodes, we got 2x data loss. We don't see this issue when using java-dogstatsd-client. The issue might be something on our side, like bad config when using Micrormeter but so far we haven't found anything.

cc @platinummonkey

AhmedCh avatar Sep 14 '22 00:09 AhmedCh

will this make it into an upcoming release? Or is there some more work left on it?

I'm particularly hoping to get feedback on this review comment. Once that is addressed, I will try to make time to try this out (and you or other Datadog users could also try it, which would be greatly appreciated). For inclusion in our upcoming 1.10 release, we are planning a release candidate on October 10. New features would need to be merged before then. Otherwise, it will have to wait until a future release.

The issue is that when we use Micrometer, we observe data loss.

I'm sorry that's happening. Feel free to open a separate issue regarding it.

shakuzen avatar Sep 14 '22 00:09 shakuzen

Our original customer had moved off micrometer prior to this landing, but I can certainly come back and help finish this out as it’s a popular library.

platinummonkey avatar Sep 14 '22 00:09 platinummonkey

Our original customer had moved off micrometer prior to this landing, but I can certainly come back and help finish this out as it’s a popular library.

Thanks @platinummonkey, that would be much appreciated!

AhmedCh avatar Sep 14 '22 06:09 AhmedCh

I'm sorry that's happening. Feel free to open a separate issue regarding it.

Thanks, sounds good. We do have a support case open with folks at DataDog and they helping us look into this issue but since this isn't their officially supported mechanism, they might not be able to get to the bottom of this, we are also looking at things on our end. If we don't get a resolution from either approaches, I might just open an issue here.

AhmedCh avatar Sep 14 '22 06:09 AhmedCh

the remainder of these sonatype-lift errors look related to what already exists and outside the scope of this PR πŸ™ƒ

platinummonkey avatar Sep 15 '22 20:09 platinummonkey

I merged main and now the tests fail πŸ₯‡

platinummonkey avatar Sep 15 '22 20:09 platinummonkey

I merged main and now the tests fail

Sorry about that, main is now fixed. Could you rebase?

shakuzen avatar Sep 16 '22 12:09 shakuzen

:warning: 11 God Classes were detected by Lift in this project. Visit the Lift web console for more details.

sonatype-lift[bot] avatar Oct 17 '22 19:10 sonatype-lift[bot]

currently seem blocked on

./gradlew resolveAndLockAll --no-build-cache --write-locks

...
* What went wrong:
Execution failed for task ':micrometer-registry-cloudwatch2:resolveAndLockAll'.
> Could not resolve all files for configuration ':micrometer-registry-cloudwatch2:compileClasspath'.
   > Could not find software.amazon.awssdk:cloudwatch:.
     Required by:
         project :micrometer-registry-cloudwatch2
   > Could not resolve software.amazon.awssdk:cloudwatch:latest.release.
     Required by:
         project :micrometer-registry-cloudwatch2
         project :micrometer-registry-cloudwatch2 > project :micrometer-core
         project :micrometer-registry-cloudwatch2 > project :micrometer-core > project :micrometer-commons
         project :micrometer-registry-cloudwatch2 > project :micrometer-core > project :micrometer-observation
      > Could not resolve software.amazon.awssdk:cloudwatch:2.17.293.
         > Could not parse POM https://repo.maven.apache.org/maven2/software/amazon/awssdk/cloudwatch/2.17.293/cloudwatch-2.17.293.pom
            > Could not find software.amazon.awssdk:services:2.17.293.
              Searched in the following locations:
                - https://repo.maven.apache.org/maven2/software/amazon/awssdk/services/2.17.293/services-2.17.293.pom
              If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
      > Could not resolve software.amazon.awssdk:cloudwatch:2.17.293.
         > Could not parse POM https://repo.maven.apache.org/maven2/software/amazon/awssdk/cloudwatch/2.17.293/cloudwatch-2.17.293.pom
            > Could not find software.amazon.awssdk:services:2.17.293.
...

platinummonkey avatar Oct 17 '22 20:10 platinummonkey

πŸ›  Lift Auto-fix

Some of the Lift findings in this PR can be automatically fixed. You can download and apply these changes in your local project directory of your branch to review the suggestions before committing.[^1]

# Download the patch
curl https://lift.sonatype.com/api/patch/github.com/micrometer-metrics/micrometer/3329.diff -o lift-autofixes.diff

# Apply the patch with git
git apply lift-autofixes.diff

# Review the changes
git diff

Want it all in a single command? Open a terminal in your project's directory and copy and paste the following command:

curl https://lift.sonatype.com/api/patch/github.com/micrometer-metrics/micrometer/3329.diff | git apply

Once you're satisfied commit and push your changes in your project. [^1]: You can preview the patch by opening the patch URL in the browser.

sonatype-lift[bot] avatar Jan 18 '23 22:01 sonatype-lift[bot]

can we ignore the sonatype-lift here?

1 of the failures is a nag. 2 of them actually cause compile failures and are blocking.

platinummonkey avatar Jan 19 '23 17:01 platinummonkey

none of the remaining sonatype failures are related to this branch, prexisting failures on main

platinummonkey avatar Jan 20 '23 13:01 platinummonkey

πŸ¦— bump?

platinummonkey avatar Jul 19 '23 15:07 platinummonkey

Bump

platinummonkey avatar Jul 24 '23 11:07 platinummonkey

Bump

platinummonkey avatar Aug 01 '23 10:08 platinummonkey

@shakuzen @AhmedCh bump?

platinummonkey avatar Aug 10 '23 23:08 platinummonkey

appears another integration is failing as a result of merging main

 What went wrong:
Execution failed for task ':micrometer-registry-wavefront:test'.

platinummonkey avatar Aug 25 '23 19:08 platinummonkey

Bump

platinummonkey avatar Sep 02 '23 23:09 platinummonkey

Another week, another bump

platinummonkey avatar Sep 13 '23 10:09 platinummonkey

@platinummonkey Hoping you get this bumped. :)

The current statsd thing sends a line for every counter increase, which makes the metrics scale w/ the thing they're counting, which can be no bueno!

Hope this gets merged in soon!

ghost avatar Sep 13 '23 21:09 ghost

Bump

platinummonkey avatar Sep 14 '23 22:09 platinummonkey

Bump

Heads up @platinummonkey, the PR now looks like it acquired some merge conflicts This branch has conflicts that must be resolved Just in case they see your bump soon. :)

ghost avatar Sep 15 '23 13:09 ghost

Heads up @platinummonkey, the PR now looks like it acquired some merge conflicts This branch has conflicts that must be resolved Just in case they see your bump soon. :)

this is the theme yes, when a PR sits for over a year πŸ™ƒ

platinummonkey avatar Sep 15 '23 14:09 platinummonkey

the .github/workflows/deploy-docs.yml workflow also seems busted now :) irrelevant to this PR

platinummonkey avatar Sep 15 '23 14:09 platinummonkey

Bump

platinummonkey avatar Sep 16 '23 15:09 platinummonkey

Bump

platinummonkey avatar Sep 17 '23 12:09 platinummonkey