Skip to content

Commit

Permalink
Support service level metrics aggregate when missing pod context in e…
Browse files Browse the repository at this point in the history
…BPF Access Log Receiver (apache#12608)
  • Loading branch information
mrproliu authored Sep 10, 2024
1 parent a9d6f2a commit 1ff0c57
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/skywalking.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ jobs:
-Dcheckstyle.skip
- name: Verify builds are reproducible
run: ./mvnw -Dmaven.test.skip clean verify artifact:compare -Pall
- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
name: Upload distribution tar
with:
name: dist
Expand All @@ -202,7 +202,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
name: Download distribution tar
with:
name: dist
Expand All @@ -220,7 +220,7 @@ jobs:
docker save -o docker-images-skywalking-oap.tar skywalking/oap:latest
docker save -o docker-images-skywalking-ui.tar skywalking/ui:latest
- name: Upload docker images
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: docker-images-${{ matrix.java-version }}
path: docker-images-skywalking-*.tar
Expand Down Expand Up @@ -694,7 +694,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
name: Download docker images
with:
name: docker-images-11
Expand Down Expand Up @@ -733,7 +733,7 @@ jobs:
df -h
du -sh .
docker images
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
name: Upload Logs
with:
Expand Down Expand Up @@ -766,7 +766,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
name: Download docker images
with:
name: docker-images-11
Expand Down Expand Up @@ -794,7 +794,7 @@ jobs:
df -h
du -sh .
docker images
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
name: Upload Logs
with:
Expand All @@ -817,7 +817,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
name: Download docker images
with:
name: docker-images-${{ matrix.java-version }}
Expand Down
1 change: 1 addition & 0 deletions docs/en/changes/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
* Nacos as config server and cluster coordinator supports configuration contextPath.
* Update the endpoint name format to `<Method>:<Path>` in eBPF Access Log Receiver.
* Add self-observability metrics for OpenTelemetry receiver.
* Support service level metrics aggregate when missing pod context in eBPF Access Log Receiver.

#### UI

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,10 @@ protected void printDropReasons() {
}

protected KubernetesProcessAddress buildKubernetesAddressByIP(NodeInfo nodeInfo, IPAddress ipAddress) {
final ObjectID service = K8sInfoRegistry.getInstance().findServiceByIP(ipAddress.getHost());
if (service != ObjectID.EMPTY) {
return buildRemoteAddress(nodeInfo, service, null);
}
final ObjectID pod = K8sInfoRegistry.getInstance().findPodByIP(ipAddress.getHost());
if (pod == ObjectID.EMPTY) {
// if cannot found the address, then return the unknown address
Expand Down Expand Up @@ -513,7 +517,7 @@ protected KubernetesProcessAddress buildRemoteAddress(NodeInfo nodeInfo, ObjectI
}
return KubernetesProcessAddress.newBuilder()
.setServiceName(serviceName)
.setPodName(pod.name())
.setPodName(pod == null ? "" : pod.name())
.build();
}

Expand Down Expand Up @@ -585,7 +589,7 @@ public K8SService toService() {
}

public K8SServiceInstance toServiceInstance() {
if (Objects.equals(local, buildUnknownAddress())) {
if (Objects.equals(local, buildUnknownAddress()) || StringUtil.isEmpty(local.getPodName())) {
return null;
}
final K8SServiceInstance serviceInstance = new K8SServiceInstance();
Expand Down Expand Up @@ -619,6 +623,9 @@ public K8SServiceRelation toServiceRelation() {
}

public K8SServiceInstanceRelation toServiceInstanceRelation() {
if (StringUtil.isEmpty(local.getPodName()) || StringUtil.isEmpty(remote.getPodName())) {
return null;
}
final Tuple2<KubernetesProcessAddress, KubernetesProcessAddress> tuple = convertSourceAndDestAddress();
final K8SServiceInstanceRelation serviceInstanceRelation = new K8SServiceInstanceRelation();
final String sourceServiceName = buildServiceNameByAddress(nodeInfo, tuple._1);
Expand Down

0 comments on commit 1ff0c57

Please sign in to comment.