Skip to content

Commit fd6e377

Browse files
author
Lorine93s
committed
feat/complete v0
1 parent 273ba3f commit fd6e377

53 files changed

Lines changed: 4013 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/publish.yaml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish
2+
on:
3+
release:
4+
types: [published]
5+
permissions:
6+
id-token: write
7+
contents: read
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
environment: release
12+
steps:
13+
- uses: actions/checkout@v4
14+
with:
15+
fetch-depth: 0
16+
- uses: actions/setup-java@v4
17+
with:
18+
java-version: 17
19+
distribution: temurin
20+
cache: maven
21+
- name: Set version from tag
22+
run: |
23+
TAG=${{ github.event.release.tag_name }}
24+
mvn versions:set -DnewVersion=${TAG#v}
25+
- name: Create Maven settings.xml
26+
uses: s4u/maven-settings-action@v3.1.0
27+
with:
28+
servers: '[{"id": "central", "username": "${{ secrets.MAVEN_CENTRAL_USERNAME }}", "password": "${{ secrets.MAVEN_CENTRAL_PASSWORD }}"}]'
29+
- name: Import GPG key
30+
uses: crazy-max/ghaction-import-gpg@v6
31+
with:
32+
gpg_private_key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
33+
passphrase: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
34+
- name: Build and publish
35+
run: mvn -B deploy -P release

.github/workflows/summary.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Summary
2+
on:
3+
push:
4+
branches-ignore:
5+
- main
6+
jobs:
7+
wait-for-triggered-checks:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
checks: read
11+
steps:
12+
- name: Wait for all triggered status checks
13+
uses: poseidon/wait-for-status-checks@v0.6.0
14+
with:
15+
token: ${{ secrets.GITHUB_TOKEN }}
16+
ignore_pattern: ^codecov/.+

.github/workflows/tests.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Tests
2+
on:
3+
push:
4+
paths-ignore:
5+
- .gitignore
6+
- LICENSE
7+
- README.md
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
check-pre-commit:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.13"
20+
- uses: pre-commit/action@v3.0.1
21+
22+
test-coverage:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-java@v4
27+
with:
28+
java-version: 17
29+
distribution: temurin
30+
- name: Build and test with Maven
31+
run: mvn -B verify -P coverage
32+
- name: Upload coverage report to Codecov
33+
uses: codecov/codecov-action@v5
34+
with:
35+
token: ${{ secrets.CODECOV_TOKEN }}
36+
37+
test-matrix:
38+
runs-on: ubuntu-latest
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
java: [17, 21]
43+
spring-boot: [3.0.13, 3.1.12, 3.2.12, 3.3.8, 3.4.3]
44+
steps:
45+
- uses: actions/checkout@v4
46+
- uses: actions/setup-java@v4
47+
with:
48+
java-version: ${{ matrix.java }}
49+
distribution: temurin
50+
- name: Build and test with Maven
51+
run: |
52+
mvn -B versions:set-property -Dproperty=spring-boot.version -DnewVersion=${{ matrix.spring-boot }} &&
53+
mvn -B verify

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
target/
2+
3+
# misc
4+
.DS_Store

.pre-commit-config.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
- id: end-of-file-fixer
6+
- id: trailing-whitespace
7+
- id: mixed-line-ending

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2023 Apitally
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
check:
2+
mvn clean compile
3+
4+
test:
5+
mvn clean test -P coverage

README.md

Lines changed: 107 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,107 @@
1-
# .NET-backend
1+
<p align="center">
2+
<a href="https://apitally.io" target="_blank">
3+
<picture>
4+
<source media="(prefers-color-scheme: dark)" srcset="https://assets.apitally.io/logos/logo-horizontal-new-dark.png">
5+
<source media="(prefers-color-scheme: light)" srcset="https://assets.apitally.io/logos/logo-horizontal-new-light.png">
6+
<img alt="Apitally logo" src="https://assets.apitally.io/logos/logo-vertical-light.png" width="220">
7+
</picture>
8+
</a>
9+
</p>
10+
<p align="center"><b>API monitoring & analytics made simple</b></p>
11+
<p align="center" style="color: #ccc;">Real-time metrics, request logs, and alerts for your APIs — with just a few lines of code.</p>
12+
<br>
13+
<img alt="Apitally screenshots" src="https://assets.apitally.io/screenshots/overview.png">
14+
<br>
15+
16+
# Apitally SDK for Java
17+
18+
[![Tests](https://github.com/apitally/apitally-java/actions/workflows/tests.yaml/badge.svg?event=push)](https://github.com/apitally/apitally-java/actions)
19+
[![Codecov](https://codecov.io/gh/apitally/apitally-java/graph/badge.svg?token=sV0D4JeWG6)](https://codecov.io/gh/apitally/apitally-java)
20+
21+
This SDK for Apitally currently supports the following Java web frameworks:
22+
23+
- [Spring Boot](https://docs.apitally.io/frameworks/spring-boot) (≥ 3.0, Java
24+
17+)
25+
26+
Learn more about Apitally on our 🌎 [website](https://apitally.io) or check out
27+
the 📚 [documentation](https://docs.apitally.io).
28+
29+
## Key features
30+
31+
### API analytics
32+
33+
Track traffic, error and performance metrics for your API, each endpoint and
34+
individual API consumers, allowing you to make informed, data-driven engineering
35+
and product decisions.
36+
37+
### Error tracking
38+
39+
Understand which validation rules in your endpoints cause client errors. Capture
40+
error details and stack traces for 500 error responses, and have them linked to
41+
Sentry issues automatically.
42+
43+
### Request logging
44+
45+
Drill down from insights to individual requests or use powerful filtering to
46+
understand how consumers have interacted with your API. Configure exactly what
47+
is included in the logs to meet your requirements.
48+
49+
### API monitoring & alerting
50+
51+
Get notified immediately if something isn't right using custom alerts, synthetic
52+
uptime checks and heartbeat monitoring. Notifications can be delivered via
53+
email, Slack or Microsoft Teams.
54+
55+
## Install
56+
57+
Add the following dependency to your `pom.xml` file:
58+
59+
```xml
60+
<dependency>
61+
<groupId>io.apitally</groupId>
62+
<artifactId>apitally</artifactId>
63+
<version>[0.1.0,)</version>
64+
</dependency>
65+
```
66+
67+
## Usage
68+
69+
Add Apitally to your Spring Boot application using the `@UseApitally`
70+
annotation.
71+
72+
```java
73+
import org.springframework.boot.SpringApplication;
74+
import org.springframework.boot.autoconfigure.SpringBootApplication;
75+
76+
import io.apitally.spring.UseApitally;
77+
78+
@UseApitally
79+
@SpringBootApplication
80+
public class Application {
81+
public static void main(String[] args) {
82+
SpringApplication.run(Application.class, args);
83+
}
84+
}
85+
```
86+
87+
Then add the following properties to your `application.yml` file:
88+
89+
```yaml
90+
apitally:
91+
client-id: "your-client-id"
92+
env: "dev" # or "prod" etc.
93+
```
94+
95+
For further instructions, see our
96+
[setup guide for Spring Boot](https://docs.apitally.io/frameworks/spring-boot).
97+
98+
## Getting help
99+
100+
If you need help please
101+
[create a new discussion](https://github.com/orgs/apitally/discussions/categories/q-a)
102+
on GitHub or
103+
[join our Slack workspace](https://join.slack.com/t/apitally-community/shared_invite/zt-2b3xxqhdu-9RMq2HyZbR79wtzNLoGHrg).
104+
105+
## License
106+
107+
This library is licensed under the terms of the MIT license.

0 commit comments

Comments
 (0)