In order to push only select metrics to CloudWatch, we need a fix for this Micrometer bug. Until one is provided in a Micrometer update, we use this PR as a workaround.
Publishing is done manually from a local machine. To do so, set the environment variable GITHUB_PACKAGES_WRITE_TOKEN
and run the following:
# Only required once, skip if you already have the upstream remote
git remote add upstream git@github.com:micrometer-metrics/micrometer.git
# Set the version to the official micrometer version you want to publish
export RELEASE_VERSION=<major.minor.patch>
# Start rebasing
git fetch upstream
git checkout v${RELEASE_VERSION}
git checkout ignore-noop-meters-for-composite-polling
git rebase upstream v${RELEASE_VERSION}
# Resolve conflicts if necessary
git rebase --continue
# Publish to GitHub Packages
./gradlew micrometer-core:publishNebulaPublicationToGitHubPackagesRepository -x javadoc -Prelease.version=${RELEASE_VERSION}
Note: It is vital to set the release version to an official Micrometer version. This is because the fork only provides micrometer-core, which depends on other artifacts such as micrometer-observations with the same version. If the version is not official, the build will fail due to missing dependencies.