Update Groovy 3 to 4.0.15. (#11517)

This commit is contained in:
吴晟 Wu Sheng 2023-11-09 11:31:31 +08:00 committed by GitHub
parent 3cd149a46b
commit 3c8ac675b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
52 changed files with 6 additions and 14499 deletions

View File

@ -1,107 +0,0 @@
# 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.
name: GraalVM Community Edition build
on:
pull_request:
push:
concurrency:
group: skywalking-graalvm-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
SW_AGENT_JDK_VERSION: 8
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120
SEGMENT_DOWNLOAD_TIMEOUT_MINS: 5 # Cache restore timeout
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: graalvm/setup-graalvm@v1
with:
java-version: '17.0.8'
distribution: 'graalvm-community'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Native Compile
run: |
./mvnw -Pbackend,native clean package -Dmaven.test.skip
- uses: actions/upload-artifact@v3
name: Upload distribution tar
with:
name: native-pre-dist
path: graal/dist
- name: Build and save docker images
run: |
make -f graal/Makefile docker.oap || make -f graal/Makefile docker.oap
docker save -o docker-images-skywalking-oap.tar skywalking/oap:latest
- name: Upload docker images
uses: actions/upload-artifact@v3
with:
name: docker-images-native
path: docker-images-skywalking-*.tar
e2e-test:
if: |
always() && ! cancelled()
name: E2E test
needs: [build]
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
test:
- name: GraalVM Native Image Agent Test
config: test/e2e-v2/cases/go/e2e.yaml
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: actions/download-artifact@v3
name: Download docker images
with:
name: docker-images-native
path: docker-images
- name: Load docker images
run: |
find docker-images -name "*.tar" -exec docker load -i {} \;
find docker-images -name "*.tar" -exec rm {} \;
- name: Cache maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('test/e2e-v2/java-test-service/**/pom.xml') }}
restore-keys: ${{ runner.os }}-maven-
- name: Prepare test services
shell: bash
run: ./mvnw -B -q -f test/e2e-v2/java-test-service/pom.xml clean package
- name: Set env var
run: |
echo "${{ matrix.test.env }}" >> $GITHUB_ENV
- name: ${{ matrix.test.name }}
uses: apache/skywalking-infra-e2e@0a5b398fc9668ccb848b16e6da4f09180955dc3e
with:
e2e-file: $GITHUB_WORKSPACE/${{ matrix.test.config }}
- uses: actions/upload-artifact@v2
if: ${{ failure() }}
name: Upload Logs
with:
name: logs
path: "${{ env.SW_INFRA_E2E_LOG_DIR }}"

View File

@ -340,6 +340,7 @@ The text of each license is the standard Apache 2.0 license.
https://mvnrepository.com/artifact/org.apache.curator/curator-framework/4.3.0 Apache-2.0
https://mvnrepository.com/artifact/org.apache.curator/curator-recipes/4.3.0 Apache-2.0
https://mvnrepository.com/artifact/org.apache.curator/curator-x-discovery/4.3.0 Apache-2.0
https://mvnrepository.com/artifact/org.apache.groovy/groovy/4.0.15 Apache-2.0
https://mvnrepository.com/artifact/org.apache.httpcomponents/httpasyncclient/4.1.3 Apache-2.0
https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient/4.5.3 Apache-2.0
https://mvnrepository.com/artifact/org.apache.httpcomponents/httpcore/4.4.13 Apache-2.0
@ -351,7 +352,6 @@ The text of each license is the standard Apache 2.0 license.
https://mvnrepository.com/artifact/org.apache.yetus/audience-annotations/0.5.0 Apache-2.0
https://mvnrepository.com/artifact/org.apache.zookeeper/zookeeper/3.5.7 Apache-2.0
https://mvnrepository.com/artifact/org.apache.zookeeper/zookeeper-jute/3.5.7 Apache-2.0
https://mvnrepository.com/artifact/org.codehaus.groovy/groovy/3.0.8 Apache-2.0
https://mvnrepository.com/artifact/org.freemarker/freemarker/2.3.31 Apache-2.0
https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-reflect/1.7.10 Apache-2.0
https://mvnrepository.com/artifact/org.jetbrains.kotlin/kotlin-stdlib/1.7.10 Apache-2.0

View File

@ -2,9 +2,9 @@
#### Project
* Add distribution/graal module to make preliminary preparations for supporting native-image.
* Bump Java agent to 9.1-dev in the e2e tests.
* Bump up netty to 4.1.100.
* Update Groovy 3 to 4.0.15.
#### OAP Server
@ -31,7 +31,6 @@
* Add a component ID for Netty-http (ID=151).
* Add a component ID for Fiber (ID=5021).
* BanyanDBStorageClient: Add `define(Property property, PropertyStore.Strategy strategy)` API.
* Support GraalVM native-image (Experimental).
* Correct the file format and fix typos in the filenames for monitoring Kafka's e2e tests.
* Support extract timestamp from patterned datetime string in LAL.
* Support output key parameters in the booting logs.

View File

