Skip to content

Commit

Permalink
Merge branch 'release/2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Marthym committed Dec 2, 2023
2 parents 37283a6 + 5795fba commit 7c3be2e
Show file tree
Hide file tree
Showing 565 changed files with 28,497 additions and 7,618 deletions.
414 changes: 414 additions & 0 deletions .compose/grafana/provisioning/dashboards/baywatch_dashboard.json

Large diffs are not rendered by default.

4,126 changes: 4,126 additions & 0 deletions .compose/grafana/provisioning/dashboards/spring-dashboard.json

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions .compose/grafana/provisioning/datasources/datasource.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# config file version
apiVersion: 1

# list of datasources that should be deleted from the database
#deleteDatasources:
# - name: Prometheus
# orgId: 1
# - name: Loki
# orgId: 1

# list of datasources to insert/update depending
# whats available in the database
datasources:

- name: Prometheus
type: prometheus
# <string, required> access mode. direct or proxy. Required
access: proxy
url: http://prometheus:9090
basicAuth: false
isDefault: true
jsonData:
graphiteVersion: "1.1"
tlsAuth: false
tlsAuthWithCACert: false
# <string> json object of data that will be encrypted.
version: 1
editable: false

- name: Loki
type: loki
access: proxy
url: http://loki:3100
jsonData:
maxLines: 1000
editable: false
47 changes: 47 additions & 0 deletions .compose/loki/local-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
auth_enabled: false

server:
http_listen_port: ${LOKI_LISTEN_PORT:-3100}

common:
path_prefix: /loki
storage:
filesystem:
chunks_directory: /loki/chunks
rules_directory: /loki/rules
replication_factor: 1
ring:
kvstore:
store: inmemory

compactor:
retention_enabled: true

limits_config:
retention_period: ${LOKI_RETENTION_PERIOD:-30d}

schema_config:
configs:
- from: 2020-10-24
store: boltdb-shipper
object_store: filesystem
schema: v11
index:
prefix: index_
period: 24h

ruler:
alertmanager_url: http://localhost:9093

# By default, Loki will send anonymous, but uniquely-identifiable usage and configuration
# analytics to Grafana Labs. These statistics are sent to https://stats.grafana.org/
#
# Statistics help us better understand how Loki is used, and they show us performance
# levels for most users. This helps us prioritize features and documentation.
# For more information on what's sent, look at
# https://github.com/grafana/loki/blob/main/pkg/usagestats/stats.go
# Refer to the buildReport method to see what goes into a report.
#
# If you would like to disable reporting, uncomment the following lines:
#analytics:
# reporting_enabled: false
5 changes: 5 additions & 0 deletions .compose/opentelemetry/exporter_logging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---

exporters:
logging:
verbosity: detailed
5 changes: 5 additions & 0 deletions .compose/opentelemetry/exporter_loki.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---

exporters:
loki:
endpoint: 'http://loki:3100/loki/api/v1/push'
7 changes: 7 additions & 0 deletions .compose/opentelemetry/exporter_prometheus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---

exporters:
prometheus:
endpoint: 'opentelemetry:9091'
send_timestamps: true
enable_open_metrics: true
8 changes: 8 additions & 0 deletions .compose/opentelemetry/processor_attributes.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---

processors:
attributes:
actions:
- action: insert
key: loki.resource.labels
value: 'application, container_id, container_name, container_image'
7 changes: 7 additions & 0 deletions .compose/opentelemetry/processor_batch.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---

processors:
batch:
send_batch_size: 10000
send_batch_max_size: 11000
timeout: 10s
83 changes: 83 additions & 0 deletions .compose/opentelemetry/receiver_filelog_container.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---

