-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CASSANDRASC-111 Improve observability in Sidecar with Dropwizard metr…
…ics (#102) Patch by Saranya Krishnakumar; Reviewed by Yifan Cai, Francisco Guerrero for CASSANDRASC-111
- Loading branch information
Showing
38 changed files
with
1,406 additions
and
52 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
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
35 changes: 35 additions & 0 deletions
35
src/main/java/org/apache/cassandra/sidecar/config/MetricsConfiguration.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,35 @@ | ||
/* | ||
* 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 | ||
* | ||
* 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 org.apache.cassandra.sidecar.config; | ||
|
||
/** | ||
* Configuration needed for capturing metrics. | ||
*/ | ||
public interface MetricsConfiguration | ||
{ | ||
/** | ||
* @return global registry name to be used for registering sidecar metrics | ||
*/ | ||
String registryName(); | ||
|
||
/** | ||
* @return configuration needed for capturing metrics released by Vert.x framework. | ||
*/ | ||
VertxMetricsConfiguration vertxConfiguration(); | ||
} |
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
src/main/java/org/apache/cassandra/sidecar/config/VertxMetricsConfiguration.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 @@ | ||
/* | ||
* 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 | ||
* | ||
* 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 org.apache.cassandra.sidecar.config; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Holds configuration needed for enabling metrics capture in Vert.x framework, for analyzing from Sidecar. | ||
*/ | ||
public interface VertxMetricsConfiguration | ||
{ | ||
/** | ||
* @return boolean indicating whether metrics captured is enabled for Vert.x | ||
*/ | ||
boolean enabled(); | ||
|
||
/** | ||
* @return boolean indicating whether Vert.x metrics will be exposed via JMX | ||
*/ | ||
boolean exposeViaJMX(); | ||
|
||
/** | ||
* @return JMX domain to be used when metrics are exposed via JMX | ||
*/ | ||
String jmxDomainName(); | ||
|
||
/** | ||
* @return List of regexes used for identifying what server routes will be monitored | ||
*/ | ||
List<String> monitoredServerRouteRegexes(); | ||
} |
67 changes: 67 additions & 0 deletions
67
src/main/java/org/apache/cassandra/sidecar/config/yaml/MetricsConfigurationImpl.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,67 @@ | ||
/* | ||
* 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 | ||
* | ||
* 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 org.apache.cassandra.sidecar.config.yaml; | ||
|
||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import org.apache.cassandra.sidecar.config.MetricsConfiguration; | ||
import org.apache.cassandra.sidecar.config.VertxMetricsConfiguration; | ||
|
||
/** | ||
* Configuration needed for capturing metrics. | ||
*/ | ||
public class MetricsConfigurationImpl implements MetricsConfiguration | ||
{ | ||
public static final String DEFAULT_DROPWIZARD_REGISTRY_NAME = "cassandra_sidecar"; | ||
public static final VertxMetricsConfiguration DEFAULT_VERTX_METRICS_CONFIGURATION | ||
= new VertxMetricsConfigurationImpl(); | ||
|
||
@JsonProperty(value = "registry_name") | ||
protected final String registryName; | ||
@JsonProperty(value = "vertx") | ||
protected final VertxMetricsConfiguration vertxConfiguration; | ||
|
||
public MetricsConfigurationImpl() | ||
{ | ||
this(DEFAULT_DROPWIZARD_REGISTRY_NAME, DEFAULT_VERTX_METRICS_CONFIGURATION); | ||
} | ||
|
||
public MetricsConfigurationImpl(String registryName, VertxMetricsConfiguration vertxConfiguration) | ||
{ | ||
this.registryName = registryName; | ||
this.vertxConfiguration = vertxConfiguration; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public String registryName() | ||
{ | ||
return registryName; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
@Override | ||
public VertxMetricsConfiguration vertxConfiguration() | ||
{ | ||
return vertxConfiguration; | ||
} | ||
} |
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.