@ -1,77 +0,0 @@
# GraalVM native-image for SkyWalking (Experimental)
## Native-Image
Native Image is a technology to ahead-of-time compile Java code to a standalone executable, called a native image.
This executable includes the application classes, classes from its dependencies, runtime library classes,
and statically linked native code from JDK. It does not run on the Java VM, but includes necessary components like memory management, thread scheduling, and so on from a different runtime system, called “Substrate VM”.
Substrate VM is the name for the runtime components (like the deoptimizer, garbage collector, thread scheduling etc.).
The resulting program has faster startup time and lower runtime memory overhead compared to a JVM.
SkyWalking currently offers support for OAP servers running as native-image. However, please note that the OAP started in this manner does not have the same functionality as the regular OAP, and some features are not yet supported.
## Prerequisites
Before proceeding with the compilation process, it's crucial to have the GraalVM JDK installed on your machine as the native-image compilation is dependent on it.
### Installing GraalVM JDK
Refer to [GraalVM's official download page](https://www.graalvm.org/downloads/) for downloading and configuring GraalVM JDK. A convenient method is utilizing SDKMAN, which allows you to download and install GraalVM JDK with a single command:
```shell
sdk install java 17.0.9-graal
```
Upon executing the above command, SDKMAN will automatically download and install the specified version of GraalVM JDK, preparing your environment for the subsequent native-image compilation process.
### Installing Native Image
In some download methods, the Native Image component is not automatically installed and needs to be downloaded separately. Users can download this component by executing the following command:
```shell
gu install native-image
```
This command utilizes the GraalVM Updater (gu) to install the Native Image component, ensuring the environment is properly set up for native-image compilation.
## Compile Guide
Notice: If you are not familiar with the compilation process, please read [How-to-build](../../guides/How-to-build.md) first.
The native-image compilation is not enabled by default. To enable it, we need to activate `native` profile during compilation, such as:
```shell
./mvnw -Pbackend,native clean package -Dmaven.test.skip
```
Then, 2 packages are in `graal/dist`,
As this is an experimental feature, a package named `apache-skywalking-apm-native-pre-bin.tar.gz` is a tarball for GraalVMization friendly, including original classes to be compiled by GraalVM.
The package named `apache-skywalking-apm-native-bin.tar.gz` includes the final compiled native binary, relative configuration files, and booting shells. Read `Package Structure` doc for more details.
## Package Structure
SkyWalkings native-image distribution package consists of the following parts:
* bin/cmd scripts: Located in the /bin folder. Includes startup Linux shell and Windows cmd scripts for the backend server.
* Backend config: Located in the /config folder. Includes settings files of the backend. Running native-image does not require additional configuration, so you can refer to [backend-setup](backend-setup.md) to learn how to configure it.
* Native image executable: Located in /image folder. It can be run directly, but it is not recommended to do so, as the absence of some environment variables can lead to startup failure.
## How To Use
By executing following:
```shell
./bin/oapService-native.sh
```
we can successfully start SkyWalking-oap.
## Differences and TODO
With native-image, some features are not yet supported.
1. [LAL](../../concepts-and-designs/lal.md), [MAL](../../concepts-and-designs/mal.md), and some other features related to them are not supported at the moment.
2. The [OAL](../../concepts-and-designs/oal.md) files are used in the compiling stage, which means that users would not see these files inside the native image package, and can't change it. Consider recompiling and packaging from the source codes including your OAL file changes.
## Current Limitations
Native-image supports reflection and other dynamic features through some JSON-formatted configuration files. SkyWalking currently provides a set of configuration files for basic support. You can find them [here](../../../../graal/graal-server-starter/src/main/resources/META-INF/native-image/main).
For now, these configuration files do not support all runtime environments (but will be fully supported in the future). Therefore, in other environments, users may need to generate the configuration files required by native-image on their own.
SkyWalking uses [native build tools](https://graalvm.github.io/native-build-tools/latest/maven-plugin.html) to generate native-image. Additionally, GraalVM provides an agent to assist in generating configuration files. Therefore, users can generate the required configuration files by referring to [native build tools agent guide](https://graalvm.github.io/native-build-tools/latest/maven-plugin.html#agent-support).

View File

@ -59,8 +59,6 @@ catalog:
path: "/en/setup/backend/backend-docker"
- name: "Run with Kubernetes"
path: "/en/setup/backend/backend-k8s"
- name: "Run with GraalVM (Experimental)"
path: "/en/setup/backend/backend-graalvm"
- name: "Configuration Vocabulary"
path: "/en/setup/backend/configuration-vocabulary"
- name: "Advanced Setup"

View File

@ -1,49 +0,0 @@
# 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.
SHELL := /bin/bash -o pipefail
SW_GRAAL_ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
CONTEXT = ${SW_GRAAL_ROOT}/dist
DIST ?= apache-skywalking-apm-native-bin.tar.gz
CLI_VERSION ?= 0.12.0 # CLI version inside OAP image should always use an Apache released artifact.
HUB ?= skywalking
TAG ?= latest
DOCKER_BUILD_TOP:=${CONTEXT}/docker_build
NAME := oap
LOAD_OR_PUSH = --load
BUILD_ARGS := $(BUILD_ARGS) --build-arg DIST=$(DIST) --build-arg SKYWALKING_CLI_VERSION=$(CLI_VERSION)
docker.% push.docker.%: $(CONTEXT)/$(DIST) $(SW_GRAAL_ROOT)/docker/%/*
$(DOCKER_RULE)
define DOCKER_RULE
mkdir -p $(DOCKER_BUILD_TOP)/$(NAME)
cp -r $^ $(DOCKER_BUILD_TOP)/$(NAME)
docker buildx create --use --driver docker-container --name skywalking_main > /dev/null 2>&1 || true
docker buildx build $(PLATFORMS) $(LOAD_OR_PUSH) \
--no-cache $(BUILD_ARGS) \
-t $(HUB)/$(NAME):$(TAG) \
-t $(HUB)/$(NAME):latest \
$(DOCKER_BUILD_TOP)/$(NAME)
docker buildx rm skywalking_main || true
endef

View File

@ -1,121 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.skywalking</groupId>
<artifactId>graal</artifactId>
<version>9.7.0-SNAPSHOT</version>
</parent>
<artifactId>apache-skywalking-native-apm</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>graal-server-starter</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>native</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>copy-dependencies</id>
<phase>package</phase>
<goals>
<goal>copy-dependencies</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope>
<outputDirectory>${project.build.directory}/oap-libs</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>dist-native-pre</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>apache-skywalking-apm-native-pre-bin</finalName>
<descriptors>
<descriptor>${project.basedir}/src/main/assembly/binary-native-pre.xml</descriptor>
</descriptors>
</configuration>
</execution>
<execution>
<id>dist-native</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>apache-skywalking-apm-native-bin</finalName>
<descriptors>
<descriptor>${project.basedir}/src/main/assembly/binary-native.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
<configuration>
<attach>true</attach>
<tarLongFileMode>posix</tarLongFileMode>
<runOnlyAtExecutionRoot>false</runOnlyAtExecutionRoot>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>dist</id>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<copy file="${project.build.directory}/apache-skywalking-apm-native-pre-bin.tar.gz" tofile="${project.basedir}/../dist/apache-skywalking-apm-native-pre-bin.tar.gz" overwrite="true" />
<copy file="${project.build.directory}/apache-skywalking-apm-native-bin.tar.gz" tofile="${project.basedir}/../dist/apache-skywalking-apm-native-bin.tar.gz" overwrite="true" />
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -1,125 +0,0 @@
<!--
~ 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.
~
-->
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>dist</id>
<formats>
<format>tar.gz</format>
</formats>
<fileSets>
<fileSet>
<directory>${project.basedir}/../../dist-material</directory>
<outputDirectory>config</outputDirectory>
<includes>
<include>log4j2.xml</include>
<include>alarm-settings.yml</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.basedir}/../../dist-material</directory>
<outputDirectory/>
<includes>
<include>config-examples/*</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.basedir}/../../oap-server/server-starter/src/main/resources</directory>
<includes>
<include>component-libraries.yml</include>
<include>gateways.yml</include>
<include>service-apdex-threshold.yml</include>
<include>endpoint-name-grouping.yml</include>
<include>metadata-service-mapping.yaml</include>
<include>trace-sampling-policy-settings.yml</include>
<include>oal/*.oal</include>
<include>fetcher-prom-rules/*.yaml</include>
<include>envoy-metrics-rules/**</include>
<include>meter-analyzer-config/*.yaml</include>
<include>zabbix-rules/*.yaml</include>
<include>openapi-definitions/*/*.yaml</include>
<include>otel-rules/**</include>
<include>ui-initialized-templates/*/*.json</include>
<include>ui-initialized-templates/menu.yaml</include>
<include>lal/*</include>
<include>log-mal-rules/**</include>
<include>telegraf-rules/*</include>
</includes>
<outputDirectory>config</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.basedir}/target/oap-libs</directory>
<outputDirectory>oap-libs</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.basedir}/../../oap-server/server-tools/profile-exporter/tool-profile-snapshot-exporter/target/oap-libs</directory>
<outputDirectory>oap-libs</outputDirectory>
</fileSet>
<!-- data generator -->
<fileSet>
<directory>${project.basedir}/../../oap-server/server-tools/data-generator/target/</directory>
<includes>
<include>data-generator-${project.version}.jar</include>
</includes>
<outputDirectory>oap-libs</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.basedir}/../../oap-server/server-tools/data-generator/src/main/assembly/bin</directory>
<outputDirectory>tools/data-generator/bin</outputDirectory>
<includes>
<include>*.sh</include>
</includes>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>${project.basedir}/../../oap-server/server-tools/data-generator/src/main/resources</directory>
<outputDirectory>tools/data-generator/config</outputDirectory>
<includes>
<include>application.yml</include>
</includes>
</fileSet>
<!-- data generator -->
<!-- Profile exporter tools -->
<fileSet>
<directory>${project.basedir}/../../tools/profile-exporter</directory>
<outputDirectory>tools/profile-exporter</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.basedir}/../../dist-material/release-docs</directory>
<outputDirectory/>
</fileSet>
</fileSets>
<files>
<file>
<source>${project.basedir}/../graal-server-starter/src/main/resources/application.yml</source>
<outputDirectory>config</outputDirectory>
<fileMode>0644</fileMode>
</file>
<file>
<source>${project.basedir}/../dist-material/bin/oapService-native-jar.sh</source>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</file>
</files>
</assembly>

View File

@ -1,121 +0,0 @@
<!--
~ 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.
~
-->
<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
<id>dist</id>
<formats>
<format>tar.gz</format>
</formats>
<fileSets>
<fileSet>
<directory>${project.basedir}/../../dist-material</directory>
<outputDirectory>config</outputDirectory>
<includes>
<include>log4j2.xml</include>
<include>alarm-settings.yml</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.basedir}/../../dist-material</directory>
<outputDirectory/>
<includes>
<include>config-examples/*</include>
</includes>
</fileSet>
<fileSet>
<directory>${project.basedir}/../../oap-server/server-starter/src/main/resources</directory>
<includes>
<include>component-libraries.yml</include>
<include>gateways.yml</include>
<include>service-apdex-threshold.yml</include>
<include>endpoint-name-grouping.yml</include>
<include>metadata-service-mapping.yaml</include>
<include>trace-sampling-policy-settings.yml</include>
<include>oal/*.oal</include>
<include>fetcher-prom-rules/*.yaml</include>
<include>envoy-metrics-rules/**</include>
<include>meter-analyzer-config/*.yaml</include>
<include>zabbix-rules/*.yaml</include>
<include>openapi-definitions/*/*.yaml</include>
<include>otel-rules/**</include>
<include>ui-initialized-templates/*/*.json</include>
<include>ui-initialized-templates/menu.yaml</include>
<include>lal/*</include>
<include>log-mal-rules/**</include>
<include>telegraf-rules/*</include>
</includes>
<outputDirectory>config</outputDirectory>
</fileSet>
<!-- data generator -->
<fileSet>
<directory>${project.basedir}/../../oap-server/server-tools/data-generator/target/</directory>
<includes>
<include>data-generator-${project.version}.jar</include>
</includes>
<outputDirectory>oap-libs</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.basedir}/../../oap-server/server-tools/data-generator/src/main/assembly/bin</directory>
<outputDirectory>tools/data-generator/bin</outputDirectory>
<includes>
<include>*.sh</include>
</includes>
<fileMode>0755</fileMode>
</fileSet>
<fileSet>
<directory>${project.basedir}/../../oap-server/server-tools/data-generator/src/main/resources</directory>
<outputDirectory>tools/data-generator/config</outputDirectory>
<includes>
<include>application.yml</include>
</includes>
</fileSet>
<!-- data generator -->
<!-- Profile exporter tools -->
<fileSet>
<directory>${project.basedir}/../../tools/profile-exporter</directory>
<outputDirectory>tools/profile-exporter</outputDirectory>
</fileSet>
<fileSet>
<directory>${project.basedir}/../../dist-material/release-docs</directory>
<outputDirectory/>
</fileSet>
</fileSets>
<files>
<file>
<source>${project.basedir}/../graal-server-starter/src/main/resources/application.yml</source>
<outputDirectory>config</outputDirectory>
<fileMode>0644</fileMode>
</file>
<file>
<source>${project.basedir}/../dist-material/bin/oapService-native.sh</source>
<outputDirectory>bin</outputDirectory>
<fileMode>0755</fileMode>
</file>
<file>
<source>${project.basedir}/../graal-server-starter/target/skywalking-oap-native</source>
<outputDirectory>image</outputDirectory>
<fileMode>0755</fileMode>
</file>
</files>
</assembly>

View File

@ -1,45 +0,0 @@
#!/usr/bin/env sh
# 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.
PRG="$0"
PRGDIR=$(dirname "$PRG")
[ -z "$OAP_HOME" ] && OAP_HOME=$(cd "$PRGDIR/.." > /dev/null || exit 1; pwd)
OAP_LOG_DIR="${OAP_LOG_DIR:-${OAP_HOME}/logs}"
JAVA_OPTS="${JAVA_OPTS:- -Xms256M -Xmx4096M}"
if [ ! -d "${OAP_LOG_DIR}" ]; then
mkdir -p "${OAP_LOG_DIR}"
fi
export SW_CONFIG_PATHS=${OAP_HOME}/config
_RUNJAVA=${JAVA_HOME}/bin/java
[ -z "$JAVA_HOME" ] && _RUNJAVA=java
CLASSPATH="$OAP_HOME/config:$CLASSPATH"
for i in "$OAP_HOME"/oap-libs/*.jar
do
CLASSPATH="$i:$CLASSPATH"
done
OAP_OPTIONS=" -Doap.logDir=${OAP_LOG_DIR}"
eval exec "\"$_RUNJAVA\" ${JAVA_OPTS} ${OAP_OPTIONS} -classpath $CLASSPATH org.apache.skywalking.oap.server.starter.OAPServerStartUp \
2>${OAP_LOG_DIR}/oap.log 1> /dev/null"

View File

@ -1,32 +0,0 @@
#!/usr/bin/env sh
# 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.
PRG="$0"
PRGDIR=$(dirname "$PRG")
[ -z "$OAP_HOME" ] && OAP_HOME=$(cd "$PRGDIR/.." > /dev/null || exit 1; pwd)
OAP_LOG_DIR="${OAP_LOG_DIR:-${OAP_HOME}/logs}"
if [ ! -d "${OAP_LOG_DIR}" ]; then
mkdir -p "${OAP_LOG_DIR}"
fi
export SW_CONFIG_PATHS=${OAP_HOME}/config
${OAP_HOME}/image/skywalking-oap-native

View File

@ -1,41 +0,0 @@
# 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.
ARG BASE_IMAGE='eclipse-temurin:11-jre'
ARG SKYWALKING_CLI_VERSION
FROM apache/skywalking-cli:$SKYWALKING_CLI_VERSION as cli
FROM --platform=linux/amd64 ubuntu:latest
ENV SKYWALKING_HOME=/skywalking
WORKDIR $SKYWALKING_HOME
ARG DIST
COPY "$DIST" .
RUN set -ex; \
tar -xzf "$DIST" --strip 1; \
rm -rf "$DIST";
COPY --from=cli /swctl ./bin
EXPOSE 12800 11800 1234
ENTRYPOINT ["bash", "bin/oapService-native.sh"]

View File

@ -1,40 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.skywalking</groupId>
<artifactId>graal</artifactId>
<version>9.7.0-SNAPSHOT</version>
</parent>
<artifactId>envoy-metrics-receiver-plugin-graal-native</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>envoy-metrics-receiver-plugin</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>

View File

@ -1,39 +0,0 @@
/*
* 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.skywalking.oap.server.receiver.envoy.graal;
import org.apache.skywalking.oap.server.library.module.ModuleStartException;
import org.apache.skywalking.oap.server.library.module.ServiceNotProvidedException;
import org.apache.skywalking.oap.server.receiver.envoy.EnvoyMetricReceiverProvider;
/**
* TODO, disabled envoy metric receiver due to the Graal limitation on defining hidden class at runtime.
* SkyWalking will provide an alternative solution to replace the hidden class defining in the near future.
*/
public class EnvoyMetricReceiverProviderGraal extends EnvoyMetricReceiverProvider {
@Override
public String name() {
return "graalvm";
}
@Override
public void prepare() throws ServiceNotProvidedException, ModuleStartException {
}
}

View File

@ -1,19 +0,0 @@
#
# 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.
#
#
org.apache.skywalking.oap.server.receiver.envoy.graal.EnvoyMetricReceiverProviderGraal

View File

@ -1,24 +0,0 @@
#!/usr/bin/env sh
# 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.
PRG="$0"
PRGDIR=$(dirname "$PRG")
OAP_ROOT=$PRGDIR/../..
CONFIG_PATH=$PRGDIR/../graal-server-starter/target/classes/META-INF/native-image/main
$OAP_ROOT/mvnw -f $OAP_ROOT/pom.xml -Pbackend test -DargLine="-agentlib:native-image-agent=config-merge-dir=$CONFIG_PATH --add-opens java.base/java.lang=ALL-UNNAMED"
echo Generated config files are loacated in $CONFIG_PATH

View File

@ -1,24 +0,0 @@
#!/usr/bin/env sh
# 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.
PRG="$0"
PRGDIR=$(dirname "$PRG")
OAP_ROOT=$PRGDIR/../..
CONFIG_PATH=$PRGDIR/../graal-server-starter/target/classes/META-INF/native-image/main
$OAP_ROOT/mvnw -f $OAP_ROOT/pom.xml -Pbackend,native test integration-test -DargLine="-agentlib:native-image-agent=config-merge-dir=$CONFIG_PATH --add-opens java.base/java.lang=ALL-UNNAMED"
echo Generated config files are loacated in $CONFIG_PATH

View File

@ -1,62 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.skywalking</groupId>
<artifactId>graal</artifactId>
<version>9.7.0-SNAPSHOT</version>
</parent>
<artifactId>graal-package-IT</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>server-starter</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>kafka</artifactId>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>server-testing</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>junit-jupiter</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -1,104 +0,0 @@
/*
* 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.skywalking.oap.server.analyzer.agent.kafka.provider;
import org.apache.skywalking.oap.log.analyzer.module.LogAnalyzerModule;
import org.apache.skywalking.oap.log.analyzer.provider.LogAnalyzerModuleConfig;
import org.apache.skywalking.oap.log.analyzer.provider.log.ILogAnalyzerService;
import org.apache.skywalking.oap.log.analyzer.provider.log.LogAnalyzerServiceImpl;
import org.apache.skywalking.oap.server.analyzer.agent.kafka.module.KafkaFetcherConfig;
import org.apache.skywalking.oap.server.analyzer.module.AnalyzerModule;
import org.apache.skywalking.oap.server.analyzer.provider.AnalyzerModuleConfig;
import org.apache.skywalking.oap.server.analyzer.provider.trace.parser.ISegmentParserService;
import org.apache.skywalking.oap.server.analyzer.provider.trace.parser.SegmentParserServiceImpl;
import org.apache.skywalking.oap.server.core.CoreModule;
import org.apache.skywalking.oap.server.core.source.SourceReceiver;
import org.apache.skywalking.oap.server.core.source.SourceReceiverImpl;
import org.apache.skywalking.oap.server.library.module.ModuleManager;
import org.apache.skywalking.oap.server.library.module.ModuleStartException;
import org.apache.skywalking.oap.server.telemetry.TelemetryModule;
import org.apache.skywalking.oap.server.telemetry.api.MetricsCreator;
import org.apache.skywalking.oap.server.telemetry.none.MetricsCreatorNoop;
import org.apache.skywalking.oap.server.testing.module.mock.MockModuleManager;
import org.apache.skywalking.oap.server.testing.module.mock.MockModuleProvider;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.junit.jupiter.MockitoExtension;
import org.testcontainers.containers.KafkaContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.utility.DockerImageName;
@Testcontainers
@ExtendWith(MockitoExtension.class)
public class KafkaFetcherModuleStartIT {
private ModuleManager moduleManager;
@Container
KafkaContainer container = new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka:7.1.0-1-ubi8"));
@BeforeEach
public void init() {
moduleManager = new MockModuleManager() {
@Override
protected void init() {
register(CoreModule.NAME, () -> new MockModuleProvider() {
@Override
protected void register() {
registerServiceImplementation(SourceReceiver.class, new SourceReceiverImpl());
}
});
register(AnalyzerModule.NAME, () -> new MockModuleProvider() {
@Override
protected void register() {
registerServiceImplementation(ISegmentParserService.class, new SegmentParserServiceImpl(moduleManager, new AnalyzerModuleConfig()));
}
});
register(TelemetryModule.NAME, () -> new MockModuleProvider() {
@Override
protected void register() {
registerServiceImplementation(MetricsCreator.class, new MetricsCreatorNoop());
}
});
register(LogAnalyzerModule.NAME, () -> new MockModuleProvider() {
@Override
protected void register() {
registerServiceImplementation(ILogAnalyzerService.class, new LogAnalyzerServiceImpl(moduleManager, new LogAnalyzerModuleConfig()));
}
});
}
};
}
@Test
public void startProvider() throws ModuleStartException {
KafkaFetcherProvider kafkaFetcherProvider = new KafkaFetcherProvider();
kafkaFetcherProvider.setManager(moduleManager);
KafkaFetcherConfig kafkaFetcherConfig = new KafkaFetcherConfig();
kafkaFetcherConfig.setReplicationFactor(1);
kafkaFetcherConfig.setBootstrapServers(container.getBootstrapServers());
kafkaFetcherProvider.newConfigCreator().onInitialized(kafkaFetcherConfig);
kafkaFetcherProvider.prepare();
kafkaFetcherProvider.start();
}
}

View File

@ -1,95 +0,0 @@
/*
* 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.skywalking.oap.server.storage.plugin.banyandb;
import org.apache.skywalking.oap.server.core.CoreModule;
import org.apache.skywalking.oap.server.core.storage.model.ModelCreator;
import org.apache.skywalking.oap.server.core.storage.model.StorageModels;
import org.apache.skywalking.oap.server.library.module.ModuleManager;
import org.apache.skywalking.oap.server.library.module.ModuleStartException;
import org.apache.skywalking.oap.server.telemetry.TelemetryModule;
import org.apache.skywalking.oap.server.telemetry.api.MetricsCreator;
import org.apache.skywalking.oap.server.telemetry.none.MetricsCreatorNoop;
import org.apache.skywalking.oap.server.testing.module.mock.MockModuleManager;
import org.apache.skywalking.oap.server.testing.module.mock.MockModuleProvider;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.junit.jupiter.MockitoExtension;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.utility.DockerImageName;
@Testcontainers
@ExtendWith(MockitoExtension.class)
public class StorageModuleBanyanDBProviderFunctionalIT {
private BanyanDBStorageConfig banyanDBStorageConfig;
@Container
public final GenericContainer<?> container =
new GenericContainer<>(DockerImageName.parse("ghcr.io/apache/skywalking-banyandb:dea8c1e37d4dc19fe18397deb576151a22e2fad8"))
.waitingFor(Wait.forLogMessage(".*Start liaison http server.*", 1))
.withCommand(
"standalone",
"--stream-root-path", "/tmp/stream-data",
"--measure-root-path", "/tmp/measure-data"
)
.withExposedPorts(17912);
private ModuleManager moduleManager;
@BeforeEach
public void init() {
moduleManager = new MockModuleManager() {
@Override
protected void init() {
register(CoreModule.NAME, () -> new MockModuleProvider() {
@Override
protected void register() {
registerServiceImplementation(ModelCreator.class, new StorageModels());
}
});
register(TelemetryModule.NAME, () -> new MockModuleProvider() {
@Override
protected void register() {
registerServiceImplementation(MetricsCreator.class, new MetricsCreatorNoop());
}
});
}
};
}
@Test
public void providerPrepareAndStart() throws ModuleStartException {
BanyanDBStorageProvider banyanDBStorageProvider = new BanyanDBStorageProvider();
banyanDBStorageProvider.setManager(moduleManager);
banyanDBStorageConfig = new BanyanDBStorageConfig();
banyanDBStorageConfig.setTargets(container.getHost() + ":" + container.getMappedPort(17912));
banyanDBStorageProvider.newConfigCreator().onInitialized(banyanDBStorageConfig);
banyanDBStorageProvider.prepare();
banyanDBStorageProvider.start();
}
}

View File

@ -1,94 +0,0 @@
/*
* 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.skywalking.oap.server.storage.plugin.elasticsearch.base;
import org.apache.skywalking.oap.server.core.CoreModule;
import org.apache.skywalking.oap.server.core.CoreModuleConfig;
import org.apache.skywalking.oap.server.core.CoreModuleProvider;
import org.apache.skywalking.oap.server.core.config.ConfigService;
import org.apache.skywalking.oap.server.core.storage.model.ModelCreator;
import org.apache.skywalking.oap.server.core.storage.model.StorageModels;
import org.apache.skywalking.oap.server.library.module.ModuleManager;
import org.apache.skywalking.oap.server.library.module.ModuleStartException;
import org.apache.skywalking.oap.server.storage.plugin.elasticsearch.StorageModuleElasticsearchConfig;
import org.apache.skywalking.oap.server.storage.plugin.elasticsearch.StorageModuleElasticsearchProvider;
import org.apache.skywalking.oap.server.telemetry.TelemetryModule;
import org.apache.skywalking.oap.server.telemetry.api.MetricsCreator;
import org.apache.skywalking.oap.server.telemetry.none.MetricsCreatorNoop;
import org.apache.skywalking.oap.server.testing.module.mock.MockModuleManager;
import org.apache.skywalking.oap.server.testing.module.mock.MockModuleProvider;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.junit.jupiter.MockitoExtension;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.utility.DockerImageName;
@Testcontainers
@ExtendWith(MockitoExtension.class)
public class StorageModuleElasticSearchProviderFunctionalIT {
private StorageModuleElasticsearchConfig elasticsearchConfig;
@Container
public final GenericContainer<?> container =
new GenericContainer<>(DockerImageName.parse("elasticsearch:7.17.12"))
.waitingFor(Wait.forHttp("/_cluster/health"))
.withEnv("discovery.type", "single-node")
.withExposedPorts(9200);
private ModuleManager moduleManager;
@BeforeEach
public void init() {
moduleManager = new MockModuleManager() {
@Override
protected void init() {
register(CoreModule.NAME, () -> new MockModuleProvider() {
@Override
protected void register() {
registerServiceImplementation(ModelCreator.class, new StorageModels());
registerServiceImplementation(ConfigService.class, new ConfigService(new CoreModuleConfig(), new CoreModuleProvider()));
}
});
register(TelemetryModule.NAME, () -> new MockModuleProvider() {
@Override
protected void register() {
registerServiceImplementation(MetricsCreator.class, new MetricsCreatorNoop());
}
});
}
};
}
@Test
public void providerPrepareAndStart() throws ModuleStartException {
StorageModuleElasticsearchProvider elasticsearchProvider = new StorageModuleElasticsearchProvider();
elasticsearchProvider.setManager(moduleManager);
elasticsearchConfig = new StorageModuleElasticsearchConfig();
elasticsearchConfig.setClusterNodes(container.getHost() + ":" + container.getMappedPort(9200));
elasticsearchProvider.newConfigCreator().onInitialized(elasticsearchConfig);
elasticsearchProvider.prepare();
elasticsearchProvider.start();
}
}

View File

@ -1,52 +0,0 @@
/*
* 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.skywalking.oap.server.telemetry.prometheus;
import org.apache.skywalking.oap.server.library.module.ModuleStartException;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.junit.jupiter.MockitoExtension;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
@Testcontainers
@ExtendWith(MockitoExtension.class)
public class TelemetryPrometheusModuleStartTestIT {
@Container
public final GenericContainer<?> container =
new GenericContainer<>("prom/prometheus:v2.30.0")
.withExposedPorts(9090)
.waitingFor(Wait.forHttp("/-/healthy").forPort(9090).forStatusCode(200));
@Test
public void moduleStart() throws ModuleStartException {
PrometheusTelemetryProvider prometheusTelemetryProvider = new PrometheusTelemetryProvider();
PrometheusConfig config = new PrometheusConfig();
config.setHost(container.getHost());
config.setPort(container.getMappedPort(9090));
prometheusTelemetryProvider.newConfigCreator().onInitialized(config);
prometheusTelemetryProvider.prepare();
prometheusTelemetryProvider.start();
}
}

View File

@ -1,186 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.skywalking</groupId>
<artifactId>graal</artifactId>
<version>9.7.0-SNAPSHOT</version>
</parent>
<artifactId>graal-server-starter</artifactId>
<properties>
<image.name>skywalking-oap-native</image.name>
</properties>
<dependencies>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>server-starter</artifactId>
<version>${project.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.skywalking</groupId>
<artifactId>meter-analyzer</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.skywalking</groupId>
<artifactId>log-analyzer</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.skywalking</groupId>
<artifactId>server-core</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.skywalking</groupId>
<artifactId>oal-rt</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.skywalking</groupId>
<artifactId>agent-analyzer</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.skywalking</groupId>
<artifactId>library-util</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>envoy-metrics-receiver-plugin-graal-native</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>library-util-graal-native</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>meter-analyzer-graal-native</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>server-core-graal-native</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>log-analyzer-graal-native</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>oal-rt-graal-native</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<profiles>
<profile>
<id>native</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.skywalking</groupId>
<artifactId>skywalking-on-graal-compiling-plugin</artifactId>
<version>${project.version}</version>
<executions>
<execution>
<id>generate</id>
<goals>
<goal>oal-generate</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<id>native-config-generator</id>
<goals>
<goal>exec</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<executable>sh</executable>
<arguments>
<argument>${project.build.directory}/../../graal-config-generator/configGenerator.sh</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>native-config-filter</id>
<goals>
<goal>exec</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<executable>java</executable>
<workingDirectory>${project.build.directory}</workingDirectory>
<arguments>
<argument>-classpath</argument>
<classpath/>
<argument>org.apache.skywalking.oap.graal.NativeConfigFilter</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.graalvm.buildtools</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>0.9.21</version>
<extensions>true</extensions>
<executions>
<execution>
<id>build-native</id>
<goals>
<goal>compile-no-fork</goal>
</goals>
<phase>package</phase>
</execution>
</executions>
<configuration>
<verbose>true</verbose>
<imageName>${image.name}</imageName>
<mainClass>org.apache.skywalking.oap.server.starter.OAPServerStartUp</mainClass>
<metadataRepository>
<enabled>true</enabled>
</metadataRepository>
<useArgFile>true</useArgFile>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>

View File

@ -1,141 +0,0 @@
/*
* 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.skywalking.oap.graal;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.google.common.reflect.ClassPath;
import org.apache.skywalking.oap.server.library.module.ModuleConfig;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
public class NativeConfigFilter {
// related https://github.com/oracle/graal/issues/4797
private static Set<String> UNSUPPORTED_ELEMENTS = Set.of("jdk.internal.loader.BuiltinClassLoader",
"jdk.internal.loader.ClassLoaders$AppClassLoader",
"jdk.internal.loader.ClassLoaders$PlatformClassLoader"
);
private static Set<String> NEED_REFLECT_PACKAGE_NAME = Set.of(
"org.apache.skywalking.oap.server.core.query",
"org.apache.skywalking.oap.query.graphql.resolver",
"org.apache.skywalking.oap.query.graphql.type"
);
public static void main(String[] args) throws IOException {
ObjectMapper objectMapper = new ObjectMapper();
URL resourceUrl = NativeConfigFilter.class
.getClassLoader().getResource("META-INF/native-image/main/reflect-config.json");
if (resourceUrl == null) {
throw new IllegalArgumentException("File not found!");
}
File jsonFile = new File(resourceUrl.getFile());
ArrayNode arrayNode = (ArrayNode) objectMapper.readTree(jsonFile);
List<String> filteredClasses = findAllSubclasses(ModuleConfig.class);
NEED_REFLECT_PACKAGE_NAME.forEach(name -> {
List<String> allClassUnderPackage = findAllClassUnderPackage(name);
filteredClasses.addAll(allClassUnderPackage);
});
// for kafka
filteredClasses.add("org.apache.kafka.clients.consumer.RangeAssignor");
List<ObjectNode> objectNodes = filteredClasses.stream()
.map(className -> generateConfig(className))
.collect(Collectors.toList());
List<String> objectNodesName = objectNodes.stream()
.map(objectNode -> objectNode.get("name").asText()).collect(Collectors.toList());
List<JsonNode> elementsToKeep = new ArrayList<>();
for (JsonNode element : arrayNode) {
String name = element.get("name").asText();
if (!UNSUPPORTED_ELEMENTS.contains(name) && !objectNodesName.contains(name)) {
elementsToKeep.add(element);
}
}
elementsToKeep.addAll(objectNodes);
ArrayNode newArrayNode = objectMapper.valueToTree(elementsToKeep);
objectMapper.writeValue(jsonFile, newArrayNode);
}
private static List<String> findAllClassUnderPackage(String packageName) {
List<String> subclasses = new ArrayList<>();
ClassPath classpath;
try {
classpath = ClassPath.from(NativeConfigFilter.class.getClassLoader());
for (ClassPath.ClassInfo classInfo : classpath.getTopLevelClassesRecursive(packageName)) {
Class<?> clazz = classInfo.load();
subclasses.add(clazz.getName());
}
} catch (IOException e) {
e.printStackTrace();
}
return subclasses;
}
private static List<String> findAllSubclasses(Class<?> baseClass) {
List<String> subclasses = new ArrayList<>();
ClassPath classpath;
try {
classpath = ClassPath.from(baseClass.getClassLoader());
for (ClassPath.ClassInfo classInfo : classpath.getTopLevelClassesRecursive("org.apache.skywalking")) {
Class<?> clazz = classInfo.load();
if (baseClass.isAssignableFrom(clazz) && !baseClass.equals(clazz)) {
subclasses.add(classInfo.getName());
}
}
} catch (IOException e) {
e.printStackTrace();
}
return subclasses;
}
private static ObjectNode generateConfig(String className) {
JsonNodeFactory nodeFactory = JsonNodeFactory.instance;
ObjectNode rootNode = nodeFactory.objectNode();
rootNode.put("name", className);
rootNode.put("allDeclaredFields", true);
rootNode.put("allDeclaredClasses", true);
rootNode.put("allDeclaredMethods", true);
rootNode.put("allDeclaredConstructors", true);
return rootNode;
}
}

View File

@ -1,115 +0,0 @@
[
{
"name":"[Lcom.sun.management.internal.DiagnosticCommandArgumentInfo;"
},
{
"name":"[Lcom.sun.management.internal.DiagnosticCommandInfo;"
},
{
"name":"com.sun.management.internal.DiagnosticCommandArgumentInfo",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String","java.lang.String","java.lang.String","java.lang.String","boolean","boolean","boolean","int"] }]
},
{
"name":"com.sun.management.internal.DiagnosticCommandInfo",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String","java.lang.String","java.lang.String","java.lang.String","java.lang.String","java.lang.String","boolean","java.util.List"] }]
},
{
"name":"io.netty.channel.ChannelException"
},
{
"name":"io.netty.channel.DefaultFileRegion",
"fields":[{"name":"file"}, {"name":"transferred"}]
},
{
"name":"io.netty.channel.epoll.LinuxSocket"
},
{
"name":"io.netty.channel.epoll.Native"
},
{
"name":"io.netty.channel.epoll.NativeDatagramPacketArray$NativeDatagramPacket",
"fields":[{"name":"count"}, {"name":"memoryAddress"}, {"name":"recipientAddr"}, {"name":"recipientAddrLen"}, {"name":"recipientPort"}, {"name":"recipientScopeId"}, {"name":"segmentSize"}, {"name":"senderAddr"}, {"name":"senderAddrLen"}, {"name":"senderPort"}, {"name":"senderScopeId"}]
},
{
"name":"io.netty.channel.epoll.NativeStaticallyReferencedJniMethods"
},
{
"name":"io.netty.channel.unix.Buffer"
},
{
"name":"io.netty.channel.unix.DatagramSocketAddress",
"methods":[{"name":"<init>","parameterTypes":["byte[]","int","int","int","io.netty.channel.unix.DatagramSocketAddress"] }]
},
{
"name":"io.netty.channel.unix.DomainDatagramSocketAddress",
"methods":[{"name":"<init>","parameterTypes":["byte[]","int","io.netty.channel.unix.DomainDatagramSocketAddress"] }]
},
{
"name":"io.netty.channel.unix.ErrorsStaticallyReferencedJniMethods"
},
{
"name":"io.netty.channel.unix.FileDescriptor"
},
{
"name":"io.netty.channel.unix.LimitsStaticallyReferencedJniMethods"
},
{
"name":"io.netty.channel.unix.PeerCredentials",
"methods":[{"name":"<init>","parameterTypes":["int","int","int[]"] }]
},
{
"name":"io.netty.channel.unix.Socket"
},
{
"name":"java.io.FileDescriptor",
"fields":[{"name":"fd"}]
},
{
"name":"java.io.IOException"
},
{
"name":"java.lang.Boolean",
"methods":[{"name":"getBoolean","parameterTypes":["java.lang.String"] }]
},
{
"name":"java.lang.OutOfMemoryError"
},
{
"name":"java.lang.RuntimeException"
},
{
"name":"java.lang.SecurityManager",
"fields":[{"name":"initialized"}]
},
{
"name":"java.net.InetSocketAddress",
"methods":[{"name":"<init>","parameterTypes":["java.lang.String","int"] }]
},
{
"name":"java.net.PortUnreachableException"
},
{
"name":"java.nio.Buffer",
"fields":[{"name":"limit"}, {"name":"position"}],
"methods":[{"name":"limit","parameterTypes":[] }, {"name":"position","parameterTypes":[] }]
},
{
"name":"java.nio.DirectByteBuffer"
},
{
"name":"java.nio.channels.ClosedChannelException",
"methods":[{"name":"<init>","parameterTypes":[] }]
},
{
"name":"java.util.Arrays",
"methods":[{"name":"asList","parameterTypes":["java.lang.Object[]"] }]
},
{
"name":"sun.management.VMManagementImpl",
"fields":[{"name":"compTimeMonitoringSupport"}, {"name":"currentThreadCpuTimeSupport"}, {"name":"objectMonitorUsageSupport"}, {"name":"otherThreadCpuTimeSupport"}, {"name":"remoteDiagnosticCommandsSupport"}, {"name":"synchronizerUsageSupport"}, {"name":"threadAllocatedMemorySupport"}, {"name":"threadContentionMonitoringSupport"}]
},
{
"name":"sun.nio.ch.FileChannelImpl",
"fields":[{"name":"fd"}]
}
]

View File

@ -1,8 +0,0 @@
[
{
"type":"agent-extracted",
"classes":[
]
}
]

View File

@ -1,5 +0,0 @@
[
{
"interfaces":["java.sql.Connection"]
}
]

View File

@ -1,135 +0,0 @@
{
"resources":{
"includes":[{
"pattern":"\\QMETA-INF/com.linecorp.armeria.versions.properties\\E"
}, {
"pattern":"\\QMETA-INF/io.netty.versions.properties\\E"
}, {
"pattern":"\\QMETA-INF/native/libnetty_transport_native_epoll_x86_64.so\\E"
}, {
"pattern":"\\QMETA-INF/org/apache/logging/log4j/core/config/plugins/Log4j2Plugins.dat\\E"
}, {
"pattern":"\\QMETA-INF/services/com.fasterxml.jackson.databind.Module\\E"
}, {
"pattern":"\\QMETA-INF/services/com.linecorp.armeria.server.annotation.RequestConverterFunctionProvider\\E"
}, {
"pattern":"\\QMETA-INF/services/com.linecorp.armeria.server.annotation.ResponseConverterFunctionProvider\\E"
}, {
"pattern":"\\QMETA-INF/services/com.linecorp.armeria.server.docs.DescriptiveTypeInfoProvider\\E"
}, {
"pattern":"\\QMETA-INF/services/com.linecorp.armeria.server.docs.DocServicePlugin\\E"
}, {
"pattern":"\\QMETA-INF/services/com.oracle.truffle.api.TruffleLanguage$Provider\\E"
}, {
"pattern":"\\QMETA-INF/services/com.oracle.truffle.api.instrumentation.TruffleInstrument$Provider\\E"
}, {
"pattern":"\\QMETA-INF/services/java.sql.Driver\\E"
}, {
"pattern":"\\QMETA-INF/services/kotlin.reflect.jvm.internal.impl.builtins.BuiltInsLoader\\E"
}, {
"pattern":"\\QMETA-INF/services/kotlin.reflect.jvm.internal.impl.resolve.ExternalOverridabilityCondition\\E"
}, {
"pattern":"\\QMETA-INF/services/org.apache.logging.log4j.core.util.ContextDataProvider\\E"
}, {
"pattern":"\\QMETA-INF/services/org.apache.logging.log4j.spi.Provider\\E"
}, {
"pattern":"\\QMETA-INF/services/org.apache.logging.log4j.util.PropertySource\\E"
}, {
"pattern":"\\QMETA-INF/services/org.apache.skywalking.oap.server.library.module.ModuleDefine\\E"
}, {
"pattern":"\\QMETA-INF/services/org.apache.skywalking.oap.server.library.module.ModuleProvider\\E"
}, {
"pattern":"\\Qcom/oracle/truffle/nfi/backend/libffi/LibFFILanguage.class\\E"
}, {
"pattern":"\\Qfreemarker/ext/beans/DefaultMemberAccessPolicy-rules\\E"
}, {
"pattern":"\\Qfreemarker/version.properties\\E"
}, {
"pattern":"\\Qkotlin/annotation/annotation.kotlin_builtins\\E"
}, {
"pattern":"\\Qkotlin/collections/collections.kotlin_builtins\\E"
}, {
"pattern":"\\Qkotlin/coroutines/coroutines.kotlin_builtins\\E"
},{
"pattern":"org/apache/skywalking/oap/server/core/source/oal/rt/dispatcher.*"
},
{
"pattern":"org/apache/skywalking/oap/server/core/source/oal/rt/metrics.*"
},
{
"pattern":"\\Qkotlin/internal/internal.kotlin_builtins\\E"
}, {
"pattern":"\\Qkotlin/kotlin.kotlin_builtins\\E"
}, {
"pattern":"\\Qkotlin/ranges/ranges.kotlin_builtins\\E"
}, {
"pattern":"\\Qkotlin/reflect/reflect.kotlin_builtins\\E"
}, {
"pattern":"\\Qlog4j2.xml\\E"
}, {
"pattern":"\\Qorg/apache/skywalking/oap/server/core/source/oal/rt/dispatcher\\E"
}, {
"pattern":"\\Qorg/apache/skywalking/oap/server/core/source/oal/rt/metrics\\E"
}, {
"pattern":"\\Qorg/h2/util/data.zip\\E"
}, {
"pattern":"\\Qorg/joda/time/tz/data/Etc/UTC\\E"
}, {
"pattern":"\\Qorg/joda/time/tz/data/ZoneInfoMap\\E"
}, {
"pattern":"\\Qorg/slf4j/impl/StaticLoggerBinder.class\\E"
}, {
"pattern":"\\Qquery-protocol/aggregation.graphqls\\E"
}, {
"pattern":"\\Qquery-protocol/alarm.graphqls\\E"
}, {
"pattern":"\\Qquery-protocol/browser-log.graphqls\\E"
}, {
"pattern":"\\Qquery-protocol/common.graphqls\\E"
}, {
"pattern":"\\Qquery-protocol/continuous-profiling.graphqls\\E"
}, {
"pattern":"\\Qquery-protocol/ebpf-profiling.graphqls\\E"
}, {
"pattern":"\\Qquery-protocol/event.graphqls\\E"
}, {
"pattern":"\\Qquery-protocol/log.graphqls\\E"
}, {
"pattern":"\\Qquery-protocol/metadata-v2.graphqls\\E"
}, {
"pattern":"\\Qquery-protocol/metadata.graphqls\\E"
}, {
"pattern":"\\Qquery-protocol/metric.graphqls\\E"
}, {
"pattern":"\\Qquery-protocol/metrics-v2.graphqls\\E"
}, {
"pattern":"\\Qquery-protocol/metrics-v3.graphqls\\E"
}, {
"pattern":"\\Qquery-protocol/profile.graphqls\\E"
}, {
"pattern":"\\Qquery-protocol/record.graphqls\\E"
}, {
"pattern":"\\Qquery-protocol/top-n-records.graphqls\\E"
}, {
"pattern":"\\Qquery-protocol/topology.graphqls\\E"
}, {
"pattern":"\\Qquery-protocol/trace.graphqls\\E"
}, {
"pattern":"\\Qquery-protocol/ui-configuration.graphqls\\E"
}, {
"pattern":"\\Qversion.properties\\E"
}, {
"pattern":"java.base:\\Qjdk/internal/icu/impl/data/icudt67b/uprops.icu\\E"
}, {
"pattern":"java.base:\\Qsun/net/idn/uidna.spp\\E"
}, {
"pattern":"jdk.jfr:\\Qjdk/jfr/internal/types/metadata.bin\\E"
}]},
"bundles":[{
"name":"i18n.Parsing",
"locales":[""]
}, {
"name":"i18n.Validation",
"locales":[""]
}]
}

View File

@ -1,8 +0,0 @@
{
"types":[
],
"lambdaCapturingTypes":[
],
"proxies":[
]
}

View File

@ -1,19 +0,0 @@
# 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.
Args = -H:Class=org.apache.skywalking.oap.server.starter.OAPServerStartUp \
--no-fallback \
-J-Xmx8g \
--report-unsupported-elements-at-runtime

View File

@ -1,574 +0,0 @@
# 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.
cluster:
selector: ${SW_CLUSTER:standalone}
standalone:
# Please check your ZooKeeper is 3.5+, However, it is also compatible with ZooKeeper 3.4.x. Replace the ZooKeeper 3.5+
# library the oap-libs folder with your ZooKeeper 3.4.x library.
zookeeper:
namespace: ${SW_NAMESPACE:""}
hostPort: ${SW_CLUSTER_ZK_HOST_PORT:localhost:2181}
# Retry Policy
baseSleepTimeMs: ${SW_CLUSTER_ZK_SLEEP_TIME:1000} # initial amount of time to wait between retries
maxRetries: ${SW_CLUSTER_ZK_MAX_RETRIES:3} # max number of times to retry
# Enable ACL
enableACL: ${SW_ZK_ENABLE_ACL:false} # disable ACL in default
schema: ${SW_ZK_SCHEMA:digest} # only support digest schema
expression: ${SW_ZK_EXPRESSION:skywalking:skywalking}
internalComHost: ${SW_CLUSTER_INTERNAL_COM_HOST:""}
internalComPort: ${SW_CLUSTER_INTERNAL_COM_PORT:-1}
kubernetes:
namespace: ${SW_CLUSTER_K8S_NAMESPACE:default}
labelSelector: ${SW_CLUSTER_K8S_LABEL:app=collector,release=skywalking}
uidEnvName: ${SW_CLUSTER_K8S_UID:SKYWALKING_COLLECTOR_UID}
consul:
serviceName: ${SW_SERVICE_NAME:"SkyWalking_OAP_Cluster"}
# Consul cluster nodes, example: 10.0.0.1:8500,10.0.0.2:8500,10.0.0.3:8500
hostPort: ${SW_CLUSTER_CONSUL_HOST_PORT:localhost:8500}
aclToken: ${SW_CLUSTER_CONSUL_ACLTOKEN:""}
internalComHost: ${SW_CLUSTER_INTERNAL_COM_HOST:""}
internalComPort: ${SW_CLUSTER_INTERNAL_COM_PORT:-1}
etcd:
# etcd cluster nodes, example: 10.0.0.1:2379,10.0.0.2:2379,10.0.0.3:2379
endpoints: ${SW_CLUSTER_ETCD_ENDPOINTS:localhost:2379}
namespace: ${SW_CLUSTER_ETCD_NAMESPACE:/skywalking}
serviceName: ${SW_CLUSTER_ETCD_SERVICE_NAME:"SkyWalking_OAP_Cluster"}
authentication: ${SW_CLUSTER_ETCD_AUTHENTICATION:false}
user: ${SW_CLUSTER_ETCD_USER:}
password: ${SW_CLUSTER_ETCD_PASSWORD:}
internalComHost: ${SW_CLUSTER_INTERNAL_COM_HOST:""}
internalComPort: ${SW_CLUSTER_INTERNAL_COM_PORT:-1}
nacos:
serviceName: ${SW_SERVICE_NAME:"SkyWalking_OAP_Cluster"}
hostPort: ${SW_CLUSTER_NACOS_HOST_PORT:localhost:8848}
# Nacos Configuration namespace
namespace: ${SW_CLUSTER_NACOS_NAMESPACE:"public"}
# Nacos auth username
username: ${SW_CLUSTER_NACOS_USERNAME:""}
password: ${SW_CLUSTER_NACOS_PASSWORD:""}
# Nacos auth accessKey
accessKey: ${SW_CLUSTER_NACOS_ACCESSKEY:""}
secretKey: ${SW_CLUSTER_NACOS_SECRETKEY:""}
internalComHost: ${SW_CLUSTER_INTERNAL_COM_HOST:""}
internalComPort: ${SW_CLUSTER_INTERNAL_COM_PORT:-1}
core:
selector: ${SW_CORE:default}
default:
# Mixed: Receive agent data, Level 1 aggregate, Level 2 aggregate
# Receiver: Receive agent data, Level 1 aggregate
# Aggregator: Level 2 aggregate
role: ${SW_CORE_ROLE:Mixed} # Mixed/Receiver/Aggregator
restHost: ${SW_CORE_REST_HOST:0.0.0.0}
restPort: ${SW_CORE_REST_PORT:12800}
restContextPath: ${SW_CORE_REST_CONTEXT_PATH:/}
restMaxThreads: ${SW_CORE_REST_MAX_THREADS:200}
restIdleTimeOut: ${SW_CORE_REST_IDLE_TIMEOUT:30000}
restAcceptQueueSize: ${SW_CORE_REST_QUEUE_SIZE:0}
httpMaxRequestHeaderSize: ${SW_CORE_HTTP_MAX_REQUEST_HEADER_SIZE:8192}
gRPCHost: ${SW_CORE_GRPC_HOST:0.0.0.0}
gRPCPort: ${SW_CORE_GRPC_PORT:11800}
maxConcurrentCallsPerConnection: ${SW_CORE_GRPC_MAX_CONCURRENT_CALL:0}
maxMessageSize: ${SW_CORE_GRPC_MAX_MESSAGE_SIZE:0}
gRPCThreadPoolQueueSize: ${SW_CORE_GRPC_POOL_QUEUE_SIZE:-1}
gRPCThreadPoolSize: ${SW_CORE_GRPC_THREAD_POOL_SIZE:-1}
gRPCSslEnabled: ${SW_CORE_GRPC_SSL_ENABLED:false}
gRPCSslKeyPath: ${SW_CORE_GRPC_SSL_KEY_PATH:""}
gRPCSslCertChainPath: ${SW_CORE_GRPC_SSL_CERT_CHAIN_PATH:""}
gRPCSslTrustedCAPath: ${SW_CORE_GRPC_SSL_TRUSTED_CA_PATH:""}
downsampling:
- Hour
- Day
# Set a timeout on metrics data. After the timeout has expired, the metrics data will automatically be deleted.
enableDataKeeperExecutor: ${SW_CORE_ENABLE_DATA_KEEPER_EXECUTOR:true} # Turn it off then automatically metrics data delete will be close.
dataKeeperExecutePeriod: ${SW_CORE_DATA_KEEPER_EXECUTE_PERIOD:5} # How often the data keeper executor runs periodically, unit is minute
recordDataTTL: ${SW_CORE_RECORD_DATA_TTL:3} # Unit is day
metricsDataTTL: ${SW_CORE_METRICS_DATA_TTL:7} # Unit is day
# The period of L1 aggregation flush to L2 aggregation. Unit is ms.
l1FlushPeriod: ${SW_CORE_L1_AGGREGATION_FLUSH_PERIOD:500}
# The threshold of session time. Unit is ms. Default value is 70s.
storageSessionTimeout: ${SW_CORE_STORAGE_SESSION_TIMEOUT:70000}
# The period of doing data persistence. Unit is second.Default value is 25s
persistentPeriod: ${SW_CORE_PERSISTENT_PERIOD:25}
topNReportPeriod: ${SW_CORE_TOPN_REPORT_PERIOD:10} # top_n record worker report cycle, unit is minute
# Extra model column are the column defined by in the codes, These columns of model are not required logically in aggregation or further query,
# and it will cause more load for memory, network of OAP and storage.
# But, being activated, user could see the name in the storage entities, which make users easier to use 3rd party tool, such as Kibana->ES, to query the data by themselves.
activeExtraModelColumns: ${SW_CORE_ACTIVE_EXTRA_MODEL_COLUMNS:false}
# The max length of service + instance names should be less than 200
serviceNameMaxLength: ${SW_SERVICE_NAME_MAX_LENGTH:70}
# The period(in seconds) of refreshing the service cache. Default value is 10s.
serviceCacheRefreshInterval: ${SW_SERVICE_CACHE_REFRESH_INTERVAL:10}
instanceNameMaxLength: ${SW_INSTANCE_NAME_MAX_LENGTH:70}
# The max length of service + endpoint names should be less than 240
endpointNameMaxLength: ${SW_ENDPOINT_NAME_MAX_LENGTH:150}
# Define the set of span tag keys, which should be searchable through the GraphQL.
# The max length of key=value should be less than 256 or will be dropped.
searchableTracesTags: ${SW_SEARCHABLE_TAG_KEYS:http.method,http.status_code,rpc.status_code,db.type,db.instance,mq.queue,mq.topic,mq.broker}
# Define the set of log tag keys, which should be searchable through the GraphQL.
# The max length of key=value should be less than 256 or will be dropped.
searchableLogsTags: ${SW_SEARCHABLE_LOGS_TAG_KEYS:level}
# Define the set of alarm tag keys, which should be searchable through the GraphQL.
# The max length of key=value should be less than 256 or will be dropped.
searchableAlarmTags: ${SW_SEARCHABLE_ALARM_TAG_KEYS:level}
# The max size of tags keys for autocomplete select.
autocompleteTagKeysQueryMaxSize: ${SW_AUTOCOMPLETE_TAG_KEYS_QUERY_MAX_SIZE:100}
# The max size of tags values for autocomplete select.
autocompleteTagValuesQueryMaxSize: ${SW_AUTOCOMPLETE_TAG_VALUES_QUERY_MAX_SIZE:100}
# The number of threads used to prepare metrics data to the storage.
prepareThreads: ${SW_CORE_PREPARE_THREADS:2}
# Turn it on then automatically grouping endpoint by the given OpenAPI definitions.
enableEndpointNameGroupingByOpenapi: ${SW_CORE_ENABLE_ENDPOINT_NAME_GROUPING_BY_OPENAPI:true}
# The period of HTTP URI pattern recognition. Unit is second.
syncPeriodHttpUriRecognitionPattern: ${SW_CORE_SYNC_PERIOD_HTTP_URI_RECOGNITION_PATTERN:10}
# The training period of HTTP URI pattern recognition. Unit is second.
trainingPeriodHttpUriRecognitionPattern: ${SW_CORE_TRAINING_PERIOD_HTTP_URI_RECOGNITION_PATTERN:60}
# The max number of HTTP URIs per service for further URI pattern recognition.
maxHttpUrisNumberPerService: ${SW_CORE_MAX_HTTP_URIS_NUMBER_PER_SVR:3000}
storage:
selector: ${SW_STORAGE:h2}
elasticsearch:
namespace: ${SW_NAMESPACE:""}
clusterNodes: ${SW_STORAGE_ES_CLUSTER_NODES:localhost:9200}
protocol: ${SW_STORAGE_ES_HTTP_PROTOCOL:"http"}
connectTimeout: ${SW_STORAGE_ES_CONNECT_TIMEOUT:3000}
socketTimeout: ${SW_STORAGE_ES_SOCKET_TIMEOUT:30000}
responseTimeout: ${SW_STORAGE_ES_RESPONSE_TIMEOUT:15000}
numHttpClientThread: ${SW_STORAGE_ES_NUM_HTTP_CLIENT_THREAD:0}
user: ${SW_ES_USER:""}
password: ${SW_ES_PASSWORD:""}
trustStorePath: ${SW_STORAGE_ES_SSL_JKS_PATH:""}
trustStorePass: ${SW_STORAGE_ES_SSL_JKS_PASS:""}
secretsManagementFile: ${SW_ES_SECRETS_MANAGEMENT_FILE:""} # Secrets management file in the properties format includes the username, password, which are managed by 3rd party tool.
dayStep: ${SW_STORAGE_DAY_STEP:1} # Represent the number of days in the one minute/hour/day index.
indexShardsNumber: ${SW_STORAGE_ES_INDEX_SHARDS_NUMBER:1} # Shard number of new indexes
indexReplicasNumber: ${SW_STORAGE_ES_INDEX_REPLICAS_NUMBER:1} # Replicas number of new indexes
# Specify the settings for each index individually.
# If configured, this setting has the highest priority and overrides the generic settings.
specificIndexSettings: ${SW_STORAGE_ES_SPECIFIC_INDEX_SETTINGS:""}
# Super data set has been defined in the codes, such as trace segments.The following 3 config would be improve es performance when storage super size data in es.
superDatasetDayStep: ${SW_STORAGE_ES_SUPER_DATASET_DAY_STEP:-1} # Represent the number of days in the super size dataset record index, the default value is the same as dayStep when the value is less than 0
superDatasetIndexShardsFactor: ${SW_STORAGE_ES_SUPER_DATASET_INDEX_SHARDS_FACTOR:5} # This factor provides more shards for the super data set, shards number = indexShardsNumber * superDatasetIndexShardsFactor. Also, this factor effects Zipkin traces.
superDatasetIndexReplicasNumber: ${SW_STORAGE_ES_SUPER_DATASET_INDEX_REPLICAS_NUMBER:0} # Represent the replicas number in the super size dataset record index, the default value is 0.
indexTemplateOrder: ${SW_STORAGE_ES_INDEX_TEMPLATE_ORDER:0} # the order of index template
bulkActions: ${SW_STORAGE_ES_BULK_ACTIONS:5000} # Execute the async bulk record data every ${SW_STORAGE_ES_BULK_ACTIONS} requests
batchOfBytes: ${SW_STORAGE_ES_BATCH_OF_BYTES:10485760} # A threshold to control the max body size of ElasticSearch Bulk flush.
# flush the bulk every 5 seconds whatever the number of requests
flushInterval: ${SW_STORAGE_ES_FLUSH_INTERVAL:5}
concurrentRequests: ${SW_STORAGE_ES_CONCURRENT_REQUESTS:2} # the number of concurrent requests
resultWindowMaxSize: ${SW_STORAGE_ES_QUERY_MAX_WINDOW_SIZE:10000}
metadataQueryMaxSize: ${SW_STORAGE_ES_QUERY_MAX_SIZE:10000}
scrollingBatchSize: ${SW_STORAGE_ES_SCROLLING_BATCH_SIZE:5000}
segmentQueryMaxSize: ${SW_STORAGE_ES_QUERY_SEGMENT_SIZE:200}
profileTaskQueryMaxSize: ${SW_STORAGE_ES_QUERY_PROFILE_TASK_SIZE:200}
profileDataQueryBatchSize: ${SW_STORAGE_ES_QUERY_PROFILE_DATA_BATCH_SIZE:100}
oapAnalyzer: ${SW_STORAGE_ES_OAP_ANALYZER:"{\"analyzer\":{\"oap_analyzer\":{\"type\":\"stop\"}}}"} # the oap analyzer.
oapLogAnalyzer: ${SW_STORAGE_ES_OAP_LOG_ANALYZER:"{\"analyzer\":{\"oap_log_analyzer\":{\"type\":\"standard\"}}}"} # the oap log analyzer. It could be customized by the ES analyzer configuration to support more language log formats, such as Chinese log, Japanese log and etc.
advanced: ${SW_STORAGE_ES_ADVANCED:""}
# Enable shard metrics and records indices into multi-physical indices, one index template per metric/meter aggregation function or record.
logicSharding: ${SW_STORAGE_ES_LOGIC_SHARDING:false}
# Custom routing can reduce the impact of searches. Instead of having to fan out a search request to all the shards in an index, the request can be sent to just the shard that matches the specific routing value (or values).
enableCustomRouting: ${SW_STORAGE_ES_ENABLE_CUSTOM_ROUTING:false}
h2:
properties:
jdbcUrl: ${SW_STORAGE_H2_URL:jdbc:h2:mem:skywalking-oap-db;DB_CLOSE_DELAY=-1;DATABASE_TO_UPPER=FALSE}
dataSource.user: ${SW_STORAGE_H2_USER:sa}
metadataQueryMaxSize: ${SW_STORAGE_H2_QUERY_MAX_SIZE:5000}
maxSizeOfBatchSql: ${SW_STORAGE_MAX_SIZE_OF_BATCH_SQL:100}
asyncBatchPersistentPoolSize: ${SW_STORAGE_ASYNC_BATCH_PERSISTENT_POOL_SIZE:1}
mysql:
properties:
jdbcUrl: ${SW_JDBC_URL:"jdbc:mysql://localhost:3306/swtest?rewriteBatchedStatements=true&allowMultiQueries=true"}
dataSource.user: ${SW_DATA_SOURCE_USER:root}
dataSource.password: ${SW_DATA_SOURCE_PASSWORD:root@1234}
dataSource.cachePrepStmts: ${SW_DATA_SOURCE_CACHE_PREP_STMTS:true}
dataSource.prepStmtCacheSize: ${SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_SIZE:250}
dataSource.prepStmtCacheSqlLimit: ${SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_LIMIT:2048}
dataSource.useServerPrepStmts: ${SW_DATA_SOURCE_USE_SERVER_PREP_STMTS:true}
metadataQueryMaxSize: ${SW_STORAGE_MYSQL_QUERY_MAX_SIZE:5000}
maxSizeOfBatchSql: ${SW_STORAGE_MAX_SIZE_OF_BATCH_SQL:2000}
asyncBatchPersistentPoolSize: ${SW_STORAGE_ASYNC_BATCH_PERSISTENT_POOL_SIZE:4}
postgresql:
properties:
jdbcUrl: ${SW_JDBC_URL:"jdbc:postgresql://localhost:5432/skywalking"}
dataSource.user: ${SW_DATA_SOURCE_USER:postgres}
dataSource.password: ${SW_DATA_SOURCE_PASSWORD:123456}
dataSource.cachePrepStmts: ${SW_DATA_SOURCE_CACHE_PREP_STMTS:true}
dataSource.prepStmtCacheSize: ${SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_SIZE:250}
dataSource.prepStmtCacheSqlLimit: ${SW_DATA_SOURCE_PREP_STMT_CACHE_SQL_LIMIT:2048}
dataSource.useServerPrepStmts: ${SW_DATA_SOURCE_USE_SERVER_PREP_STMTS:true}
metadataQueryMaxSize: ${SW_STORAGE_MYSQL_QUERY_MAX_SIZE:5000}
maxSizeOfBatchSql: ${SW_STORAGE_MAX_SIZE_OF_BATCH_SQL:2000}
asyncBatchPersistentPoolSize: ${SW_STORAGE_ASYNC_BATCH_PERSISTENT_POOL_SIZE:4}
banyandb:
host: ${SW_STORAGE_BANYANDB_HOST:127.0.0.1}
port: ${SW_STORAGE_BANYANDB_PORT:17912}
maxBulkSize: ${SW_STORAGE_BANYANDB_MAX_BULK_SIZE:5000}
flushInterval: ${SW_STORAGE_BANYANDB_FLUSH_INTERVAL:15}
metricsShardsNumber: ${SW_STORAGE_BANYANDB_METRICS_SHARDS_NUMBER:1}
recordShardsNumber: ${SW_STORAGE_BANYANDB_RECORD_SHARDS_NUMBER:1}
superDatasetShardsFactor: ${SW_STORAGE_BANYANDB_SUPERDATASET_SHARDS_FACTOR:2}
concurrentWriteThreads: ${SW_STORAGE_BANYANDB_CONCURRENT_WRITE_THREADS:15}
profileTaskQueryMaxSize: ${SW_STORAGE_BANYANDB_PROFILE_TASK_QUERY_MAX_SIZE:200} # the max number of fetch task in a request
blockIntervalHours: ${SW_STORAGE_BANYANDB_BLOCK_INTERVAL_HOURS:24} # Unit is hour
segmentIntervalDays: ${SW_STORAGE_BANYANDB_SEGMENT_INTERVAL_DAYS:1} # Unit is day
superDatasetBlockIntervalHours: ${SW_STORAGE_BANYANDB_SUPER_DATASET_BLOCK_INTERVAL_HOURS:4} # Unit is hour
superDatasetSegmentIntervalDays: ${SW_STORAGE_BANYANDB_SUPER_DATASET_SEGMENT_INTERVAL_DAYS:1} # Unit is day
specificGroupSettings: ${SW_STORAGE_BANYANDB_SPECIFIC_GROUP_SETTINGS:""} # For example, {"group1": {"blockIntervalHours": 4, "segmentIntervalDays": 1}}
agent-analyzer:
selector: ${SW_AGENT_ANALYZER:default}
default:
# The default sampling rate and the default trace latency time configured by the 'traceSamplingPolicySettingsFile' file.
traceSamplingPolicySettingsFile: ${SW_TRACE_SAMPLING_POLICY_SETTINGS_FILE:trace-sampling-policy-settings.yml}
slowDBAccessThreshold: ${SW_SLOW_DB_THRESHOLD:default:200,mongodb:100} # The slow database access thresholds. Unit ms.
forceSampleErrorSegment: ${SW_FORCE_SAMPLE_ERROR_SEGMENT:true} # When sampling mechanism active, this config can open(true) force save some error segment. true is default.
segmentStatusAnalysisStrategy: ${SW_SEGMENT_STATUS_ANALYSIS_STRATEGY:FROM_SPAN_STATUS} # Determine the final segment status from the status of spans. Available values are `FROM_SPAN_STATUS` , `FROM_ENTRY_SPAN` and `FROM_FIRST_SPAN`. `FROM_SPAN_STATUS` represents the segment status would be error if any span is in error status. `FROM_ENTRY_SPAN` means the segment status would be determined by the status of entry spans only. `FROM_FIRST_SPAN` means the segment status would be determined by the status of the first span only.
# Nginx and Envoy agents can't get the real remote address.
# Exit spans with the component in the list would not generate the client-side instance relation metrics.
noUpstreamRealAddressAgents: ${SW_NO_UPSTREAM_REAL_ADDRESS:6000,9000}
meterAnalyzerActiveFiles: ${SW_METER_ANALYZER_ACTIVE_FILES:datasource,threadpool,satellite,go-runtime,python-runtime,continuous-profiling} # Which files could be meter analyzed, files split by ","
slowCacheReadThreshold: ${SW_SLOW_CACHE_SLOW_READ_THRESHOLD:default:20,redis:10} # The slow cache read operation thresholds. Unit ms.
slowCacheWriteThreshold: ${SW_SLOW_CACHE_SLOW_WRITE_THRESHOLD:default:20,redis:10} # The slow cache write operation thresholds. Unit ms.
log-analyzer:
selector: ${SW_LOG_ANALYZER:graalvm}
graalvm:
lalFiles: ${SW_LOG_LAL_FILES:envoy-als,mesh-dp,mysql-slowsql,pgsql-slowsql,redis-slowsql,k8s-service,default}
malFiles: ${SW_LOG_MAL_FILES:""}
event-analyzer:
selector: ${SW_EVENT_ANALYZER:default}
default:
receiver-sharing-server:
selector: ${SW_RECEIVER_SHARING_SERVER:default}
default:
# For HTTP server
restHost: ${SW_RECEIVER_SHARING_REST_HOST:0.0.0.0}
restPort: ${SW_RECEIVER_SHARING_REST_PORT:0}
restContextPath: ${SW_RECEIVER_SHARING_REST_CONTEXT_PATH:/}
restMaxThreads: ${SW_RECEIVER_SHARING_REST_MAX_THREADS:200}
restIdleTimeOut: ${SW_RECEIVER_SHARING_REST_IDLE_TIMEOUT:30000}
restAcceptQueueSize: ${SW_RECEIVER_SHARING_REST_QUEUE_SIZE:0}
httpMaxRequestHeaderSize: ${SW_RECEIVER_SHARING_HTTP_MAX_REQUEST_HEADER_SIZE:8192}
# For gRPC server
gRPCHost: ${SW_RECEIVER_GRPC_HOST:0.0.0.0}
gRPCPort: ${SW_RECEIVER_GRPC_PORT:0}
maxConcurrentCallsPerConnection: ${SW_RECEIVER_GRPC_MAX_CONCURRENT_CALL:0}
maxMessageSize: ${SW_RECEIVER_GRPC_MAX_MESSAGE_SIZE:0}
gRPCThreadPoolQueueSize: ${SW_RECEIVER_GRPC_POOL_QUEUE_SIZE:0}
gRPCThreadPoolSize: ${SW_RECEIVER_GRPC_THREAD_POOL_SIZE:0}
gRPCSslEnabled: ${SW_RECEIVER_GRPC_SSL_ENABLED:false}
gRPCSslKeyPath: ${SW_RECEIVER_GRPC_SSL_KEY_PATH:""}
gRPCSslCertChainPath: ${SW_RECEIVER_GRPC_SSL_CERT_CHAIN_PATH:""}
gRPCSslTrustedCAsPath: ${SW_RECEIVER_GRPC_SSL_TRUSTED_CAS_PATH:""}
authentication: ${SW_AUTHENTICATION:""}
receiver-register:
selector: ${SW_RECEIVER_REGISTER:default}
default:
receiver-trace:
selector: ${SW_RECEIVER_TRACE:default}
default:
receiver-jvm:
selector: ${SW_RECEIVER_JVM:default}
default:
receiver-clr:
selector: ${SW_RECEIVER_CLR:default}
default:
receiver-profile:
selector: ${SW_RECEIVER_PROFILE:default}
default:
receiver-zabbix:
selector: ${SW_RECEIVER_ZABBIX:-}
default:
port: ${SW_RECEIVER_ZABBIX_PORT:10051}
host: ${SW_RECEIVER_ZABBIX_HOST:0.0.0.0}
activeFiles: ${SW_RECEIVER_ZABBIX_ACTIVE_FILES:agent}
service-mesh:
selector: ${SW_SERVICE_MESH:default}
default:
envoy-metric:
selector: ${SW_ENVOY_METRIC:graalvm}
graalvm:
acceptMetricsService: ${SW_ENVOY_METRIC_SERVICE:true}
alsHTTPAnalysis: ${SW_ENVOY_METRIC_ALS_HTTP_ANALYSIS:""}
alsTCPAnalysis: ${SW_ENVOY_METRIC_ALS_TCP_ANALYSIS:""}
k8sServiceNameRule: ${K8S_SERVICE_NAME_RULE:"${pod.metadata.labels.(service.istio.io/canonical-name)}"}
istioServiceNameRule: ${ISTIO_SERVICE_NAME_RULE:"${serviceEntry.metadata.name}"}
kafka-fetcher:
selector: ${SW_KAFKA_FETCHER:-}
default:
bootstrapServers: ${SW_KAFKA_FETCHER_SERVERS:localhost:9092}
namespace: ${SW_NAMESPACE:""}
partitions: ${SW_KAFKA_FETCHER_PARTITIONS:3}
replicationFactor: ${SW_KAFKA_FETCHER_PARTITIONS_FACTOR:2}
enableNativeProtoLog: ${SW_KAFKA_FETCHER_ENABLE_NATIVE_PROTO_LOG:true}
enableNativeJsonLog: ${SW_KAFKA_FETCHER_ENABLE_NATIVE_JSON_LOG:true}
consumers: ${SW_KAFKA_FETCHER_CONSUMERS:1}
kafkaHandlerThreadPoolSize: ${SW_KAFKA_HANDLER_THREAD_POOL_SIZE:-1}
kafkaHandlerThreadPoolQueueSize: ${SW_KAFKA_HANDLER_THREAD_POOL_QUEUE_SIZE:-1}
receiver-meter:
selector: ${SW_RECEIVER_METER:default}
default:
receiver-otel:
selector: ${SW_OTEL_RECEIVER:default}
default:
enabledHandlers: ${SW_OTEL_RECEIVER_ENABLED_HANDLERS:"otlp-metrics,otlp-logs"}
enabledOtelMetricsRules: ${SW_OTEL_RECEIVER_ENABLED_OTEL_METRICS_RULES:"apisix,k8s/*,istio-controlplane,vm,mysql/*,postgresql/*,oap,aws-eks/*,windows,aws-s3/*,aws-dynamodb/*,aws-gateway/*,redis/*,elasticsearch/*,rabbitmq/*,mongodb/*,kafka/*"}
receiver-zipkin:
selector: ${SW_RECEIVER_ZIPKIN:-}
default:
# Defines a set of span tag keys which are searchable.
# The max length of key=value should be less than 256 or will be dropped.
searchableTracesTags: ${SW_ZIPKIN_SEARCHABLE_TAG_KEYS:http.method}
# The sample rate precision is 1/10000, should be between 0 and 10000
sampleRate: ${SW_ZIPKIN_SAMPLE_RATE:10000}
## The below configs are for OAP collect zipkin trace from HTTP
enableHttpCollector: ${SW_ZIPKIN_HTTP_COLLECTOR_ENABLED:true}
restHost: ${SW_RECEIVER_ZIPKIN_REST_HOST:0.0.0.0}
restPort: ${SW_RECEIVER_ZIPKIN_REST_PORT:9411}
restContextPath: ${SW_RECEIVER_ZIPKIN_REST_CONTEXT_PATH:/}
restMaxThreads: ${SW_RECEIVER_ZIPKIN_REST_MAX_THREADS:200}
restIdleTimeOut: ${SW_RECEIVER_ZIPKIN_REST_IDLE_TIMEOUT:30000}
restAcceptQueueSize: ${SW_RECEIVER_ZIPKIN_REST_QUEUE_SIZE:0}
## The below configs are for OAP collect zipkin trace from kafka
enableKafkaCollector: ${SW_ZIPKIN_KAFKA_COLLECTOR_ENABLED:false}
kafkaBootstrapServers: ${SW_ZIPKIN_KAFKA_SERVERS:localhost:9092}
kafkaGroupId: ${SW_ZIPKIN_KAFKA_GROUP_ID:zipkin}
kafkaTopic: ${SW_ZIPKIN_KAFKA_TOPIC:zipkin}
# Kafka consumer config, JSON format as Properties. If it contains the same key with above, would override.
kafkaConsumerConfig: ${SW_ZIPKIN_KAFKA_CONSUMER_CONFIG:"{\"auto.offset.reset\":\"earliest\",\"enable.auto.commit\":true}"}
# The Count of the topic consumers
kafkaConsumers: ${SW_ZIPKIN_KAFKA_CONSUMERS:1}
kafkaHandlerThreadPoolSize: ${SW_ZIPKIN_KAFKA_HANDLER_THREAD_POOL_SIZE:-1}
kafkaHandlerThreadPoolQueueSize: ${SW_ZIPKIN_KAFKA_HANDLER_THREAD_POOL_QUEUE_SIZE:-1}
receiver-browser:
selector: ${SW_RECEIVER_BROWSER:default}
default:
# The sample rate precision is 1/10000. 10000 means 100% sample in default.
sampleRate: ${SW_RECEIVER_BROWSER_SAMPLE_RATE:10000}
receiver-log:
selector: ${SW_RECEIVER_LOG:default}
default:
query:
selector: ${SW_QUERY:graphql}
graphql:
# Enable the log testing API to test the LAL.
# NOTE: This API evaluates untrusted code on the OAP server.
# A malicious script can do significant damage (steal keys and secrets, remove files and directories, install malware, etc).
# As such, please enable this API only when you completely trust your users.
enableLogTestTool: ${SW_QUERY_GRAPHQL_ENABLE_LOG_TEST_TOOL:false}
# Maximum complexity allowed for the GraphQL query that can be used to
# abort a query if the total number of data fields queried exceeds the defined threshold.
maxQueryComplexity: ${SW_QUERY_MAX_QUERY_COMPLEXITY:3000}
# Allow user add, disable and update UI template
enableUpdateUITemplate: ${SW_ENABLE_UPDATE_UI_TEMPLATE:false}
# "On demand log" allows users to fetch Pod containers' log in real time,
# because this might expose secrets in the logs (if any), users need
# to enable this manually, and add permissions to OAP cluster role.
enableOnDemandPodLog: ${SW_ENABLE_ON_DEMAND_POD_LOG:false}
# This module is for Zipkin query API and support zipkin-lens UI
query-zipkin:
selector: ${SW_QUERY_ZIPKIN:-}
default:
# For HTTP server
restHost: ${SW_QUERY_ZIPKIN_REST_HOST:0.0.0.0}
restPort: ${SW_QUERY_ZIPKIN_REST_PORT:9412}
restContextPath: ${SW_QUERY_ZIPKIN_REST_CONTEXT_PATH:/zipkin}
restMaxThreads: ${SW_QUERY_ZIPKIN_REST_MAX_THREADS:200}
restIdleTimeOut: ${SW_QUERY_ZIPKIN_REST_IDLE_TIMEOUT:30000}
restAcceptQueueSize: ${SW_QUERY_ZIPKIN_REST_QUEUE_SIZE:0}
# Default look back for traces and autocompleteTags, 1 day in millis
lookback: ${SW_QUERY_ZIPKIN_LOOKBACK:86400000}
# The Cache-Control max-age (seconds) for serviceNames, remoteServiceNames and spanNames
namesMaxAge: ${SW_QUERY_ZIPKIN_NAMES_MAX_AGE:300}
## The below config are OAP support for zipkin-lens UI
# Default traces query max size
uiQueryLimit: ${SW_QUERY_ZIPKIN_UI_QUERY_LIMIT:10}
# Default look back on the UI for search traces, 15 minutes in millis
uiDefaultLookback: ${SW_QUERY_ZIPKIN_UI_DEFAULT_LOOKBACK:900000}
#This module is for PromQL API.
promql:
selector: ${SW_PROMQL:default}
default:
# For HTTP server
restHost: ${SW_PROMQL_REST_HOST:0.0.0.0}
restPort: ${SW_PROMQL_REST_PORT:9090}
restContextPath: ${SW_PROMQL_REST_CONTEXT_PATH:/}
restMaxThreads: ${SW_PROMQL_REST_MAX_THREADS:200}
restIdleTimeOut: ${SW_PROMQL_REST_IDLE_TIMEOUT:30000}
restAcceptQueueSize: ${SW_PROMQL_REST_QUEUE_SIZE:0}
#This module is for LogQL API.
logql:
selector: ${SW_LOGQL:default}
default:
# For HTTP server
restHost: ${SW_LOGQL_REST_HOST:0.0.0.0}
restPort: ${SW_LOGQL_REST_PORT:3100}
restContextPath: ${SW_LOGQL_REST_CONTEXT_PATH:/}
restMaxThreads: ${SW_LOGQL_REST_MAX_THREADS:200}
restIdleTimeOut: ${SW_LOGQL_REST_IDLE_TIMEOUT:30000}
restAcceptQueueSize: ${SW_LOGQL_REST_QUEUE_SIZE:0}
alarm:
selector: ${SW_ALARM:default}
default:
telemetry:
selector: ${SW_TELEMETRY:none}
none:
prometheus:
host: ${SW_TELEMETRY_PROMETHEUS_HOST:0.0.0.0}
port: ${SW_TELEMETRY_PROMETHEUS_PORT:1234}
sslEnabled: ${SW_TELEMETRY_PROMETHEUS_SSL_ENABLED:false}
sslKeyPath: ${SW_TELEMETRY_PROMETHEUS_SSL_KEY_PATH:""}
sslCertChainPath: ${SW_TELEMETRY_PROMETHEUS_SSL_CERT_CHAIN_PATH:""}
configuration:
selector: ${SW_CONFIGURATION:none}
none:
grpc:
host: ${SW_DCS_SERVER_HOST:""}
port: ${SW_DCS_SERVER_PORT:80}
clusterName: ${SW_DCS_CLUSTER_NAME:SkyWalking}
period: ${SW_DCS_PERIOD:20}
apollo:
apolloMeta: ${SW_CONFIG_APOLLO:http://localhost:8080}
apolloCluster: ${SW_CONFIG_APOLLO_CLUSTER:default}
apolloEnv: ${SW_CONFIG_APOLLO_ENV:""}
appId: ${SW_CONFIG_APOLLO_APP_ID:skywalking}
zookeeper:
period: ${SW_CONFIG_ZK_PERIOD:60} # Unit seconds, sync period. Default fetch every 60 seconds.
namespace: ${SW_CONFIG_ZK_NAMESPACE:/default}
hostPort: ${SW_CONFIG_ZK_HOST_PORT:localhost:2181}
# Retry Policy
baseSleepTimeMs: ${SW_CONFIG_ZK_BASE_SLEEP_TIME_MS:1000} # initial amount of time to wait between retries
maxRetries: ${SW_CONFIG_ZK_MAX_RETRIES:3} # max number of times to retry
etcd:
period: ${SW_CONFIG_ETCD_PERIOD:60} # Unit seconds, sync period. Default fetch every 60 seconds.
endpoints: ${SW_CONFIG_ETCD_ENDPOINTS:http://localhost:2379}
namespace: ${SW_CONFIG_ETCD_NAMESPACE:/skywalking}
authentication: ${SW_CONFIG_ETCD_AUTHENTICATION:false}
user: ${SW_CONFIG_ETCD_USER:}
password: ${SW_CONFIG_ETCD_password:}
consul:
# Consul host and ports, separated by comma, e.g. 1.2.3.4:8500,2.3.4.5:8500
hostAndPorts: ${SW_CONFIG_CONSUL_HOST_AND_PORTS:1.2.3.4:8500}
# Sync period in seconds. Defaults to 60 seconds.
period: ${SW_CONFIG_CONSUL_PERIOD:60}
# Consul aclToken
aclToken: ${SW_CONFIG_CONSUL_ACL_TOKEN:""}
k8s-configmap:
period: ${SW_CONFIG_CONFIGMAP_PERIOD:60}
namespace: ${SW_CLUSTER_K8S_NAMESPACE:default}
labelSelector: ${SW_CLUSTER_K8S_LABEL:app=collector,release=skywalking}
nacos:
# Nacos Server Host
serverAddr: ${SW_CONFIG_NACOS_SERVER_ADDR:127.0.0.1}
# Nacos Server Port
port: ${SW_CONFIG_NACOS_SERVER_PORT:8848}
# Nacos Configuration Group
group: ${SW_CONFIG_NACOS_SERVER_GROUP:skywalking}
# Nacos Configuration namespace
namespace: ${SW_CONFIG_NACOS_SERVER_NAMESPACE:}
# Unit seconds, sync period. Default fetch every 60 seconds.
period: ${SW_CONFIG_NACOS_PERIOD:60}
# Nacos auth username
username: ${SW_CONFIG_NACOS_USERNAME:""}
password: ${SW_CONFIG_NACOS_PASSWORD:""}
# Nacos auth accessKey
accessKey: ${SW_CONFIG_NACOS_ACCESSKEY:""}
secretKey: ${SW_CONFIG_NACOS_SECRETKEY:""}
exporter:
selector: ${SW_EXPORTER:-}
default:
# gRPC exporter
enableGRPCMetrics: ${SW_EXPORTER_ENABLE_GRPC_METRICS:false}
gRPCTargetHost: ${SW_EXPORTER_GRPC_HOST:127.0.0.1}
gRPCTargetPort: ${SW_EXPORTER_GRPC_PORT:9870}
# Kafka exporter
enableKafkaTrace: ${SW_EXPORTER_ENABLE_KAFKA_TRACE:false}
enableKafkaLog: ${SW_EXPORTER_ENABLE_KAFKA_LOG:false}
kafkaBootstrapServers: ${SW_EXPORTER_KAFKA_SERVERS:localhost:9092}
# Kafka producer config, JSON format as Properties.
kafkaProducerConfig: ${SW_EXPORTER_KAFKA_PRODUCER_CONFIG:""}
kafkaTopicTrace: ${SW_EXPORTER_KAFKA_TOPIC_TRACE:skywalking-export-trace}
kafkaTopicLog: ${SW_EXPORTER_KAFKA_TOPIC_LOG:skywalking-export-log}
exportErrorStatusTraceOnly: ${SW_EXPORTER_KAFKA_TRACE_FILTER_ERROR:false}
health-checker:
selector: ${SW_HEALTH_CHECKER:-}
default:
checkIntervalSeconds: ${SW_HEALTH_CHECKER_INTERVAL_SECONDS:5}
configuration-discovery:
selector: ${SW_CONFIGURATION_DISCOVERY:default}
default:
disableMessageDigest: ${SW_DISABLE_MESSAGE_DIGEST:false}
receiver-event:
selector: ${SW_RECEIVER_EVENT:default}
default:
receiver-ebpf:
selector: ${SW_RECEIVER_EBPF:default}
default:
# The continuous profiling policy cache time, Unit is second.
continuousPolicyCacheTimeout: ${SW_CONTINUOUS_POLICY_CACHE_TIMEOUT:60}
receiver-telegraf:
selector: ${SW_RECEIVER_TELEGRAF:default}
default:
activeFiles: ${SW_RECEIVER_TELEGRAF_ACTIVE_FILES:vm}
aws-firehose:
selector: ${SW_RECEIVER_AWS_FIREHOSE:default}
default:
host: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_HOST:0.0.0.0}
port: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_PORT:12801}
contextPath: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_CONTEXT_PATH:/}
maxThreads: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_MAX_THREADS:200}
idleTimeOut: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_IDLE_TIME_OUT:30000}
acceptQueueSize: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_ACCEPT_QUEUE_SIZE:0}
maxRequestHeaderSize: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_MAX_REQUEST_HEADER_SIZE:8192}
firehoseAccessKey: ${SW_RECEIVER_AWS_FIREHOSE_ACCESS_KEY:}
enableTLS: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_ENABLE_TLS:false}
tlsKeyPath: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_TLS_KEY_PATH:}
tlsCertChainPath: ${SW_RECEIVER_AWS_FIREHOSE_HTTP_TLS_CERT_CHAIN_PATH:}
ai-pipeline:
selector: ${SW_AI_PIPELINE:default}
default:
uriRecognitionServerAddr: ${SW_AI_PIPELINE_URI_RECOGNITION_SERVER_ADDR:}
uriRecognitionServerPort: ${SW_AI_PIPELINE_URI_RECOGNITION_SERVER_PORT:17128}

View File

@ -1,48 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<Configuration status="DEBUG">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout>
<LevelPatternSelector defaultPattern="%d %c %L [%t] %-5p %x - %m%n">
<PatternMatch key="ERROR" pattern="%d %c %L [%t] %-5p %x - [%swversion] %m%n" />
</LevelPatternSelector>
</PatternLayout>
</Console>
</Appenders>
<Loggers>
<logger name="org.apache.zookeeper" level="INFO"/>
<logger name="io.grpc.netty" level="INFO"/>
<logger name="io.netty" level="INFO"/>
<logger name="org.apache.http" level="INFO"/>
<logger name="org.apache.skywalking.oap.server.core" level="DEBUG"/>
<logger name="org.apache.skywalking.oap.server.core.storage.PersistenceTimer" level="INFO"/>
<logger name="org.apache.skywalking.oap.server.core.analysis.worker" level="DEBUG" />
<logger name="org.apache.skywalking.oap.server.core.remote.client" level="DEBUG"/>
<logger name="org.apache.skywalking.oap.server.library.buffer" level="INFO"/>
<logger name="org.apache.skywalking.oap.server.receiver.envoy.MetricServiceGRPCHandler" level="INFO"/>
<logger name="org.apache.skywalking.oap.meter.analyzer.prometheus.PrometheusMetricConverter" level="INFO"/>
<logger name="org.apache.skywalking.library.elasticsearch" level="DEBUG"/>
<Root level="DEBUG">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>

View File

@ -1,93 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.skywalking</groupId>
<artifactId>graal</artifactId>
<version>9.7.0-SNAPSHOT</version>
</parent>
<artifactId>library-util-graal-native</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>library-util</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java-util</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</dependency>
<dependency>
<groupId>uk.org.webcompere</groupId>
<artifactId>system-stubs-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.skywalking</groupId>
<artifactId>library-util</artifactId>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,91 +0,0 @@
/*
* 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.skywalking.oap.server.library.util;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
/**
* All methods of this class are replaced due to the Graal limitation on acquiring classpath resources,
* Methods in this class that should obtain classpath resources are all replaced to acquire resources from the dist/config directory.
*/
public class ResourceUtils {
private static final String CONFIG_PATH_ENV = "SW_CONFIG_PATHS";
private static Path PATH = null;
static {
String configPaths = System.getenv(CONFIG_PATH_ENV);
if (configPaths != null) {
PATH = Paths.get(configPaths);
}
}
public static Reader read(String fileName) throws IOException {
return new InputStreamReader(readToStream(fileName), StandardCharsets.UTF_8);
}
public static InputStream readToStream(String fileName) throws IOException {
return Files.newInputStream(getRootPath().resolve(fileName));
}
public static File[] getPathFiles(String path) throws IOException {
return getDirectoryFilesRecursive(path, 1).toArray(new File[0]);
}
/**
* @param directoryPath the directory path
* @param maxDepth the max directory depth to get the files, the given directory is 0 as the tree root
* @return all normal files which in this directory and subDirectory according to the maxDepth
* @throws FileNotFoundException the directory not exist in the given path
*/
public static List<File> getDirectoryFilesRecursive(String directoryPath,
int maxDepth) throws IOException {
Path subPath = getRootPath().resolve(directoryPath);
List<File> fileList = new ArrayList<>();
Files.walk(subPath, maxDepth)
.filter(Files::isRegularFile)
.forEach(p -> fileList.add(p.toFile()));
return fileList;
}
public static Path getPath(String path) {
return getRootPath().resolve(path);
}
private static Path getRootPath() {
if (PATH == null) {
throw new NullPointerException("Failed to retrieve the environment variable: " + CONFIG_PATH_ENV);
}
return PATH;
}
}

View File

@ -1,40 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.skywalking</groupId>
<artifactId>graal</artifactId>
<version>9.7.0-SNAPSHOT</version>
</parent>
<artifactId>log-analyzer-graal-native</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>log-analyzer</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</project>

View File

@ -1,39 +0,0 @@
/*
* 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.skywalking.oap.log.analyzer.provider.graal;
import org.apache.skywalking.oap.log.analyzer.provider.LogAnalyzerModuleProvider;
import org.apache.skywalking.oap.server.library.module.ModuleStartException;
import org.apache.skywalking.oap.server.library.module.ServiceNotProvidedException;
/**
* TODO, disabled LAL kernel due to the Graal limitation on Groovy stack.
* SkyWalking will provide an alternative solution to replace the groovy stack based solution in the near future.
*/
public class LogAnalyzerModuleProviderGraal extends LogAnalyzerModuleProvider {
@Override
public String name() {
return "graalvm";
}
@Override
public void start() throws ServiceNotProvidedException, ModuleStartException {
}
}

View File

@ -1,19 +0,0 @@
#
# 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.
#
#
org.apache.skywalking.oap.log.analyzer.provider.graal.LogAnalyzerModuleProviderGraal

View File

@ -1,79 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.skywalking</groupId>
<artifactId>graal</artifactId>
<version>9.7.0-SNAPSHOT</version>
</parent>
<artifactId>meter-analyzer-graal-native</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>meter-analyzer</artifactId>
<version>${project.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>library-kubernetes-support</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy</artifactId>
</dependency>
<dependency>
<groupId>io.vavr</groupId>
<artifactId>vavr</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.skywalking</groupId>
<artifactId>meter-analyzer</artifactId>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,47 +0,0 @@
/*
* 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.skywalking.oap.meter.analyzer;
import com.google.common.collect.ImmutableMap;
import io.vavr.Tuple;
import io.vavr.Tuple2;
import org.apache.skywalking.oap.meter.analyzer.dsl.SampleFamily;
import org.apache.skywalking.oap.server.core.analysis.meter.MeterSystem;
/**
* TODO, disabled MAL kernel due to the Graal limitation on Groovy stack.
* SkyWalking will provide an alternative solution to replace the groovy stack based solution in the near future.
*/
public class Analyzer {
public static final Tuple2<String, SampleFamily> NIL = Tuple.of("", null);
public static Analyzer build(final String metricName,
final String filterExpression,
final String expression,
final MeterSystem meterSystem) {
return new Analyzer();
}
public void analyse(final ImmutableMap<String, SampleFamily> sampleFamilies) {
}
}

View File

@ -1,86 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.skywalking</groupId>
<artifactId>graal</artifactId>
<version>9.7.0-SNAPSHOT</version>
</parent>
<artifactId>oal-rt-graal-native</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>oal-rt</artifactId>
<version>${project.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>oal-grammar</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.antlr</groupId>
<artifactId>antlr4-runtime</artifactId>
</dependency>
<dependency>
<groupId>org.freemarker</groupId>
<artifactId>freemarker</artifactId>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>receiver-proto</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.skywalking</groupId>
<artifactId>oal-rt</artifactId>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,187 +0,0 @@
/*
* 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.skywalking.oal.rt;
import lombok.extern.slf4j.Slf4j;
import org.apache.skywalking.oap.server.core.analysis.Stream;
import org.apache.skywalking.oap.server.core.oal.rt.OALDefine;
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URL;
import java.nio.file.FileSystem;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Enumeration;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* Changed the implementation of the OAL kernel due to the Graal limitation on runtime class generation.
* Now, class generation will be advanced to compile time, see (@link org.apache.skywalking.graal.OALGenerator) and loaded at runtime.
*/
@Slf4j
public class OALRuntime extends OALKernel {
private static boolean INITIALED = false;
private static final String OAL_CLASSES_PACKAGE_BASE = "org.apache.skywalking.oap.server.core.source.oal.rt";
public OALRuntime(OALDefine define) {
super(define);
}
@Override
public void start(ClassLoader currentClassLoader) {
if (INITIALED) {
return;
}
if (Objects.equals(System.getProperty("org.graalvm.nativeimage.imagecode"), "runtime")) {
startByNativeImage(currentClassLoader);
} else {
startByJar(currentClassLoader);
}
INITIALED = true;
}
private void startByNativeImage(ClassLoader currentClassLoader) {
try (FileSystem fileSystem = FileSystems.newFileSystem(URI.create("resource:/"), Map.of(), currentClassLoader)) {
String basePackage = getOalClassesPackageBasePath();
String metricsPath = basePackage + File.separator + "metrics";
String dispatcherPath = basePackage + File.separator + "dispatcher";
String metricsBuilderPath = metricsPath + File.separator + "builder";
Path metrics = fileSystem.getPath(metricsPath);
Path dispatcher = fileSystem.getPath(dispatcherPath);
try (java.util.stream.Stream<Path> files = Files.walk(metrics)) {
files.forEach(file -> {
if (!file.toString().endsWith(".class")) {
return;
}
String name = file.toString().replace(File.separator, ".");
name = name.substring(0, name.length() - ".class".length());
if (name.startsWith(metricsBuilderPath.replace(File.separatorChar, '.'))) {
return;
}
try {
Class<?> aClass = Class.forName(name);
if (!aClass.isAnnotationPresent(Stream.class)) {
return;
}
getMetricsClasses().add(aClass);
} catch (ClassNotFoundException e) {
// should not reach here
log.error(e.getMessage(), e);
}
});
}
catch (IOException e) {
log.error("Failed to walk the path: " + metrics, e);
}
try (java.util.stream.Stream<Path> files = Files.walk(dispatcher)) {
files.forEach(file -> {
if (!file.toString().endsWith(".class")) {
return;
}
String name = file.toString().replace(File.separator, ".");
name = name.substring(0, name.length() - ".class".length());
try {
getDispatcherClasses().add(Class.forName(name));
} catch (ClassNotFoundException e) {
// should not reach here
log.error(e.getMessage(), e);
}
});
}
catch (IOException e) {
log.error("Failed to walk the path: " + dispatcher, e);
}
} catch (IOException e) {
// should not reach here
log.error("Failed to create FileSystem", e);
}
}
private void startByJar(ClassLoader currentClassLoader) {
String basePackage = getOalClassesPackageBasePath();
String metricsPath = basePackage + File.separator + "metrics";
String dispatcherPath = basePackage + File.separator + "dispatcher";
String metricsBuilderPath = metricsPath + File.separator + "builder";
try {
Enumeration<URL> metricsResources = currentClassLoader.getResources(metricsPath);
while (metricsResources.hasMoreElements()) {
URL resource = metricsResources.nextElement();
processResourcePath(resource, getMetricsClasses(), metricsBuilderPath.replace(File.separatorChar, '.'));
}
} catch (IOException e) {
log.error("Failed to locate resource " + metricsPath + " on classpath", e);
}
try {
Enumeration<URL> dispatcherResources = currentClassLoader.getResources(dispatcherPath);
while (dispatcherResources.hasMoreElements()) {
URL resource = dispatcherResources.nextElement();
processResourcePath(resource, getDispatcherClasses(), null);
}
} catch (IOException e) {
log.error("Failed to locate resource " + dispatcherPath + " on classpath", e);
}
}
private void processResourcePath(URL resource, List<Class> classes, String excludeStartWith) {
try {
String protocol = resource.getProtocol();
if ("file".equals(protocol)) {
File dir = new File(resource.getFile());
if (dir.isDirectory()) {
for (File file : Objects.requireNonNull(dir.listFiles())) {
if (file.getName().endsWith(".class")) {
String className = file.getPath().replace(File.separatorChar, '.');
className = className.substring(0, className.length() - ".class".length());
if (excludeStartWith != null && className.startsWith(excludeStartWith)) {
continue;
}
Class<?> aClass = Class.forName(className);
if (aClass.isAnnotationPresent(Stream.class)) {
classes.add(aClass);
}
}
}
}
}
} catch (ClassNotFoundException e) {
// should not reach here
log.error(e.getMessage(), e);
}
}
private String getOalClassesPackageBasePath() {
return OAL_CLASSES_PACKAGE_BASE.replace('.', File.separatorChar);
}
}

View File

@ -1,79 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.skywalking</groupId>
<artifactId>apm</artifactId>
<version>9.7.0-SNAPSHOT</version>
</parent>
<artifactId>graal</artifactId>
<packaging>pom</packaging>
<modules>
<module>graal-server-starter</module>
<module>server-core-graal-native</module>
<module>meter-analyzer-graal-native</module>
<module>oal-rt-graal-native</module>
<module>library-util-graal-native</module>
<module>skywalking-on-graal-compiling-plugin</module>
<module>apache-skywalking-native-apm</module>
<module>log-analyzer-graal-native</module>
<module>envoy-metrics-receiver-plugin-graal-native</module>
<module>graal-package-IT</module>
</modules>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>apm-network</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>oap-server-bom</artifactId>
<version>${project.version}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>library-util</artifactId>
<scope>provided</scope>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>server-core</artifactId>
<scope>provided</scope>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>meter-analyzer</artifactId>
<scope>provided</scope>
<version>${project.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>

View File

@ -1,134 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.skywalking</groupId>
<artifactId>graal</artifactId>
<version>9.7.0-SNAPSHOT</version>
</parent>
<artifactId>server-core-graal-native</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>server-core</artifactId>
<version>${project.version}</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>library-module</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>telemetry-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>configuration-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>library-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>library-server</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>library-datacarrier-queue</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>apm-network</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
</dependency>
<dependency>
<groupId>io.vavr</groupId>
<artifactId>vavr</artifactId>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>server-testing</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-testing</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.zipkin.zipkin2</groupId>
<artifactId>zipkin</artifactId>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>ai-pipeline</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>unpack</goal>
</goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.apache.skywalking</groupId>
<artifactId>server-core</artifactId>
<outputDirectory>${project.build.directory}/classes</outputDirectory>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,122 +0,0 @@
/*
* 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.skywalking.oap.server.core.oal.rt;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.skywalking.oap.server.core.CoreModule;
import org.apache.skywalking.oap.server.core.analysis.DispatcherDetectorListener;
import org.apache.skywalking.oap.server.core.analysis.StreamAnnotationListener;
import org.apache.skywalking.oap.server.core.source.DefaultScopeDefine;
import org.apache.skywalking.oap.server.core.source.SourceReceiver;
import org.apache.skywalking.oap.server.core.storage.StorageBuilderFactory;
import org.apache.skywalking.oap.server.core.storage.StorageException;
import org.apache.skywalking.oap.server.core.storage.StorageModule;
import org.apache.skywalking.oap.server.library.module.ModuleManager;
import org.apache.skywalking.oap.server.library.module.ModuleStartException;
import org.apache.skywalking.oap.server.library.module.Service;
import java.lang.reflect.Constructor;
import java.util.HashSet;
import java.util.List;
import java.util.Objects;
import java.util.Set;
/**
* Changed the way of register scpopes due to the Graal limitation on scanning classpath.
* Now, A class will be generated during compile time, it contains all the scopes that need to be registered, see (@link org.apache.skywalking.graal.OALGenerator) and register at runtime.
*/
@Slf4j
@RequiredArgsConstructor
public class OALEngineLoaderService implements Service {
private final Set<OALDefine> oalDefineSet = new HashSet<>();
private final ModuleManager moduleManager;
private static boolean SCOPE_REGISTERED = false;
public void load(OALDefine define) throws ModuleStartException {
if (oalDefineSet.contains(define)) {
return;
}
try {
OALEngine engine = loadOALEngine(define);
DispatcherDetectorListener dispatcherDetectorListener = moduleManager.find(CoreModule.NAME)
.provider()
.getService(SourceReceiver.class)
.getDispatcherDetectorListener();
engine.setDispatcherListener(dispatcherDetectorListener);
if (!SCOPE_REGISTERED && Objects.equals(System.getProperty("org.graalvm.nativeimage.imagecode"), "runtime")) {
registerAllScope(dispatcherDetectorListener);
SCOPE_REGISTERED = true;
}
StreamAnnotationListener streamAnnotationListener = new StreamAnnotationListener(moduleManager);
engine.setStreamListener(streamAnnotationListener);
engine.setStorageBuilderFactory(moduleManager.find(StorageModule.NAME)
.provider()
.getService(StorageBuilderFactory.class));
engine.start(OALEngineLoaderService.class.getClassLoader());
engine.notifyAllListeners();
oalDefineSet.add(define);
} catch (ReflectiveOperationException | OALCompileException e) {
throw new ModuleStartException(e.getMessage(), e);
}
}
private void registerAllScope(DispatcherDetectorListener dispatcherDetectorListener) {
try {
Class<?> scannedClasses = Class.forName("org.apache.skywalking.oap.graal.ScannedClasses");
List<Class> streamClasses = (List<Class>) scannedClasses.getDeclaredField("streamClasses").get(null);
List<Class> scopeDeclareClasses = (List<Class>) scannedClasses.getDeclaredField("scopeDeclarationClasses").get(null);
List<Class> dispatcherClasses = (List<Class>) scannedClasses.getDeclaredField("dispatcherClasses").get(null);
DefaultScopeDefine.Listener listener = new DefaultScopeDefine.Listener();
StreamAnnotationListener streamAnnotationListener = new StreamAnnotationListener(moduleManager);
dispatcherClasses.forEach(clazz -> {
try {
dispatcherDetectorListener.addIfAsSourceDispatcher(clazz);
} catch (IllegalAccessException | InstantiationException e) {
log.error("add dispatcher:" + clazz + "failed", e);
}
});
scopeDeclareClasses.forEach(
listener::notify
);
streamClasses.forEach(clazz -> {
try {
streamAnnotationListener.notify(clazz);
} catch (StorageException e) {
log.error("notify class:" + clazz + "failed", e);
}
});
} catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) {
log.error("register scopes failed");
}
}
private static OALEngine loadOALEngine(OALDefine define) throws ReflectiveOperationException {
Class<?> engineRTClass = Class.forName("org.apache.skywalking.oal.rt.OALRuntime");
Constructor<?> engineRTConstructor = engineRTClass.getConstructor(OALDefine.class);
return (OALEngine) engineRTConstructor.newInstance(define);
}
}

View File

@ -1,124 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ 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.
~
-->
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.apache.skywalking</groupId>
<artifactId>graal</artifactId>
<version>9.7.0-SNAPSHOT</version>
</parent>
<packaging>maven-plugin</packaging>
<artifactId>skywalking-on-graal-compiling-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven.plugin-tools</groupId>
<artifactId>maven-plugin-annotations</artifactId>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>oal-rt-graal-native</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>library-util-graal-native</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>server-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.apache.skywalking</groupId>
<artifactId>oal-rt</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.skywalking</groupId>
<artifactId>server-core</artifactId>
</exclusion>
</exclusions>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>server-core-graal-native</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>oal-rt</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>meter-analyzer-graal-native</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.9.0</version>
<configuration>
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
</configuration>
<executions>
<execution>
<id>default-descriptor</id>
<phase>process-classes</phase>
<goals>
<goal>descriptor</goal>
</goals>
</execution>
<execution>
<id>default-addPluginArtifactMetadata</id>
<phase>package</phase>
<goals>
<goal>addPluginArtifactMetadata</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

View File

@ -1,163 +0,0 @@
/*
* 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.skywalking.graal;
import com.google.common.collect.ImmutableSet;
import com.google.common.reflect.ClassPath;
import javassist.CannotCompileException;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtField;
import javassist.NotFoundException;
import org.apache.skywalking.aop.server.receiver.mesh.MeshOALDefine;
import org.apache.skywalking.oal.rt.parser.OALScripts;
import org.apache.skywalking.oal.rt.parser.ScriptParser;
import org.apache.skywalking.oal.rt.util.OALClassGenerator;
import org.apache.skywalking.oap.server.core.analysis.SourceDispatcher;
import org.apache.skywalking.oap.server.core.analysis.Stream;
import org.apache.skywalking.oap.server.core.annotation.AnnotationScan;
import org.apache.skywalking.oap.server.core.oal.rt.CoreOALDefine;
import org.apache.skywalking.oap.server.core.oal.rt.DisableOALDefine;
import org.apache.skywalking.oap.server.core.oal.rt.OALCompileException;
import org.apache.skywalking.oap.server.core.source.DefaultScopeDefine;
import org.apache.skywalking.oap.server.core.source.ScopeDeclaration;
import org.apache.skywalking.oap.server.core.storage.StorageBuilderFactory;
import org.apache.skywalking.oap.server.library.module.ModuleStartException;
import org.apache.skywalking.oap.server.library.util.ResourceUtils;
import org.apache.skywalking.oap.server.receiver.browser.provider.BrowserOALDefine;
import org.apache.skywalking.oap.server.receiver.clr.provider.CLROALDefine;
import org.apache.skywalking.oap.server.receiver.envoy.TCPOALDefine;
import org.apache.skywalking.oap.server.receiver.jvm.provider.JVMOALDefine;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;
import java.lang.reflect.Modifier;
import java.util.ArrayList;
import java.util.List;
public class OALGenerator {
public static void generateOALClass(String rootPath) throws ModuleStartException, OALCompileException {
AnnotationScan scopeScan = new AnnotationScan();
scopeScan.registerListener(new DefaultScopeDefine.Listener());
try {
scopeScan.scan();
} catch (Exception e) {
throw new ModuleStartException(e.getMessage(), e);
}
List<OALClassGenerator> oalClassGenerators = new ArrayList<>();
oalClassGenerators.add(new OALClassGenerator(DisableOALDefine.INSTANCE));
oalClassGenerators.add(new OALClassGenerator(CoreOALDefine.INSTANCE));
oalClassGenerators.add(new OALClassGenerator(TCPOALDefine.INSTANCE));
oalClassGenerators.add(new OALClassGenerator(BrowserOALDefine.INSTANCE));
oalClassGenerators.add(new OALClassGenerator(JVMOALDefine.INSTANCE));
oalClassGenerators.add(new OALClassGenerator(CLROALDefine.INSTANCE));
oalClassGenerators.add(new OALClassGenerator(MeshOALDefine.INSTANCE));
for (OALClassGenerator generator :oalClassGenerators) {
generator.setStorageBuilderFactory(new StorageBuilderFactory.Default());
generator.setCurrentClassLoader(OALGenerator.class.getClassLoader());
generator.setOpenEngineDebug(true);
generateOALClassFiles(rootPath, generator);
}
}
private static void generateOALClassFiles(String rootPath, OALClassGenerator classGenerator) throws OALCompileException {
Reader read;
try {
String root = rootPath + File.separator + ".." + File.separator +
".." + File.separator + ".." + File.separator +
"oap-server" + File.separator + "server-starter" + File.separator +
"target" + File.separator + "classes" + File.separator;
String configFile = classGenerator.getOalDefine().getConfigFile();
read = new FileReader(root + configFile);
} catch (FileNotFoundException e) {
throw new RuntimeException("Can't locate " + classGenerator.getOalDefine().getConfigFile(), e);
}
OALScripts oalScripts;
try {
ScriptParser scriptParser = ScriptParser.createFromFile(read, classGenerator.getOalDefine().getSourcePackage());
oalScripts = scriptParser.parse();
} catch (IOException e) {
throw new RuntimeException("OAL script parse analysis failure.", e);
}
classGenerator.generateClassAtRuntime(oalScripts, new ArrayList<>(), new ArrayList<>());
}
public static void generateForOALAnnotation(String path) throws IOException, CannotCompileException, NotFoundException {
ClassPath classpath = ClassPath.from(ResourceUtils.class.getClassLoader());
ImmutableSet<ClassPath.ClassInfo> classes = classpath.getTopLevelClassesRecursive("org.apache.skywalking");
List<Class> annotationStreamClass = new ArrayList<>();
List<Class> annotationScopeDeclarationClass = new ArrayList<>();
List<Class> dispatcherClass = new ArrayList<>();
classes.forEach(classInfo -> {
Class<?> clazz = classInfo.load();
if (clazz.isAnnotationPresent(Stream.class)) {
annotationStreamClass.add(clazz);
}
if (clazz.isAnnotationPresent(ScopeDeclaration.class)) {
annotationScopeDeclarationClass.add(clazz);
}
if (!clazz.isInterface() && !Modifier.isAbstract(
clazz.getModifiers()) && SourceDispatcher.class.isAssignableFrom(clazz)) {
dispatcherClass.add(clazz);
}
});
ClassPool pool = ClassPool.getDefault();
CtClass ctClass = pool.makeClass("org.apache.skywalking.oap.graal.ScannedClasses");
CtField listField1 = CtField.make(getFieldString("streamClasses", annotationStreamClass), ctClass);
CtField listField2 = CtField.make(getFieldString("scopeDeclarationClasses", annotationScopeDeclarationClass), ctClass);
CtField listField3 = CtField.make(getFieldString("dispatcherClasses", dispatcherClass), ctClass);
ctClass.addField(listField1);
ctClass.addField(listField2);
ctClass.addField(listField3);
String generatedFilePath = path + File.separator + "classes";
ctClass.writeFile(generatedFilePath);
}
private static String getFieldString(String fieldName, List<Class> classes) {
StringBuilder listFieldTemplate = new StringBuilder("public static java.util.List " + fieldName + " = java.util.Arrays.asList( new java.lang.Class[] {");
for (Class clazz: classes) {
listFieldTemplate.append(clazz.getName());
listFieldTemplate.append(".class,");
}
listFieldTemplate.deleteCharAt(listFieldTemplate.length() - 1);
listFieldTemplate.append("} );");
return listFieldTemplate.toString();
}
}

View File

@ -1,68 +0,0 @@
/*
* 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.skywalking.graal;
import javassist.CannotCompileException;
import javassist.NotFoundException;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.apache.maven.project.MavenProject;
import org.apache.skywalking.oal.rt.util.OALClassGenerator;
import org.apache.skywalking.oap.server.core.oal.rt.OALCompileException;
import org.apache.skywalking.oap.server.library.module.ModuleStartException;
import org.jetbrains.annotations.NotNull;
import java.io.File;
import java.io.IOException;
@Mojo(name = "oal-generate", defaultPhase = LifecyclePhase.PROCESS_CLASSES)
public class OALGeneratorMojo extends AbstractMojo {
@Parameter(defaultValue = "${project}", required = true, readonly = true)
private MavenProject project;
@Override
public void execute() {
try {
String targetDirectory = project.getBuild().getDirectory();
String generatedFilePath = getGeneratedFilePath(targetDirectory);
OALClassGenerator.setGeneratedFilePath(generatedFilePath);
OALGenerator.generateOALClass(targetDirectory);
OALGenerator.generateForOALAnnotation(targetDirectory);
} catch (OALCompileException | ModuleStartException | NotFoundException | IOException | CannotCompileException e) {
throw new RuntimeException(e);
}
}
@NotNull
private static String getGeneratedFilePath(String targetDirectory) {
return targetDirectory + File.separator + "classes" +
File.separator + "org" + File.separator + "apache" +
File.separator + "skywalking" + File.separator + "oap" +
File.separator + "server" + File.separator + "core" +
File.separator + "source" + File.separator + "oal" +
File.separator + "rt";
}
}

View File

@ -61,7 +61,7 @@
<freemarker.version>2.3.31</freemarker.version>
<javaassist.version>3.25.0-GA</javaassist.version>
<vavr.version>0.10.3</vavr.version>
<groovy.version>3.0.8</groovy.version>
<groovy.version>4.0.15</groovy.version>
<mvel.version>2.4.8.Final</mvel.version>
<commons-beanutils.version>1.9.4</commons-beanutils.version>
<flatbuffers-java.version>1.12.0</flatbuffers-java.version>
@ -488,7 +488,7 @@
<version>${vavr.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy</artifactId>
<version>${groovy.version}</version>
</dependency>

View File

@ -44,7 +44,7 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy</artifactId>
</dependency>
<dependency>

View File

@ -39,7 +39,7 @@
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.codehaus.groovy</groupId>
<groupId>org.apache.groovy</groupId>
<artifactId>groovy</artifactId>
</dependency>
<dependency>

View File

@ -143,15 +143,6 @@
</plugins>
</build>
</profile>
<profile>
<id>native</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<modules>
<module>graal</module>
</modules>
</profile>
</profiles>
<properties>