forked from micrometer-metrics/micrometer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Dynatrace] Logging verbosity: Move metadata discrepancy logging to W…
…arnThenDebug (micrometer-metrics#4583) Move Metadata discrepancy logging to WarnThenDebug because this is an instrumentation mismatch with the Dynatrace model that end users cannot fix, so flooding them with warn logs is not productive.
- Loading branch information
Showing
3 changed files
with
204 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...ter-registry-dynatrace/src/main/java/io/micrometer/dynatrace/v2/WarnThenDebugLoggers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Copyright 2024 VMware, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.micrometer.dynatrace.v2; | ||
|
||
import io.micrometer.common.util.internal.logging.WarnThenDebugLogger; | ||
|
||
/** | ||
* This internal class holds loggers that are used in {@link DynatraceExporterV2}. They | ||
* are all just extending the default {@link WarnThenDebugLogger}. It is necessary to | ||
* extend them, because the {@link WarnThenDebugLogger} does not allow creating a new | ||
* logger with just a name (a class object has to be passed). Creating the | ||
* WarnThenDebugLogger with the same class multiple times makes it impossible to test, as | ||
* the MockLoggerFactory will ignore multiple loggers with the same name. | ||
*/ | ||
class WarnThenDebugLoggers { | ||
|
||
static class StackTraceLogger extends WarnThenDebugLogger { | ||
|
||
public StackTraceLogger() { | ||
super(StackTraceLogger.class); | ||
} | ||
|
||
} | ||
|
||
static class NanGaugeLogger extends WarnThenDebugLogger { | ||
|
||
public NanGaugeLogger() { | ||
super(NanGaugeLogger.class); | ||
} | ||
|
||
} | ||
|
||
static class MetadataDiscrepancyLogger extends WarnThenDebugLogger { | ||
|
||
public MetadataDiscrepancyLogger() { | ||
super(MetadataDiscrepancyLogger.class); | ||
} | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters