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 demo for shipping Vector internal logs/metrics to Datadog #7

Merged
merged 5 commits into from
Sep 2, 2021
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
2 changes: 1 addition & 1 deletion datadog-agent/vector/vector.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ codec = "json"
timestamp_format = "rfc3339"

[sinks.datadog.healthcheck]
enabled = true
enabled = true
19 changes: 19 additions & 0 deletions datadog-observability/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Send Vector logs and metrics to Datadog

In this demo, Vector is running a simple topology in which the `generator` source emits random JSON
logs twice per second and sends those logs off to stdout via the `console` sink. But even this
simple pipeline is enough to generate internal logs and metrics for Vector (via the eponymous
sources).

To run this scenario, make sure you have the `DD_API_KEY` environment variable set to your Datadog
API key and then run:

```bash
docker compose up --detach
```

Once Vector is up and running, check out the [Logs exporer][logs] and this simple
[Metrics dashboard][metrics].

[logs]: https://app.datadoghq.com/logs?query=%40tag%3Avector_internal
[metrics]: https://app.datadoghq.com/metric/explorer?live=true&tile_size=m&exp_metric=vector.events_in_total&exp_agg=avg&exp_row_type=metric
11 changes: 11 additions & 0 deletions datadog-observability/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: '3.9'
services:
vector:
image: timberio/vector:0.16.1-alpine
ports:
- 8686:8686
environment:
- DD_API_KEY
- LOG=info
volumes:
- ./vector:/etc/vector:ro
49 changes: 49 additions & 0 deletions datadog-observability/vector/vector.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[api]
enabled = true
address = "0.0.0.0:8686"
playground = true

[sources.generator]
type = "generator"
format = "json"
interval = 0.5

[sinks.stdout]
type = "console"
inputs = ["generator"]
target = "stdout"

[sinks.stdout.encoding]
codec = "json"

[sources.vector_logs]
type = "internal_logs"

[sources.vector_metrics]
type = "internal_metrics"

[transforms.tag_vector_logs]
type = "remap"
inputs = ["vector_logs"]
source = '''
.tag = "vector_internal"
'''

[sinks.datadog_logs]
type = "datadog_logs"
inputs = ["tag_vector_logs"]
default_api_key = "${DD_API_KEY}"

[sinks.datadog_logs.healthcheck]
enabled = true

[sinks.datadog_logs.encoding]
codec = "json"

[sinks.datadog_metrics]
type = "datadog_metrics"
inputs = ["vector_metrics"]
api_key = "${DD_API_KEY}"

[sinks.datadog_metrics.healthcheck]
enabled = true