Skip to content

Commit

Permalink
[stream] add stream module; update github actions (#8)
Browse files Browse the repository at this point in the history
[stream] add stream module; update github actions
  • Loading branch information
jacobke committed Oct 1, 2020
1 parent 861f39e commit 7cd1d09
Show file tree
Hide file tree
Showing 179 changed files with 8,291 additions and 43 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/create_github_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This is a basic workflow to help you get started with Actions

name: Create Github Release

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Changes in this Release
- First Change
- Second Change
draft: true
prerelease: false
23 changes: 23 additions & 0 deletions .github/workflows/maven-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Deploy To Central Maven

on:
release:
types: [created]

jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Maven Central Repository
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Publish package
run: mvn -B deploy -Possrh
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
30 changes: 30 additions & 0 deletions .github/workflows/maven-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This workflow will build a Java project with Maven
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven

name: Mvn Test

on:
push:
branches:
- master
- ci
pull_request:
branches:
- master
- ci

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Unit Test
run: mvn -B test -Punit-test
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,5 @@ fabric.properties
hs_err_pid*

temp/
*.iml
*.iml
**/*.iml
15 changes: 15 additions & 0 deletions README_FOR_DEVELOPER.md → CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

## Set up your local development environment

1. set your git config. (suggest you set your email to [github private email address](https://github.com/settings/emails)):

```
git config user.name $YOUR_GITHUB_NAME
git config user.email $YOUR_GITHUB_EMAIL
# to double check config
git config --local -l
# sign your code with GPG
git config commit.gpgsign true
```

1. install [Docker](https://www.docker.com/products/docker-desktop)
2. run docker compose file: `docker-compose up`. This will start up following images:

Expand Down Expand Up @@ -32,6 +44,9 @@ gpg --keyserver hkp://keys.gnupg.net --send-keys YOUR_KEY_ID
gpg --keyserver hkp://pool.sks-keyservers.net --send-keys YOUR_KEY_ID
```

[GPG Suite](https://gpgtools.org/) is a useful to maintain GPG key on MacOS.
[Signing commits]() doc on github explained how to sign the commits.

#### Step two: register an OSSRH account and configure to maven setting

The first, register a [JIRA account](https://issues.sonatype.org/secure/Signup!default.jspa).
Expand Down
15 changes: 13 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
# Introduce
# [ETrace](https://etrace.io)\: a robust Application Performance Monitor system.

[![Hex.pm](https://img.shields.io/hexpm/l/plug)](https://github.com/jacobke/etrace/blob/master/LICENSE)
[![Maven Central](https://img.shields.io/maven-central/v/io.etrace/etrace-agent?label=etrace)](https://search.maven.org/search?q=a:etrace-agent)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/etrace-io/etrace/Mvn%20Test)](https://github.com/etrace-io/etrace/actions?query=workflow%3A%22Mvn+Test%22)
[![CodeFactor](https://img.shields.io/codefactor/grade/github/etrace-io/etrace)](https://www.codefactor.io/repository/github/etrace-io/etrace)

[![GitHub issues](https://img.shields.io/github/issues/etrace-io/etrace)](https://github.com/etrace-io/etrace/issues)
[![GitHub commit activity](https://img.shields.io/github/commit-activity/m/etrace-io/etrace)](https://github.com/etrace-io/etrace/pulse)
[![GitHub last commit](https://img.shields.io/github/last-commit/etrace-io/etrace)](https://github.com/etrace-io/etrace/graphs/commit-activity)
![GitHub Org's stars](https://img.shields.io/github/stars/etrace-io?style=social)

This is a robust Application Performance Monitor system.

# Introduce

11 changes: 11 additions & 0 deletions docker-compose-etrace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ services:
networks:
- backend

stream:
build:
context: ./etrace-stream/stream-container
dockerfile: Dockerfile
image: etrace-api:local
container_name: etrace_stream
# ports:
# - 9000:9001
networks:
- backend

networks:
backend:
driver: bridge
2 changes: 1 addition & 1 deletion etrace-collector/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM nimmis/java-centos:oracle-8-jdk as jdk8
EXPOSE 2890
COPY target/etrace-collector.tar.gz /etrace-collector/
ADD target/etrace-collector.tar.gz /etrace-collector/
WORKDIR /etrace-collector
RUN tar -xf etrace-collector.tar.gz
RUN ls
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ public interface InternalMetricName {
String KAFKA_PRODUCER_LOSE_DATA = "kafka.producer.lose.data";
String KAFKA_BLOCK_STORE_SEND = "kafka.block.store.send";

String LINDB_PRODUCER_SEND = "lindb.producer.send";
String STREAM_PRODUCER_SEND = "stream.producer.send";

}
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ public enum Type {
TCP,
GRPC,
KAFKA,
LINDB,
HDFS,
HBASE,
ES,
PROMETHEUS
PROMETHEUS,
LINDB,
}
}

Expand Down
2 changes: 1 addition & 1 deletion etrace-consumer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM nimmis/java-centos:oracle-8-jdk as jdk8
EXPOSE 8082
COPY target/etrace-consumer.tar.gz /etrace-consumer/
ADD target/etrace-consumer.tar.gz /etrace-consumer/
WORKDIR /etrace-consumer
RUN tar -xf etrace-consumer.tar.gz
RUN ls
Expand Down
8 changes: 4 additions & 4 deletions etrace-consumer/script/consumer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]})
# set consumer home path
cd "$SCRIPT_DIR/.."
CONSUMER_HOME=${CONSUMER_HOME-`pwd -P`}
CONSUMER_HOME=${CONSUMER_HOME-$(pwd -P)}

ENV_FILE="$CONSUMER_HOME/conf/env.sh"
source "${ENV_FILE}"
Expand All @@ -27,7 +27,7 @@ done

check_pid() {
if [ -f "${PID_FILE}" ]; then
PID=`cat "${PID_FILE}"`
PID=$(cat "${PID_FILE}")
if [ -n pid ]; then
echo ${PID}
fi
Expand All @@ -40,8 +40,8 @@ start() {

info() {
echo "****************************"
echo `head -n 1 /etc/issue`
echo `uname -a`
echo $(head -n 1 /etc/issue)
echo $(uname -a)
echo "CONSUMER_HOME=${CONSUMER_HOME}"
echo "CONSUMER_DRIVER=${CONSUMER_DRIVER}"
echo "****************************"
Expand Down
12 changes: 6 additions & 6 deletions etrace-consumer/script/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
SCRIPT_DIR=$(dirname ${BASH_SOURCE[0]})
# App Home
cd "$SCRIPT_DIR"
APP_HOME=${APP_HOME-`pwd -P`}
APP_HOME=${APP_HOME-$(pwd -P)}

DAEMON="consumer"
DESC="ETrace Consumer"
Expand All @@ -15,7 +15,7 @@ TIMEOUT=3

consumer_run(){
echo "Starting ${DESC} ....."
PID=`sh ${EXE_FILE} check_pid`
PID=$(sh ${EXE_FILE} check_pid)
if [ "${PID}" != "" ]; then
echo "WARN: ${DESC} already started! (pid=${PID})"
else
Expand All @@ -26,7 +26,7 @@ consumer_run(){

consumer_start(){
echo "Starting ${DESC} ....."
PID=`sh ${EXE_FILE} check_pid`
PID=$(sh ${EXE_FILE} check_pid)
if [ "${PID}" != "" ]; then
echo "WARN: ${DESC} already started! (pid=${PID})"
else
Expand All @@ -40,7 +40,7 @@ consumer_start(){
}

consumer_stop(){
PID=`sh ${EXE_FILE} check_pid`
PID=$(sh ${EXE_FILE} check_pid)
if [ "${PID}" != "" ]; then
echo "Stopping ${DESC} ....."
kill ${PID}
Expand All @@ -56,7 +56,7 @@ consumer_stop(){

consumer_status(){
echo "Checking ${DESC} ....."
PID=`sh ${EXE_FILE} check_pid`
PID=$(sh ${EXE_FILE} check_pid)
if [ "${PID}" != "" ]; then
echo "${DESC} is running! (pid=${PID})"
else
Expand All @@ -70,7 +70,7 @@ consumer_info(){
}

consumer_force_stop(){
PID=`sh ${EXE_FILE} check_pid`
PID=$(sh ${EXE_FILE} check_pid)
if [ "${PID}" != "" ]; then
echo "Stopping ${DESC} ....."
kill -9 ${PID}
Expand Down
61 changes: 61 additions & 0 deletions etrace-plugins/datasource-prometheus/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?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">
<parent>
<artifactId>etrace-plugins</artifactId>
<groupId>io.etrace</groupId>
<version>0.0.7-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>datasource-prometheus</artifactId>


<dependencies>
<dependency>
<groupId>io.etrace</groupId>
<artifactId>etrace-common</artifactId>
</dependency>
<!-- The client -->
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient</artifactId>
<version>${promethues.simpleclient.version}</version>
</dependency>
<!-- Hotspot JVM metrics-->
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_hotspot</artifactId>
<version>${promethues.simpleclient.version}</version>
</dependency>
<!-- Exposition HTTPServer-->
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_httpserver</artifactId>
<version>${promethues.simpleclient.version}</version>
</dependency>
<!-- Pushgateway exposition-->
<dependency>
<groupId>io.prometheus</groupId>
<artifactId>simpleclient_pushgateway</artifactId>
<version>${promethues.simpleclient.version}</version>
</dependency>


<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
</dependency>

</dependencies>
<properties>
<promethues.simpleclient.version>0.9.0</promethues.simpleclient.version>
</properties>

</project>
Loading

0 comments on commit 7cd1d09

Please sign in to comment.