Skip to content

Commit

Permalink
Add logs support to environments (#12849)
Browse files Browse the repository at this point in the history
  • Loading branch information
ofek authored Sep 15, 2022
1 parent be04343 commit b2f176c
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 5 deletions.
5 changes: 5 additions & 0 deletions boundary/assets/configuration/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,8 @@ files:
openmetrics_endpoint.value.example: http://localhost:9203/metrics
openmetrics_endpoint.description: |
The URL where Boundary exposes Prometheus metrics.
- template: logs
example:
- type: file
source: boundary
path: /var/log/boundary/events.ndjson
20 changes: 20 additions & 0 deletions boundary/datadog_checks/boundary/data/conf.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -623,3 +623,23 @@ 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
# source: boundary
# path: /var/log/boundary/events.ndjson
3 changes: 2 additions & 1 deletion boundary/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"Supported OS::Linux",
"Supported OS::Windows",
"Supported OS::macOS",
"Category::Configuration & Deployment"
"Category::Configuration & Deployment",
"Category::Log Collection"
]
},
"author": {
Expand Down
2 changes: 1 addition & 1 deletion boundary/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

@pytest.fixture(scope='session')
def dd_environment(instance):
with docker_run(common.COMPOSE_FILE, endpoints=[common.HEALTH_ENDPOINT, common.METRIC_ENDPOINT]):
with docker_run(common.COMPOSE_FILE, endpoints=[common.HEALTH_ENDPOINT, common.METRIC_ENDPOINT], mount_logs=True):
yield instance


Expand Down
20 changes: 17 additions & 3 deletions boundary/tests/docker/boundary.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,7 @@ listener "tcp" {
tls_disable = true
}

// Yoy can generate the keys by
// `python3 kyegen.py`
// Ref: https://www.boundaryproject.io/docs/configuration/kms/aead
// https://www.boundaryproject.io/docs/configuration/kms/aead
kms "aead" {
purpose = "root"
aead_type = "aes-gcm"
Expand All @@ -64,3 +62,19 @@ kms "aead" {
key = "8fZBjCUfN0TzjEGLQldGY4+iE9AkOvCfjh7+p0GtRBQ="
key_id = "global_recovery"
}

// https://www.boundaryproject.io/docs/configuration/events
events {
audit_enabled = true
observations_enabled = true
sysevents_enabled = true
sink {
name = "all-events"
event_types = ["*"]
format = "cloudevents-json"
file {
path = "/var/log/boundary"
file_name = "events.ndjson"
}
}
}
3 changes: 3 additions & 0 deletions boundary/tests/docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ services:
command: ["server", "-config", "/boundary/boundary.hcl"]
volumes:
- ./boundary.hcl:/boundary/boundary.hcl
- ${DD_LOG_1}:/var/log/boundary/events.ndjson
ports:
- "9200:9200"
- "9201:9201"
Expand All @@ -15,6 +16,8 @@ services:
environment:
- BOUNDARY_PG_URL=postgresql://postgres:postgres@db/boundary?sslmode=disable
- HOSTNAME=boundary
cap_add:
- IPC_LOCK
depends_on:
db-init:
condition: service_completed_successfully
Expand Down

0 comments on commit b2f176c

Please sign in to comment.