Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logs for Quarkus #19293

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions quarkus/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ files:
openmetrics_endpoint.value.example: http://localhost:8080/q/metrics
openmetrics_endpoint.description: |
Set this to the endpoint that Quarkus's Micrometer Prometheus MeterRegistry extension exposes.
- template: logs
example:
- type: file
path: /var/log/application.log
source: quarkus
service: quarkus-app
39 changes: 39 additions & 0 deletions quarkus/assets/logs/quarkus.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
id: quarkus
metric_id: quarkus
backend_only: false
facets:
pipeline:
type: pipeline
name: 'Quarkus'
enabled: true
filter:
query: source:quarkus
processors:
- type: grok-parser
name: Parse fields such as timestamp and level
enabled: true
source: message
samples:
- "2024-12-12 12:57:36,184 INFO [io.quarkus] (Quarkus Main Thread) code-with-quarkus 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.17.4) started in 0.378s. Listening on: http://localhost:8080"
- "2024-12-12 12:57:36,186 INFO [io.quarkus] (Quarkus Main Thread) Installed features: [cdi, rest, smallrye-context-propagation, vertx]"
- "2024-12-12 12:57:36,186 INFO [io.qua.dep.dev.RuntimeUpdatesProcessor] (vert.x-worker-thread-1) Live reload total time: 0.397s"
- "2024-12-13 11:05:38,618 INFO [org.acm.GreetingResource] (executor-thread-1) Custom log message"
grok:
matchRules: |
quarkus %{date("yyyy-MM-dd HH:mm:ss,SSS"):timestamp}\s+%{word:level}\s+\[%{notSpace:logger}\]\s+\(%{data:thread}\)\s+%{data:message}
supportRules: ''
- type: message-remapper
name: Define `message` as the official message of the log
enabled: true
sources:
- message
- type: date-remapper
name: Define `timestamp` as the official date of the log
enabled: true
sources:
- timestamp
- type: status-remapper
name: Define `level` as the official status of the log
enabled: true
sources:
- level
28 changes: 28 additions & 0 deletions quarkus/assets/logs/quarkus_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
id: "quarkus"
tests:
- sample: |-
2024-12-12 12:57:36,184 INFO [io.quarkus] (Quarkus Main Thread) code-with-quarkus 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.17.4) started in 0.378s. Listening on: http://localhost:8080
result:
custom:
timestamp: 1734008256184
level: "INFO"
logger: "io.quarkus"
thread: "Quarkus Main Thread"
message: "code-with-quarkus 1.0.0-SNAPSHOT on JVM (powered by Quarkus 3.17.4) started in 0.378s. Listening on: http://localhost:8080"
status: "info"
tags:
- "source:LOGS_SOURCE"
timestamp: 1734008256184
- sample: |-
2024-12-13 11:05:38,618 ERROR [org.acm.GreetingResource] (executor-thread-1) Custom log message
result:
custom:
timestamp: 1734087938618
level: "ERROR"
logger: "org.acm.GreetingResource"
thread: "executor-thread-1"
message: "Custom log message"
status: "error"
tags:
- "source:LOGS_SOURCE"
timestamp: 1734087938618
20 changes: 20 additions & 0 deletions quarkus/assets/saved_views/errors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "Quarkus Error Overview",
"options": {
"columns": [
"host",
"service"
],
"message_display": "inline",
"show_date_column": true,
"show_message_column": true,
"show_timeline": true
},
"page": "stream",
"query": "source:quarkus status:error",
"timerange": {
"interval_ms": 900000
},
"type": "logs",
"visible_facets": []
}
21 changes: 21 additions & 0 deletions quarkus/datadog_checks/quarkus/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -591,3 +591,24 @@ instances:
# - <INCLUDE_REGEX>
# exclude:
# - <EXCLUDE_REGEX>

## Log Section
##
## type - required - Type of log input source (tcp / udp / file / windows_event).
## port / path / channel_path - required - Set port if type is tcp or udp.
## Set path if type is file.
## Set channel_path if type is windows_event.
## source - required - Attribute that defines which integration sent the logs.
## encoding - optional - For file specifies the file encoding. Default is utf-8. Other
## possible values are utf-16-le and utf-16-be.
## service - optional - The name of the service that generates the log.
## Overrides any `service` defined in the `init_config` section.
## tags - optional - Add tags to the collected logs.
##
## Discover Datadog log collection: https://docs.datadoghq.com/logs/log_collection/
#
# logs:
# - type: file
# path: /var/log/application.log
# source: quarkus
# service: quarkus-app
4 changes: 4 additions & 0 deletions quarkus/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"Supported OS::Windows",
"Supported OS::macOS",
"Category::Metrics",
"Category::Log Collection",
"Offering::Integration",
"Queried Data Type::Metrics",
"Submitted Data Type::Metrics"
Expand Down Expand Up @@ -47,6 +48,9 @@
"dashboards": {
"Quarkus Overview": "assets/dashboards/overview.json"
},
"saved_views": {
"errors": "assets/saved_views/errors.json"
},
"monitors": {
"Long Requests": "assets/monitors/long_requests.json"
}
Expand Down
Loading