receivers:
filelog/containers:
include: ["/var/lib/docker/containers/*/*.log"]
exclude: ["/var/lib/docker/containers/32a*"]
start_at: end
include_file_path: false
include_file_name: false
operators:
- type: json_parser
id: parser-docker
output: filter_non_tagged_containers
timestamp:
parse_from: attributes.time
layout: '%Y-%m-%dT%H:%M:%S.%LZ'
- type: filter
id: filter_non_tagged_containers
expr: '(attributes?.attrs?.tag ?? "empty") == "empty"'
output: extract_metadata_from_tag
- type: key_value_parser
id: extract_metadata_from_tag
parse_from: attributes["attrs"]["tag"]
parse_to: resource.container
on_error: drop
output: mv_container_id
- type: move
id: mv_container_id
from: resource.container.id
to: resource.container_id
output: mv_container_name
- type: move
id: mv_container_name
from: resource.container.name
to: resource.container_name
output: mv_container_image
- type: move
id: mv_container_image
from: resource.container.image
to: resource.container_image
output: parse_body
- type: move
id: parse_body
from: attributes.log
to: body
output: move_app
- type: move
id: move_app
from: attributes["attrs"]["application"]
to: resource.application
output: app-json-parse
- type: json_parser
id: app-json-parse
output: app-move-body
timestamp:
parse_from: attributes.timestamp
layout: '%Y-%m-%dT%H:%M:%S.%LZ'
severity:
parse_from: attributes.level
mapping:
warn: WARN
error: ERROR
info: INFO
debug: DEBUG
- type: move
id: app-move-body
from: attributes.message
to: body
- type: remove
id: remove_time
field: attributes.time
- type: remove
id: remove_stream
field: attributes.stream
- type: remove
id: remove_timestamp
field: attributes["timestamp"]
- type: remove
id: remove_level
field: attributes["level"]
- type: remove
id: remove_attrs
field: attributes["attrs"]
16 changes: 16 additions & 0 deletions .compose/opentelemetry/receiver_prometheus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---

receivers:
prometheus:
config:
scrape_configs:
- job_name: 'otel-collector'
scrape_interval: 5s
metrics_path: '/actuator/prometheus'
basic_auth:
username: "prometheus"
password: "uzpUAANKgZXxbdk19AjfWmknKfGbP2wKzAAMCpHm"
static_configs:
- targets: [baywatch:8081]
labels:
platform: 'devel'
12 changes: 12 additions & 0 deletions .compose/opentelemetry/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---

service:
pipelines:
logs:
receivers: [filelog/containers]
processors: [attributes, batch]
exporters: [logging, loki]
metrics:
receivers: [prometheus]
processors: [batch]
exporters: [prometheus]
41 changes: 41 additions & 0 deletions .compose/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---

global:
scrape_interval: 15s # By default, scrape targets every 15 seconds.
evaluation_interval: 15s # By default, scrape targets every 15 seconds.
# scrape_timeout is set to the global default (10s).

# Attach these labels to any time series or alerts when communicating with
# external systems (federation, remote storage, Alertmanager).
external_labels:
monitor: 'baywatch'

# Load and evaluate rules in this file every 'evaluation_interval' seconds.
#rule_files:
# - 'alert.rules'
# - "first.rules"
# - "second.rules"

# alert
#alerting:
# alertmanagers:
# - scheme: http
# static_configs:
# - targets:
# - "alertmanager:9093"

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:

- job_name: 'prometheus'
# Override the global default and scrape targets from this job every 5 seconds.
scrape_interval: 15s
static_configs:
- targets: ['localhost:9090']

- job_name: 'otel-exporter'
scrape_interval: 15s
static_configs:
- targets:
- 'opentelemetry:9091'
Binary file added .docs/baywatch-capture-01.webp
Binary file not shown.
Binary file added .docs/github-social.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
37 changes: 37 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: SonarCloud
on:
push:
branches:
- master
- develop
- 'feature/**'
pull_request:
types: [opened, synchronize, reopened]

permissions:
pull-requests: read

jobs:
build:
name: analyse
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 21
uses: actions/setup-java@v3.13.0
with:
java-version: 21
distribution: 'temurin'
- name: Cache Maven packages
uses: actions/cache@v3.3.2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Psonar
10 changes: 8 additions & 2 deletions .run/BaywatchApplication.run.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="BaywatchApplication" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
<option name="ACTIVE_PROFILES" />
<envs>
<env name="BAYWATCH_GRAPHIQL_ENABLE" value="true" />
<env name="BAYWATCH_GRAPHQL_INTROSPECTION" value="true" />
<env name="BAYWATCH_HOME" value="$USER_HOME$" />
<env name="BAYWATCH_IMGPROXY_ENABLE" value="false" />
<env name="BAYWATCH_INDEXER_ENABLE" value="true" />
<env name="BAYWATCH_SCRAPER_ENABLE" value="true" />
<env name="SPRING_THREADS_VIRTUAL_ENABLED" value="true" />
<env name="CONSOLE_LOG_PATTERN" value="%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd'T'HH:mm:ss.SSSXXX}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(---){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}" />
</envs>
<module name="sandside" />
<module name="assembly" />
<option name="SPRING_BOOT_MAIN_CLASS" value="fr.ght1pc9kc.baywatch.BaywatchApplication" />
<option name="VM_PARAMETERS" value="-Dio.netty.leakDetection.level=paranoid" />
<extension name="coverage">
Expand Down
Loading

0 comments on commit 7c3be2e

Please sign in to comment.