Repository: netflix/dgs-framework
Issue: bug: graphql-dgs-spring-boot-micrometer uses a Timer.Sampler API not supported in micrometer 1.6 

## Expected behavior

Developers should be able to use the`graphql-dgs-spring-boot-micrometer` module with Spring Boot 2.3 and Spring Boot 2.4. The first recommends micrometer 1.5 while the latter 1.6.

## Actual behavior

There's an API breakage in micrometer regarding the `Timer.Sampler` between micrometer-core 1.5 and 1.6. 
The following call pattern is not supported in 1.6:

```
 timerSampler.stop(registry, Timer.builder("some.key"))
```

Ref.
* https://javadoc.io/doc/io.micrometer/micrometer-core/1.5.12/io/micrometer/core/instrument/Timer.Sample.html


---
Thanks @paulbakker for finding this!

Changed files:
graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/dataloader/MappedBatchLoaderWithContextInterceptor.kt
graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/DgsGraphQLMetricsInstrumentation.kt
graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/dataloader/BatchLoaderWithContextInterceptor.kt
graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/dataloader/BatchLoaderInterceptor.kt
graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/dataloader/MappedBatchLoaderInterceptor.kt

diff --git a/graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/DgsGraphQLMetricsInstrumentation.kt b/graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/DgsGraphQLMetricsInstrumentation.kt
index 29cd8052..56da986a 100644
--- a/graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/DgsGraphQLMetricsInstrumentation.kt
+++ b/graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/DgsGraphQLMetricsInstrumentation.kt
@@ -110,11 +110,7 @@ class DgsGraphQLMetricsInstrumentation(
         baseTags: Iterable<Tag>
     ) {
         val recordedTags = Tags.of(baseTags).and(tagsProvider.getFieldFetchTags(parameters, error))
-
-        timerSampler.stop(
-            registry,
-            Timer.builder(GqlMetric.RESOLVER.key).tags(recordedTags)
-        )
+        timerSampler.stop(Timer.builder(GqlMetric.RESOLVER.key).tags(recordedTags).register(registry))
     }
 
     class MetricsInstrumentationState(private val registry: MeterRegistry) : InstrumentationState {
diff --git a/graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/dataloader/BatchLoaderInterceptor.kt b/graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/dataloader/BatchLoaderInterceptor.kt
index 6a180adf..14fe146b 100644
--- a/graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/dataloader/BatchLoaderInterceptor.kt
+++ b/graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/dataloader/BatchLoaderInterceptor.kt
@@ -29,14 +29,13 @@ internal class BatchLoaderInterceptor(
             pipe.to(batchLoader).whenComplete { result, _ ->
                 logger.debug("Finished timer[{}] for BatchLoader.", ID)
                 timerSampler.stop(
-                    registry,
                     Timer.builder(ID)
                         .tags(
                             Tags.of(
                                 Tag.of(GqlTag.LOADER_NAME.key, name),
                                 Tag.of(GqlTag.LOADER_BATCH_SIZE.key, result.size.toString())
                             )
-                        )
+                        ).register(registry)
                 )
             }
         } catch (exception: Exception) {
diff --git a/graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/dataloader/BatchLoaderWithContextInterceptor.kt b/graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/dataloader/BatchLoaderWithContextInterceptor.kt
index 3c7fd593..f2be6704 100644
--- a/graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/dataloader/BatchLoaderWithContextInterceptor.kt
+++ b/graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/dataloader/BatchLoaderWithContextInterceptor.kt
@@ -28,14 +28,13 @@ internal class BatchLoaderWithContextInterceptor(
             pipe.to(batchLoader).whenComplete { result, _ ->
                 logger.debug("Stopping timer[{}] for {}", ID, javaClass.simpleName)
                 timerSampler.stop(
-                    registry,
                     Timer.builder(ID)
                         .tags(
                             Tags.of(
                                 Tag.of(GqlTag.LOADER_NAME.key, name),
                                 Tag.of(GqlTag.LOADER_BATCH_SIZE.key, result.size.toString())
                             )
-                        )
+                        ).register(registry)
                 )
             }
         } catch (exception: Exception) {
diff --git a/graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/dataloader/MappedBatchLoaderInterceptor.kt b/graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/dataloader/MappedBatchLoaderInterceptor.kt
index 6d998244..b8c9ac13 100644
--- a/graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/dataloader/MappedBatchLoaderInterceptor.kt
+++ b/graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/dataloader/MappedBatchLoaderInterceptor.kt
@@ -28,14 +28,13 @@ internal class MappedBatchLoaderInterceptor(
             pipe.to(batchLoader).whenComplete { result, _ ->
                 logger.debug("Stopping timer[{}] for {}", ID, javaClass.simpleName)
                 timerSampler.stop(
-                    registry,
                     Timer.builder(ID)
                         .tags(
                             Tags.of(
                                 Tag.of(GqlTag.LOADER_NAME.key, name),
                                 Tag.of(GqlTag.LOADER_BATCH_SIZE.key, result.size.toString())
                             )
-                        )
+                        ).register(registry)
                 )
             }
         } catch (exception: Exception) {
diff --git a/graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/dataloader/MappedBatchLoaderWithContextInterceptor.kt b/graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/dataloader/MappedBatchLoaderWithContextInterceptor.kt
index cb7f8585..e09e8fd2 100644
--- a/graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/dataloader/MappedBatchLoaderWithContextInterceptor.kt
+++ b/graphql-dgs-spring-boot-micrometer/src/main/kotlin/com/netflix/graphql/dgs/metrics/micrometer/dataloader/MappedBatchLoaderWithContextInterceptor.kt
@@ -29,14 +29,13 @@ internal class MappedBatchLoaderWithContextInterceptor(
             pipe.to(batchLoader).whenComplete { result, _ ->
                 logger.debug("Stopping timer[{}] for {}", ID, javaClass.simpleName)
                 timerSampler.stop(
-                    registry,
                     Timer.builder(ID)
                         .tags(
                             Tags.of(
                                 Tag.of(GqlTag.LOADER_NAME.key, name),
                                 Tag.of(GqlTag.LOADER_BATCH_SIZE.key, result.size.toString())
                             )
-                        )
+                        ).register(registry)
                 )
             }
         } catch (exception: Exception) {