Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@
</includes>
<excludes />
<allows>
<allow>io[.]micrometer[.]core[.]instrument[.]MeterRegistry</allow>
<allow>io[.]opentelemetry[.]api[.]OpenTelemetry</allow>
<allow>org[.]apache[.]hadoop[.]io[.]Text</allow>
<allow>org[.]apache[.]accumulo[.]core[.]client[.].*</allow>
Expand Down
11 changes: 9 additions & 2 deletions core/src/main/java/org/apache/accumulo/core/conf/Property.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,15 @@ public enum Property {
"Enables metrics functionality using Micrometer.", "2.1.0"),
GENERAL_MICROMETER_JVM_METRICS_ENABLED("general.micrometer.jvm.metrics.enabled", "false",
PropertyType.BOOLEAN, "Enables JVM metrics functionality using Micrometer.", "2.1.0"),
GENERAL_MICROMETER_FACTORY("general.micrometer.factory", "", PropertyType.CLASSNAME,
"Name of class that implements MeterRegistryFactory.", "2.1.0"),
GENERAL_MICROMETER_FACTORY("general.micrometer.factory",
"org.apache.accumulo.core.spi.metrics.LoggingMeterRegistryFactory",
PropertyType.CLASSNAMELIST,
"A comma separated list of one or more class names that implements"
+ " org.apache.accumulo.core.spi.metrics.MeterRegistryFactory. Prior to"
+ " 2.1.3 this was a single value and the default was an empty string. In 2.1.3 the default"
+ " was changed and it now can accept multiple class names. The metrics spi was introduced in 2.1.3,"
+ " the deprecated factory is org.apache.accumulo.core.metrics.MeterRegistryFactory.",
"2.1.0"),
// properties that are specific to manager server behavior
MANAGER_PREFIX("manager.", null, PropertyType.PREFIX,
"Properties in this category affect the behavior of the manager server. "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@

import io.micrometer.core.instrument.MeterRegistry;

/**
* @deprecated since 2.1.3; use {@link org.apache.accumulo.core.spi.metrics.MeterRegistryFactory}
* instead
*/
@Deprecated()
public interface MeterRegistryFactory {
MeterRegistry create();
}
114 changes: 114 additions & 0 deletions core/src/main/java/org/apache/accumulo/core/metrics/MetricsInfo.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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 org.apache.accumulo.core.metrics;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;

import org.apache.accumulo.core.util.HostAndPort;

import io.micrometer.core.instrument.MeterRegistry;
import io.micrometer.core.instrument.Tag;

public interface MetricsInfo {

/**
* Convenience method to create tag name / value pair for the instance name
*
* @param instanceName the instance name
*/
static Tag instanceNameTag(final String instanceName) {
Objects.requireNonNull(instanceName,
"cannot create the tag without providing the instance name");
return Tag.of("instance.name", instanceName);
}

/**
* Convenience method to create tag name / value pair for the process name
*
* @param processName the process name
*/
static Tag processTag(final String processName) {
Objects.requireNonNull(processName, "cannot create the tag without providing the process name");
return Tag.of("process.name", processName);
}

/**
* Convenience method to create tag name / value pairs for the host and port from address
* host:port pair.
*
* @param hostAndPort the host:port pair
*/
static List<Tag> addressTags(final HostAndPort hostAndPort) {
Objects.requireNonNull(hostAndPort, "cannot create the tag without providing the hostAndPort");
List<Tag> tags = new ArrayList<>(2);
tags.add(Tag.of("host", hostAndPort.getHost()));
int port = hostAndPort.getPort();
if (port != 0) {
tags.add(Tag.of("port", Integer.toString(hostAndPort.getPort())));
}
return Collections.unmodifiableList(tags);
}

boolean isMetricsEnabled();

/**
* Convenience method to set the common tags for application (process), host and port.
*
* @param applicationName the application (process) name.
* @param hostAndPort the host:port pair
*/
void addServiceTags(final String applicationName, final HostAndPort hostAndPort);

/**
* Add the list of tag name / value pair to the common tags that will be emitted with all metrics.
* Common tags must ne added before initialization of any registries. Tags that are added after a
* registry is initialized may not be emitted by the underlying metrics system. This would cause
* inconsistent grouping and filtering based on tags,
*
* @param updates list of tags (name / value pairs)
*/
void addCommonTags(final List<Tag> updates);

/**
* Get the current list of common tags.
*/
Collection<Tag> getCommonTags();

void addRegistry(MeterRegistry registry);

void addMetricsProducers(MetricsProducer... producer);

/**
* Initialize the metrics system. This sets the list of common tags that are emitted with the
* metrics.
*/
void init();

MeterRegistry getRegistry();

/**
* Close the underlying registry and release resources. The registry will not accept new meters
* and will stop publishing metrics.
*/
void close();
}
Original file line number Diff line number Diff line change
Expand Up @@ -557,42 +557,6 @@
* <td>Distribution Summary</td>
* <td></td>
* </tr>
* <!-- ZooKeeper property cache -->
* <tr>
* <td>N/A</td>
* <td>N/A</td>
* <td>{@value #METRICS_PROPSTORE_LOAD_TIMER}</td>
* <td>Timer</td>
* <td></td>
* </tr>
* <tr>
* <td>N/A</td>
* <td>N/A</td>
* <td>{@value #METRICS_PROPSTORE_REFRESH_COUNT}</td>
* <td>Counter</td>
* <td></td>
* </tr>
* <tr>
* <td>N/A</td>
* <td>N/A</td>
* <td>{@value #METRICS_PROPSTORE_REFRESH_LOAD_COUNT}</td>
* <td>Counter</td>
* <td></td>
* </tr>
* <tr>
* <td>N/A</td>
* <td>N/A</td>
* <td>{@value #METRICS_PROPSTORE_EVICTION_COUNT}</td>
* <td>Counter</td>
* <td></td>
* </tr>
* <tr>
* <td>N/A</td>
* <td>N/A</td>
* <td>{@value #METRICS_PROPSTORE_ZK_ERROR_COUNT}</td>
* <td>Counter</td>
* <td></td>
* </tr>
* </table>
*
* @since 2.1.0
Expand Down Expand Up @@ -685,13 +649,6 @@ public interface MetricsProducer {
String METRICS_UPDATE_WALOG_WRITE = METRICS_UPDATE_PREFIX + "walog.write";
String METRICS_UPDATE_MUTATION_ARRAY_SIZE = METRICS_UPDATE_PREFIX + "mutation.arrays.size";

String METRICS_PROPSTORE_PREFIX = "accumulo.prop.store.";
String METRICS_PROPSTORE_LOAD_TIMER = METRICS_PROPSTORE_PREFIX + "load";
String METRICS_PROPSTORE_REFRESH_COUNT = METRICS_PROPSTORE_PREFIX + "refresh";
String METRICS_PROPSTORE_REFRESH_LOAD_COUNT = METRICS_PROPSTORE_PREFIX + "refresh.load";
String METRICS_PROPSTORE_EVICTION_COUNT = METRICS_PROPSTORE_PREFIX + "evictions";
String METRICS_PROPSTORE_ZK_ERROR_COUNT = METRICS_PROPSTORE_PREFIX + "zookeeper.error";

/**
* Build Micrometer Meter objects and register them with the registry
*/
Expand Down
149 changes: 0 additions & 149 deletions core/src/main/java/org/apache/accumulo/core/metrics/MetricsUtil.java

This file was deleted.

Loading