-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#11267] Add micrometer for monitoring collector
- Loading branch information
Showing
27 changed files
with
571 additions
and
139 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
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
47 changes: 47 additions & 0 deletions
47
collector/src/main/java/com/navercorp/pinpoint/collector/config/DropwizardConfiguration.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,47 @@ | ||
package com.navercorp.pinpoint.collector.config; | ||
|
||
import com.codahale.metrics.MetricRegistry; | ||
import com.navercorp.pinpoint.collector.monitor.dropwizard.BulkOperationMetrics; | ||
import com.navercorp.pinpoint.collector.monitor.dropwizard.CollectorMetric; | ||
import com.navercorp.pinpoint.collector.monitor.dropwizard.HBaseAsyncOperationMetrics; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
import java.util.Optional; | ||
|
||
@Configuration | ||
// FIXME: The MetricRegistry is currently used in other parts | ||
// so it cannot be removed at this time. | ||
// It needs to be separated in the future. | ||
//@ConditionalOnProperty( | ||
// value = "pinpoint.modules.collector.monitor.metric", | ||
// havingValue = "dropwizard", matchIfMissing = true | ||
//) | ||
public class DropwizardConfiguration { | ||
private final Logger logger = LogManager.getLogger(DropwizardConfiguration.class); | ||
|
||
public DropwizardConfiguration() { | ||
logger.info("Install {}", DropwizardConfiguration.class.getSimpleName()); | ||
} | ||
|
||
@Bean | ||
public MetricRegistry metricRegistry() { | ||
return new MetricRegistry(); | ||
} | ||
|
||
|
||
@Bean | ||
public CollectorMetric collectorMetric( | ||
CollectorProperties collectorProperties, | ||
MetricRegistry metricRegistry, | ||
Optional<HBaseAsyncOperationMetrics> hBaseAsyncOperationMetrics, | ||
Optional<BulkOperationMetrics> cachedStatisticsDaoMetrics | ||
) { | ||
return new CollectorMetric(collectorProperties, metricRegistry, hBaseAsyncOperationMetrics, cachedStatisticsDaoMetrics); | ||
} | ||
|
||
} |
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
36 changes: 0 additions & 36 deletions
36
collector/src/main/java/com/navercorp/pinpoint/collector/config/MetricConfiguration.java
This file was deleted.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
collector/src/main/java/com/navercorp/pinpoint/collector/config/MicrometerConfiguration.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,37 @@ | ||
/* | ||
* Copyright 2024 NAVER Corp. | ||
* | ||
* 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 | ||
* | ||
* http://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 com.navercorp.pinpoint.collector.config; | ||
|
||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
/** | ||
* @author intr3p1d | ||
*/ | ||
@Configuration | ||
@ConditionalOnProperty( | ||
value = "pinpoint.modules.collector.monitor.metric", | ||
havingValue = "micrometer" | ||
) | ||
public class MicrometerConfiguration { | ||
private final Logger logger = LogManager.getLogger(MicrometerConfiguration.class); | ||
|
||
public MicrometerConfiguration() { | ||
logger.info("Install {}", MicrometerConfiguration.class.getSimpleName()); | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.