blob: 24485bfbaf4d7877b34e88cb82f283a5fbcc79be [file]
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
fixtures:
- name: FAKE_DATADOG_SERVER
type: "apache_beam.yaml.test_utils.datadog_test_utils.temp_fake_datadog_server"
config:
expected_records:
- { ddsource: "apache-beam1", ddtags: "test-tags1", hostname: "test-host", service: "test-service", message: "Event for label 11a" }
- { ddsource: "apache-beam2", ddtags: "test-tags2", hostname: "test-host", service: "test-service", message: "Event for label 37a" }
- { ddsource: "apache-beam3", ddtags: "test-tags3", hostname: "test-host", service: "test-service", message: "Event for label 389a" }
- { ddsource: "apache-beam4", ddtags: "test-tags4", hostname: "test-host", service: "test-service", message: "Event for label 3821b" }
pipelines:
- pipeline:
type: composite
transforms:
- type: Create
config:
elements:
- { ddsource: "apache-beam1", ddtags: "test-tags1", hostname: "test-host", service: "test-service", message: "Event for label 11a" }
- { ddsource: "apache-beam2", ddtags: "test-tags2", hostname: "test-host", service: "test-service", message: "Event for label 37a" }
- { ddsource: "apache-beam3", ddtags: "test-tags3", hostname: "test-host", service: "test-service", message: "Event for label 389a" }
- { ddsource: "apache-beam4", ddtags: "test-tags4", hostname: "test-host", service: "test-service", message: "Event for label 3821b" }
- { ddsource: "apache-beam-broken", hostname: "test-host" } # Triggers mandatory field failure
- type: WriteToDatadog
input: Create
config:
url: "{FAKE_DATADOG_SERVER.url}"
api_key: "{FAKE_DATADOG_SERVER.api_key}"
min_batch_count: 1
batch_count: 2
max_buffer_size: 1000
parallelism: 1
error_handling:
output: error_output
- type: MapToFields
input: WriteToDatadog.error_output
config:
language: python
fields:
failed_source: "failed_row.ddsource"
- type: AssertEqual
input: MapToFields
config:
elements:
- { failed_source: "apache-beam-broken" }
# Asserting good records is taken care of by the fixture