Skip to content

Commit

Permalink
Move metrics-baseline into ai-pipeline module
Browse files Browse the repository at this point in the history
  • Loading branch information
mrproliu committed Feb 18, 2025
1 parent 8d9aa67 commit 6442631
Show file tree
Hide file tree
Showing 30 changed files with 158 additions and 363 deletions.
1 change: 1 addition & 0 deletions docs/en/changes/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
production-ready. Don't need H2 as default storage anymore.
* [Breaking Change] Bump up BanyanDB server version to 0.8.0. This version is not compatible with the previous
versions. Please upgrade the BanyanDB server to 0.8.0 before upgrading OAP to 10.2.0.
* Move `metrics-baseline` module into `ai-pipeline` module.

#### OAP Server

Expand Down
17 changes: 16 additions & 1 deletion oap-server/ai-pipeline/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,21 @@
<artifactId>library-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.skywalking</groupId>
<artifactId>server-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-testing</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-reflect</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -95,4 +110,4 @@
</plugin>
</plugins>
</build>
</project>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@
public class AIPipelineConfig extends ModuleConfig {
private String uriRecognitionServerAddr;
private int uriRecognitionServerPort = 17128;
private String baselineServerAddr;
private int baselineServerPort = 18080;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

package org.apache.skywalking.oap.server.ai.pipeline;

import org.apache.skywalking.oap.server.ai.pipeline.services.api.HttpUriRecognition;
import org.apache.skywalking.oap.server.ai.pipeline.services.BaselineQueryService;
import org.apache.skywalking.oap.server.library.module.ModuleDefine;

public class AIPipelineModule extends ModuleDefine {
Expand All @@ -30,8 +30,6 @@ public AIPipelineModule() {

@Override
public Class[] services() {
return new Class[]{
HttpUriRecognition.class
};
return new Class[]{BaselineQueryService.class};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@

package org.apache.skywalking.oap.server.ai.pipeline;

import org.apache.skywalking.oap.server.ai.pipeline.services.BaselineQueryService;
import org.apache.skywalking.oap.server.ai.pipeline.services.BaselineQueryServiceImpl;
import org.apache.skywalking.oap.server.ai.pipeline.services.HttpUriRecognitionService;
import org.apache.skywalking.oap.server.ai.pipeline.services.api.HttpUriRecognition;
import org.apache.skywalking.oap.server.core.CoreModule;
import org.apache.skywalking.oap.server.core.config.group.EndpointNameGroupService;
import org.apache.skywalking.oap.server.library.module.ModuleConfig;
import org.apache.skywalking.oap.server.library.module.ModuleDefine;
import org.apache.skywalking.oap.server.library.module.ModuleProvider;
Expand Down Expand Up @@ -56,25 +59,31 @@ public void onInitialized(final AIPipelineConfig initialized) {

@Override
public void prepare() throws ServiceNotProvidedException, ModuleStartException {
final HttpUriRecognitionService httpUriRecognitionService = new HttpUriRecognitionService(
aiPipelineConfig.getUriRecognitionServerAddr(),
aiPipelineConfig.getUriRecognitionServerPort()
);
this.registerServiceImplementation(HttpUriRecognition.class, httpUriRecognitionService);
this.registerServiceImplementation(BaselineQueryService.class, new BaselineQueryServiceImpl(
aiPipelineConfig.getBaselineServerAddr(),
aiPipelineConfig.getBaselineServerPort()
));
}

@Override
public void start() throws ServiceNotProvidedException, ModuleStartException {

final HttpUriRecognitionService httpUriRecognitionService = new HttpUriRecognitionService(
aiPipelineConfig.getUriRecognitionServerAddr(),
aiPipelineConfig.getUriRecognitionServerPort()
);
getManager().find(CoreModule.NAME).provider()
.getService(EndpointNameGroupService.class)
.startHttpUriRecognitionSvr(httpUriRecognitionService);
}

@Override
public void notifyAfterCompleted() throws ServiceNotProvidedException, ModuleStartException {

}

@Override
public String[] requiredModules() {
return new String[0];
return new String[] {
CoreModule.NAME
};
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
*/

package org.apache.skywalking.oap.server.baseline.service;
package org.apache.skywalking.oap.server.ai.pipeline.services;

import java.util.Map;
import org.apache.skywalking.oap.server.library.module.Service;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
*/

package org.apache.skywalking.oap.server.baseline.service;
package org.apache.skywalking.oap.server.ai.pipeline.services;

import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import org.apache.skywalking.oap.server.ai.pipeline.grpc.HttpUriRecognitionResponse;
import org.apache.skywalking.oap.server.ai.pipeline.grpc.HttpUriRecognitionServiceGrpc;
import org.apache.skywalking.oap.server.ai.pipeline.grpc.HttpUriRecognitionSyncRequest;
import org.apache.skywalking.oap.server.ai.pipeline.services.api.HttpUriPattern;
import org.apache.skywalking.oap.server.ai.pipeline.services.api.HttpUriRecognition;
import org.apache.skywalking.oap.server.core.config.group.ai.HttpUriPattern;
import org.apache.skywalking.oap.server.core.config.group.ai.HttpUriRecognition;
import org.apache.skywalking.oap.server.library.client.grpc.GRPCClient;
import org.apache.skywalking.oap.server.library.util.StringUtil;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
*/

package org.apache.skywalking.oap.server.baseline.service;
package org.apache.skywalking.oap.server.ai.pipeline.services;

import lombok.Builder;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
*/

package org.apache.skywalking.oap.server.baseline.service;
package org.apache.skywalking.oap.server.ai.pipeline.services;

import lombok.Builder;
import lombok.Data;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,17 @@
*
*/

package org.apache.skywalking.oap.server.baseline;

import com.google.protobuf.Empty;
import io.grpc.stub.StreamObserver;
import lombok.Builder;
import lombok.Data;
import org.apache.skywalking.apm.baseline.v3.AlarmBaselineLabeledValue;
import org.apache.skywalking.apm.baseline.v3.AlarmBaselineMetricsNames;
import org.apache.skywalking.oap.server.core.analysis.DownSampling;
import org.apache.skywalking.oap.server.core.analysis.TimeBucket;
import org.apache.skywalking.apm.baseline.v3.AlarmBaselineServiceGrpc;
import org.apache.skywalking.apm.baseline.v3.AlarmBaselineLabeledValue;
import org.apache.skywalking.apm.baseline.v3.AlarmBaselineValue;
import org.apache.skywalking.apm.baseline.v3.KeyStringValuePair;
import org.apache.skywalking.oap.server.core.analysis.DownSampling;
import org.apache.skywalking.oap.server.core.analysis.TimeBucket;

import java.util.ArrayList;
import java.util.Calendar;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,15 @@
*
*/

package org.apache.skywalking.oap.server.baseline;

import io.grpc.ManagedChannel;
import io.grpc.Server;
import io.grpc.inprocess.InProcessChannelBuilder;
import io.grpc.inprocess.InProcessServerBuilder;
import io.grpc.util.MutableHandlerRegistry;
import lombok.extern.slf4j.Slf4j;
import org.apache.skywalking.oap.server.baseline.service.BaselineQueryServiceImpl;
import org.apache.skywalking.oap.server.baseline.service.PredictServiceMetrics;
import org.apache.skywalking.oap.server.baseline.service.ServiceMetrics;
import org.apache.skywalking.oap.server.ai.pipeline.services.BaselineQueryServiceImpl;
import org.apache.skywalking.oap.server.ai.pipeline.services.PredictServiceMetrics;
import org.apache.skywalking.oap.server.ai.pipeline.services.ServiceMetrics;
import org.apache.skywalking.oap.server.core.analysis.DownSampling;
import org.apache.skywalking.oap.server.core.analysis.TimeBucket;
import org.junit.jupiter.api.AfterEach;
Expand Down
77 changes: 0 additions & 77 deletions oap-server/metrics-baseline/pom.xml

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 6442631

Please sign in to comment.