Fetch or emit events to Datadog.
-
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. -
datadog_host
: Optional. Datadog host url to switch from US to Europe datacenter, default to US.
Detects new events that have been published to the Datadog event stream within the last 32 days.
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.
None.
Emits an event based on the static configuration defined in your parameters. Based on the Datadog API
Required
title
: The event title. Limited to 100 characters.
One of the following:
-
text
: Static text for the body of the event. Environment variables can be used here to show the build metadata. Please refer to the Concourse documentation for a list of allowed variables. -
text_file
Path 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
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"
- get: datadog-event
- put: datadog-event
params:
title: Did you hear the news today?
text: Oh boy!
priority: normal
tags:
- environment:test
alert_type: info
- 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.
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 command:
docker build -t datadog-event-resource --build-arg base_image=concourse/resource-types-base-image-static .
Please make all pull requests to the master
branch and ensure tests pass
locally.
Unless you are planning on using datadog events for triggering jobs, make sure to disable automatic resource checking, like so:
resources:
- name: datadog-event
type: datadog-event
check_every: never
source:
api_key: API-KEY
application_key: APPLICATION-KEY
And in case you do plan on using datadog events to trigger jobs, make sure you're using event filtering:
resources:
- name: datadog-event
type: datadog-event
source:
api_key: API-KEY
application_key: APPLICATION-KEY
filter: "event-.*-regexp"
Otherwise you're running a risk of bloating the concourse database if the volume of events going through datadog is high enough.