Skip to content
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
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ com-squareup-javapoet = "com.squareup:javapoet:1.13.0"
commons-validator = "commons-validator:commons-validator:1.9.0"
io-swagger-core-v3-swagger-annotations = "io.swagger.core.v3:swagger-annotations:2.2.26"
io-swagger-parser-v3-swagger-parser = "io.swagger.parser.v3:swagger-parser:2.1.24"
loki-logback-appender = "com.github.loki4j:loki-logback-appender:1.5.2"
org-apache-activemq-artemis-jakarta-server = "org.apache.activemq:artemis-jakarta-server:2.38.0"
org-apache-poi-poi-ooxml = "org.apache.poi:poi-ooxml:5.3.0"
org-eclipse-jgit-org-eclipse-jgit = "org.eclipse.jgit:org.eclipse.jgit:7.0.0.202409031743-r"
Expand Down
1 change: 1 addition & 0 deletions server/apps/server-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ dependencies {
implementation("io.awspring.cloud:spring-cloud-aws-starter-secrets-manager")
implementation("io.awspring.cloud:spring-cloud-aws-starter-sqs")
implementation("io.micrometer:micrometer-registry-prometheus")
implementation(libs.loki.logback.appender)
implementation(libs.org.springdoc.springdoc.openapi.starter.common)
implementation("org.springframework.ai:spring-ai-openai-spring-boot-starter:${rootProject.libs.versions.spring.ai.get()}")
implementation("org.springframework.ai:spring-ai-pgvector-store-spring-boot-starter:${rootProject.libs.versions.spring.ai.get()}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ logging:
level:
ROOT: INFO
com.bytechef: DEBUG
config: "classpath:logback-spring-dev.xml"

server:
port: 9555
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ logging:
level:
ROOT: INFO
com.bytechef: INFO
config: "classpath:logback-spring-prod.xml"

management:
prometheus:
Expand Down
7 changes: 7 additions & 0 deletions server/docker/grafana/grafana.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[users]
default_theme = light

[smtp]
enabled = true
host = host.docker.internal:25
skip_verify = true
10 changes: 10 additions & 0 deletions server/docker/grafana/provisioning/dashboards/dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
apiVersion: 1

providers:
- name: dashboards
type: file
disableDeletion: true
editable: true
options:
path: /etc/grafana/provisioning/dashboards
foldersFromFilesStructure: true
102 changes: 102 additions & 0 deletions server/docker/grafana/provisioning/dashboards/logs_traces_metrics.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "grafana",
"uid": "-- Grafana --"
},
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"target": {
"limit": 100,
"matchAny": false,
"tags": [],
"type": "dashboard"
},
"type": "dashboard"
}
]
},
"editable": true,
"fiscalYearStartMonth": 0,
"graphTooltip": 0,
"id": 3,
"links": [],
"liveNow": false,
"panels": [
{
"datasource": {
"type": "loki",
"uid": "loki"
},
"description": "",
"gridPos": {
"h": 10,
"w": 23,
"x": 0,
"y": 0
},
"id": 2,
"options": {
"dedupStrategy": "none",
"enableLogDetails": true,
"prettifyLogMessage": true,
"showCommonLabels": true,
"showLabels": true,
"showTime": true,
"sortOrder": "Ascending",
"wrapLogMessage": true
},
"targets": [
{
"datasource": {
"type": "loki",
"uid": "loki"
},
"editorMode": "builder",
"expr": "{app=~\".+\"} |= `$traceId`",
"queryType": "range",
"refId": "A"
}
],
"title": "Logs with trace ID $traceId",
"type": "logs"
}
],
"schemaVersion": 1,
"tags": [],
"templating": {
"list": [
{
"current": {
"selected": false
},
"description": "Trace Id",
"hide": 0,
"includeAll": false,
"label": "Trace ID",
"multi": false,
"name": "traceId",
"options": [],
"query": "",
"queryValue": "",
"skipUrlSync": false,
"type": "custom"
}
]
},
"time": {
"from": "now-15m",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Logs",
"uid": "edz2d9w1so8aoa",
"version": 1,
"weekStart": ""
}
41 changes: 41 additions & 0 deletions server/docker/loki/loki-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
auth_enabled: false

