Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add intelligence method #380

Merged
merged 13 commits into from
Jul 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/ozhera-intelligence-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This is a basic workflow to help you get started with Actions

name: ozhera-intelligence test

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
pull_request:
paths:
- 'ozhera-intelligence/**'
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
check-build-21:
name: ozhera-intelligence test
runs-on: ubuntu-latest
steps:
- name: Setup Maven Action
uses: s4u/setup-maven-action@v1.7.0
with:
java-version: 21
#settings-properties: '[{"propertyName1": "propertyValue1"}, {"propertyName2": "propertyValue2"}]'

- run: echo '<settings> <interactiveMode>false</interactiveMode> <profiles> <profile> <repositories> <repository> <snapshots /> <id>ossrh</id> <name>ossrh-snapshot</name> <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url> </repository> </repositories> <pluginRepositories> <pluginRepository> <snapshots /> <id>ossrh</id> <name>ossrh-snapshot</name> <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url> </pluginRepository> </pluginRepositories> <id>artifactory</id> </profile> </profiles> <activeProfiles> <activeProfile>artifactory</activeProfile> </activeProfiles> <servers> <server> <id>github</id> <username>${env.GITHUB_ACTOR}</username> <password>${env.GITHUB_TOKEN}</password> </server> </servers> <mirrors/> <proxies/></settings>' > ~/.m2/settings.xml

- run: cd ozhera-intelligence; mvn -U clean package
12 changes: 12 additions & 0 deletions ozhera-intelligence/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Overview
+ OzHera Intelligence Platform is responsible for generating intelligent-related functionalities.
+ Currently, features are under development.
+ Planned features to be developed:
+ Root cause analysis, including trace, alerts, and topology-based intelligent analysis at the application level.

# Module Introduction

## ozhera-intelligence-server

+ Service to initiate intelligent functionalities.

10 changes: 10 additions & 0 deletions ozhera-intelligence/README_cn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# 概述
+ ozhera智能化平台,负责产生智能化相关功能。
+ 目前功能开发中
+ 计划将要开发的功能
+ 根因分析。包括Trace、报警、应用层面的基于拓扑图的智能分析。
# 模块功能介绍

## ozhera-intelligence-server

+ 智能化功能启动服务。
27 changes: 27 additions & 0 deletions ozhera-intelligence/ozhera-intelligence-domain/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<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>run.mone</groupId>
<artifactId>ozhera-intelligence</artifactId>
<version>1.0.0</version>
</parent>

<artifactId>ozhera-intelligence-domain</artifactId>

<properties>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>

<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright 2020 Xiaomi
*
* Licensed 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 run.mone.hera.intelligence.domain.rootanalysis;

import lombok.Builder;
import lombok.Data;

@Data
@Builder
public class LogParam {

private String application;

private String envId;

private String traceId;

private String startTime;

private String duration;

private String env;

private String level;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/*
* Copyright 2020 Xiaomi
*
* Licensed 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 run.mone.hera.intelligence.domain.rootanalysis;

import lombok.Data;

@Data
public class LogPromptResult {
private boolean root;

private String logReason;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright 2020 Xiaomi
*
* Licensed 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 run.mone.hera.intelligence.domain.rootanalysis;

import lombok.Builder;
import lombok.Data;

@Data
@Builder
public class MarkDownParam {

private String traceReason;

private String application;

private String logReason;

private String metricsReason;

private String simpleReason;

private String traceId;

private String timestamp;

private String env;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/*
* Copyright 2020 Xiaomi
*
* Licensed 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 run.mone.hera.intelligence.domain.rootanalysis;

import lombok.Data;

@Data
public class MetricsPromptResult {

private boolean root;

private String metricsReason;

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
* Copyright 2020 Xiaomi
*
* Licensed 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 run.mone.hera.intelligence.domain.rootanalysis;

import lombok.Builder;
import lombok.Data;

@Data
@Builder
public class MetricsQueryParam {

private String env;

private String application;

private String ip;

private String startTime;

private String duration;

// The error margin between the start time and end time,
// the actual query time range is [startTime - gap, endTime + gap]
private String gap;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright 2020 Xiaomi
*
* Licensed 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 run.mone.hera.intelligence.domain.rootanalysis;

import lombok.Data;

@Data
public class TracePromptResult {
// Detailed description of the exception reason, using professional Chinese terminology
private String traceReason;

// Name of the application that caused the exception,
// obtained from process.serviceName of the problem node
private String application;

// Whether it is the root cause, determined based on analysis
private boolean root;

// Environment ID of the application,
// obtained from the value of service.env.id in process.tags of the problem node
private String envId;

// Start time of the root cause Span,
// must use the original value without any conversion
private String startTime;

// Duration of the root cause node, obtained from the duration of the root cause node,
// must use the original value without any conversion
private String duration;

// Span ID of what you believe to be the root cause node
private String spanId;

// Value of process.ip for the node where the spanId is located
private String ip;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2020 Xiaomi
*
* Licensed 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 run.mone.hera.intelligence.domain.rootanalysis;

import lombok.Builder;
import lombok.Data;

import java.util.List;

@Data
@Builder
public class TraceQueryParam {
private String traceId;
private String env;
private List<String> timeStamp;
}
Loading
Loading