Skip to content

Commit

Permalink
Add service name formatter and remove unused codes
Browse files Browse the repository at this point in the history
  • Loading branch information
kezhenxu94 committed Oct 27, 2020
1 parent 95c2482 commit d23c4aa
Show file tree
Hide file tree
Showing 15 changed files with 215 additions and 285 deletions.
1 change: 1 addition & 0 deletions docs/en/setup/backend/configuration-vocabulary.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ core|default|role|Option values, `Mixed/Receiver/Aggregator`. **Receiver** mode
| envoy-metric| default| Read [receiver doc](backend-receivers.md) for more details | - | - |
| - | - | acceptMetricsService | Open Envoy Metrics Service analysis | SW_ENVOY_METRIC_SERVICE | true|
| - | - | alsHTTPAnalysis | Open Envoy Access Log Service analysis. Value = `k8s-mesh` means open the analysis | SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS | - |
| - | - | k8sServiceNameRule | `k8sServiceNameRule` allows you to customize the service name in ALS via Kubernetes metadata, the available variables are `pod`, `service`, e.g., you can use `${service.metadata.name}-${pod.metadata.labels.version}` to append the version number to the service name. Be careful, when using environment variables to pass this configuration, use single quotes(`''`) to avoid it being evaluated by the shell. | - |
| receiver-oc | default | Read [receiver doc](backend-receivers.md) for more details | - | - |
| - | - | gRPCHost|Binding IP of gRPC service. Services include gRPC data report and internal communication among OAP nodes| SW_OC_RECEIVER_GRPC_HOST | - |
| - | - | gRPCPort| Binding port of gRPC service | SW_OC_RECEIVER_GRPC_PORT | - |
Expand Down
7 changes: 7 additions & 0 deletions oap-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
<zookeeper.image.version>3.5</zookeeper.image.version>
<kafka-clients.version>2.4.1</kafka-clients.version>
<spring-kafka-test.version>2.4.6.RELEASE</spring-kafka-test.version>
<commons-beanutils.version>1.9.4</commons-beanutils.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -537,6 +538,12 @@
<artifactId>mvel2</artifactId>
<version>${mvel.version}</version>
</dependency>

<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>${commons-beanutils.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,11 @@ envoy-metric:
default:
acceptMetricsService: ${SW_ENVOY_METRIC_SERVICE:true}
alsHTTPAnalysis: ${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS:""}
# `k8sServiceNameRule` allows you to customize the service name in ALS via Kubernetes metadata,
# the available variables are `pod`, `service`, f.e., you can use `${service.metadata.name}-${pod.metadata.labels.version}`
# to append the version number to the service name.
# Be careful, when using environment variables to pass this configuration, use single quotes(`''`) to avoid it being evaluated by the shell.
k8sServiceNameRule: ${K8S_SERVICE_NAME_RULE:"${service.metadata.name}"}

prometheus-fetcher:
selector: ${SW_PROMETHEUS_FETCHER:default}
Expand Down
4 changes: 0 additions & 4 deletions oap-server/server-library/library-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,6 @@
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
<groupId>io.kubernetes</groupId>
<artifactId>client-java</artifactId>
</dependency>

<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
</dependency>

<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java-util</artifactId>
Expand All @@ -56,4 +62,4 @@
<scope>provided</scope>
</dependency>
</dependencies>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ public class EnvoyMetricReceiverConfig extends ModuleConfig {
@Getter
private boolean acceptMetricsService = false;
private String alsHTTPAnalysis;
@Getter
private String k8sServiceNameRule;

public List<String> getAlsHTTPAnalysis() {
if (Strings.isNullOrEmpty(alsHTTPAnalysis)) {
return Collections.EMPTY_LIST;
return Collections.emptyList();
}
return Arrays.stream(alsHTTPAnalysis.trim().split(",")).map(String::trim).collect(Collectors.toList());
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import lombok.Setter;
import lombok.ToString;

import static java.util.Objects.nonNull;

@Getter
@Setter
@ToString
Expand All @@ -43,13 +41,6 @@ public ServiceMetaInfo(String serviceName, String serviceInstanceName) {
this.serviceInstanceName = serviceInstanceName;
}

/**
* @return {@code true} if this object is completely constructed, otherwise {@code false}.
*/
public boolean isComplete() {
return nonNull(serviceName) && nonNull(serviceInstanceName);
}

@Setter
@Getter
@RequiredArgsConstructor
Expand Down
Loading

0 comments on commit d23c4aa

Please sign in to comment.