server:
http_listen_port: 3100

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

schema_config:
configs:
- from: 2024-12-01
store: tsdb
object_store: filesystem
schema: v13
index:
prefix: index_
period: 24h


limits_config:
max_global_streams_per_user: 0
max_cache_freshness_per_query: '10m'
# reject_old_samples: true
# reject_old_samples_max_age: 90m
ingestion_rate_mb: 20
ingestion_burst_size_mb: 40
# parallelize queries in 15min intervals
# split_queries_by_interval: 15m
# volume_enabled: true

#ruler:
# alertmanager_url: http://localhost:9093
24 changes: 24 additions & 0 deletions server/docker/monitoring.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,27 @@ services:
- --config.file=/etc/prometheus/prometheus-${profile:-dev}.yml
ports:
- 9090:9090

loki:
image: grafana/loki:3.2.2
extra_hosts: [ 'host.docker.internal:host-gateway' ]
volumes:
- ./loki/:/etc/loki/
command:
- --config.file=/etc/loki/loki-${profile:-dev}.yml
ports:
- 3100:3100

grafana:
image: grafana/grafana:11.4.0
extra_hosts: [ 'host.docker.internal:host-gateway' ]
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_DISABLE_LOGIN_FORM=true
volumes:
- ./grafana/grafana.ini:/etc/grafana/grafana.ini
- ./grafana/provisioning/datasources:/etc/grafana/provisioning/datasources
- ./grafana/provisioning/dashboards:/etc/grafana/provisioning/dashboards
ports:
- 3000:3000
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration>

<configuration scan="true">
<include resource="logback-spring.xml"/>

<springProperty name="applicationName" source="spring.application.name"/>

<appender name="LOKI" class="com.github.loki4j.logback.Loki4jAppender">
<http>
<url>http://localhost:3100/loki/api/v1/push</url>
</http>
<format>
<label>
<pattern>app=${applicationName},host=${HOSTNAME},traceID=%X{traceId:-NONE},level=%level</pattern>
</label>
<message>
<pattern>${FILE_LOG_PATTERN}</pattern>
</message>
<sortByTime>true</sortByTime>
</format>
</appender>

<root level="${log.level}">
<appender-ref ref="CONSOLE" />
<appender-ref ref="LOKI" />
</root>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE configuration>

<configuration scan="true">
<include resource="logback-spring.xml"/>

<root level="${log.level}">
<appender-ref ref="CONSOLE" />
</root>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<conversionRule conversionWord="crlf" converterClass="com.bytechef.logback.config.CRLFLogConverter" />
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd'T'HH:mm:ss.SSSXXX}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %crlf(%m){red} %n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!-- The FILE and ASYNC appenders are here as examples for a production configuration -->
<!--
<property name="FILE_LOG_PATTERN" value="${FILE_LOG_PATTERN:-%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd'T'HH:mm:ss.SSSXXX}} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } &#45;&#45;&#45; [%t] %-40.40logger{39} : %crlf(%m) %n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
-->

<springProperty name="log.level" source="logging.level.root" defaultValue="INFO" />

<include resource="org/springframework/boot/logging/logback/defaults.xml"/>
<include resource="org/springframework/boot/logging/logback/console-appender.xml" />
Expand Down Expand Up @@ -61,12 +61,6 @@
<logger name="liquibase" level="WARN"/>
<logger name="LiquibaseSchemaResolver" level="INFO"/>

<springProperty name="log.level" source="logging.level.root" defaultValue="INFO" />

<root level="${log.level}">
<appender-ref ref="CONSOLE" />
</root>

<contextListener class="ch.qos.logback.classic.jul.LevelChangePropagator">
<resetJUL>true</resetJUL>
</contextListener>
Expand Down
Loading