Datadog Event Resource
Fetch or emit events to Datadog.
Source Configuration
-
application_key: Required. The application key to use when accessing Datadog. -
api_key: Required. The api key to use when accessing Datadog. -
filter: Optional. Regexp to filter events by title when checking.
Behavior
check: Listen for events in the event stream from the last 32 days.
Detects new events that have been published to the Datadog event stream within the last 32 days.
in: Fetch an event
Places the following files in the destination:
-
event.json: The event fetched, as JSON. Example:{ "date_happened": 1346449298, "id": 1378859526682864843, "priority": "normal", "tags": [ "environment:test" ], "text": "Oh boy!", "title": "Did you hear the news today?", "url": "https://app.datadoghq.com/event/jump_to?event_id=1378859526682864843" } -
version: The ID of the event fetched.
Parameters
None.
out: Emit an event to Datadog
Emits an event based on the static configuration defined in your parameters. Based on the Datadog API
Parameters
Required
title: The event title. Limited to 100 characters.
One of the following:
-
text: Static text for the body of the event. -
text_filePath to a file containing text for the body of the event. This allows the message to be generated by a previous task step in the Concourse job.
Limited to 4000 characters. The text supports markdown.
Optional
-
priority: The priority of the event ('normal' or 'low'). -
host: Host name to associate with the event. -
tags: A list of tags to apply to the event. -
alert_type: "error", "warning", "info" or "success". -
aggregation_key: An arbitrary string to use for aggregation, max length of 100 characters. If you specify a key, all events using that key will be grouped together in the Event Stream. -
source_type_name: The type of event being posted. Options: nagios, hudson, jenkins, user, my apps, feed, chef, puppet, git, bitbucket, fabric, capistrano
Example Configuration
Resource
resource_types:
- name: datadog-event
type: docker-image
source:
repository: concourse/datadog-event-resource
resources:
- name: datadog-event
type: datadog-event
source:
api_key: API-KEY
application_key: APPLICATION-KEY
filter: "event-.*-regexp"Plan
- get: datadog-event- put: datadog-event
params:
title: Did you hear the news today?
text: Oh boy!
priority: normal
tags:
- environment:test
alert_type: infoDevelopment
Prerequisites
- golang is required - version 1.12.x is tested; earlier versions may also work.
- docker is required - version 18.09.x is tested; earlier versions may also work.
Running the tests
The tests have been embedded with the Dockerfile; ensuring that the testing
environment is consistent across any docker enabled platform. When the docker
image builds, the test are run inside the docker container, on failure they
will stop the build.
Run the tests with the following commands for both alpine and ubuntu images:
docker build -t datadog-event-resource -f dockerfiles/alpine/Dockerfile .
docker build -t datadog-event-resource -f dockerfiles/ubuntu/Dockerfile .Contributing
Please make all pull requests to the master branch and ensure tests pass
locally.