Skip to content

Commit

Permalink
Feature: Update and read agent-configuration (#3)
Browse files Browse the repository at this point in the history
* Refactor: Switch to Gradle and Java

* Chore: Cleanup gitignore

* Chore: Apply code formatter

* Refactor: Frontend - Changed Endpoints

* Chore: Get CORS configuration from application.yaml

* chore!: Refactor DTO handling and change response handling when registering/connecting an agent and implement tests

* chore: Refactor DTO namings and adjust tests

* Feat: VHVAPM-530/531

* chore: Small refactoring of unneeded getter call

* chore: created docs

* fix: removed ssl from default config

* refactor: Fix findings and PR comments

* refactor: Remove @builder since we only create a new instance once

---------

Co-authored-by: Benjamin Clauss <[email protected]>
Co-authored-by: Levin Kerschberger <[email protected]>
  • Loading branch information
3 people authored Aug 30, 2024
1 parent 5198ab3 commit b73b043
Show file tree
Hide file tree
Showing 84 changed files with 1,522 additions and 1,416 deletions.
50 changes: 21 additions & 29 deletions .github/workflows/build-and-test-backend.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,30 @@
# This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-maven

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Backend CI
name: Gradle Build

on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]

jobs:
build-and-test:
build:

runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: maven
- name: Build and test backend with Maven
run: mvn -B --update-snapshots package --file ./backend/pom.xml
- name: Copy build artifact to staging directory
run: mkdir staging && cp ./backend/target/*.jar staging
- name: Upload build artifact to packages
uses: actions/upload-artifact@v4
with:
name: agentmanager-backend-snapshot
path: staging
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
with:
build-scan-publish: true
build-scan-terms-of-service-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-service-agree: "yes"

- name: Build with Gradle
run: ./gradlew build
40 changes: 34 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,35 @@
/out/
.DS_Store
.idea
*.iml
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

/agentmanager/frontend/src/.nuxt/
/agentmanager/frontend/src/node_modules/
# User-specific stuff
.idea/

# File-based project format
*.iws

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# Gradle Files
.gradle
# build-Folder in root-dir
/build
# ui artifact build
/ui/build_packageClient/

**/.DS_Store

**/node_modules
**/.nuxt
49 changes: 49 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Contributing

## IDE

We recommend using [IntelliJ](https://www.jetbrains.com/idea/download/#section=windows) as IDE for contributing.

## Formatting

We have [spotless](https://github.com/diffplug/spotless) configured to format the code. You can run the following commands:

- `./gradlew spotlessCheck` to validate the formatting of the code.
- `./gradlew spotlessApply` to format the code.

Be aware that the CI will fail if the code is not formatted correctly, as `spotlessCheck` is part of the build process.


## Building

### Prerequisites
Please make sure you have the following tools installed on your machine:
- A big cup of coffee
- A Java Development Kit (JDK) with version 21 or higher
- A working internet connection (for downloading dependencies)
- Docker (optional, for running the application in a container)

Thats it for now.

### Backend
To build the backend, simply run the following command in the root directory of the project:
```shell
./gradlew
```
This will generate the backend jar file in the `server/build/libs` directory.

> [!TIP]
> You might have installed an auto-formatter in your IDE. It may break the installed spotless code-style. In this case, the build will not be successfull. Please run ```./gradlew potlessApply``` to fix this issue.
### Frontend
To build the frontend, navigate to the `frontend/src` directory and run the following commands:
```shell
npm install
npm run build
```
This will generate an entry point that launches a ready-to-run node server in the `frontend/src/.output` directory.

You could also run the frontend in development mode by running:
```shell
npm run dev
```
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Welcome to the InspectIT Gepard Config-Server
InspectIT Gepard is an Extension for the OpenTelemetry Java agent,
enhancing your application with custom monitoring capabilities.
The agent is configured via a central configuration server,
which is responsible for providing instrumentation-rules, -scopes and -action along to configuration settings to the agent.
This repository contains the implementation of the configuration servers central component,
along with a User Interface for managing agents easily.

InspectIT Gepard is developed by Novatec Consulting GmbH and backed by VHV Group.
It´s purpose is to replace the InspectIT Ocelot project with a more modern and flexible approach, utilizing the OpenTelemetry standard.

## Getting Started
Currently, the project is in an early stage of development and not yet ready for production use.
However, if you want to try it out, you can follow the instructions in [CONTRIBUTING](./CONTRIBUTING.md).

## Useful Links
- [SonarCloud](https://sonarcloud.io/)
19 changes: 0 additions & 19 deletions agentmanager/backend/.mvn/wrapper/maven-wrapper.properties

This file was deleted.

Loading

0 comments on commit b73b043

Please sign in to comment.