Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
382d5f7
draft files
derrickaw Jan 22, 2026
e1ba13f
currently works
derrickaw Jan 24, 2026
f8ef26a
initial test file
derrickaw Jan 27, 2026
a43a6d6
add more test cases
derrickaw Jan 28, 2026
0112eeb
add doc strings and slight code improvements
derrickaw Jan 28, 2026
e1f9e1a
adding more test cases and working out errorHandling
derrickaw Jan 29, 2026
266bc3b
works with one test failure
derrickaw Feb 2, 2026
d36e1d3
updated error handling logic and add more tests
derrickaw Feb 3, 2026
6ceede3
fix conflict with standard_io
derrickaw Apr 2, 2026
4634bc6
all tests pass - need to add write verification through Datadog agent…
derrickaw Feb 6, 2026
48ddf46
first draft of yaml test file
derrickaw Apr 2, 2026
aa4f4a9
some minor changes to schematransformer and write error schema; also …
derrickaw Apr 2, 2026
1ae1f82
working snapshot before simplification
derrickaw May 1, 2026
2b13101
combine errors
derrickaw May 2, 2026
8caaaf4
import constants
derrickaw May 2, 2026
e69213b
rollback DatadogIO cleanups
derrickaw May 2, 2026
17a15e1
rollback DatadogWriteError cleanups
derrickaw May 2, 2026
28aa96e
rollback SYNCHRONIZED_PROCESSING_TIME in timeutil.py
derrickaw May 2, 2026
20b8b2e
simplify expansion-service datadog dependency to runtimeOnly
derrickaw May 2, 2026
c788e8f
revert some previous cleanup operations
derrickaw May 2, 2026
77609a3
restore proper trailing newline to build.gradle
derrickaw May 2, 2026
f63db8c
fix lint issues
derrickaw May 2, 2026
a1daa18
run standard external transform script
derrickaw May 3, 2026
18a5f1d
fix gemini review comments
derrickaw May 3, 2026
1ec81d8
update logic for better performance
derrickaw May 3, 2026
60577bd
fix yaml row failure
derrickaw May 3, 2026
a61d32d
Trigger fresh CI/CD run
derrickaw May 3, 2026
8674ebf
update coder
derrickaw May 3, 2026
b028533
old design parts
derrickaw May 3, 2026
7517397
revert datadogio coder change and try to cover in integration_tests
derrickaw May 4, 2026
8d42334
fix coder
derrickaw May 4, 2026
4b47336
fix lint
derrickaw May 4, 2026
987287b
address more geminic comments
derrickaw May 4, 2026
6a714f3
fix error output
derrickaw May 4, 2026
c16aa62
fix another gemini review
derrickaw May 5, 2026
1f56bca
remove some dead code
derrickaw May 5, 2026
868eba6
fix spotless
derrickaw May 5, 2026
d9a4c56
revert venv
derrickaw May 5, 2026
c943fdc
address comments
derrickaw May 8, 2026
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
/*
* 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.
*/
package org.apache.beam.sdk.io.datadog;

import static org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Preconditions.checkArgument;

import com.google.auto.value.AutoValue;
import javax.annotation.Nullable;
import org.apache.beam.sdk.schemas.AutoValueSchema;
import org.apache.beam.sdk.schemas.annotations.DefaultSchema;
import org.apache.beam.sdk.schemas.annotations.SchemaFieldDescription;
import org.apache.beam.sdk.schemas.transforms.providers.ErrorHandling;
import org.apache.beam.vendor.guava.v32_1_2_jre.com.google.common.base.Strings;

/**
* Configuration for writing to Datadog.
*
* <p>This class is meant to be used with {@link DatadogWriteSchemaTransformProvider}.
*/
@DefaultSchema(AutoValueSchema.class)
@AutoValue
public abstract class DatadogWriteSchemaTransformConfiguration {

public void validate() {
String invalidConfigMessage = "Invalid Datadog Write configuration: ";
checkArgument(!getUrl().isEmpty(), invalidConfigMessage + "url must be specified.");
checkArgument(!getApiKey().isEmpty(), invalidConfigMessage + "apiKey must be specified.");
Integer batchCount = getBatchCount();
if (batchCount != null) {
checkArgument(batchCount > 0, invalidConfigMessage + "batchCount must be greater than 0.");
}
Integer minBatchCount = getMinBatchCount();
if (minBatchCount != null) {
checkArgument(
minBatchCount > 0, invalidConfigMessage + "minBatchCount must be greater than 0.");
}
Long maxBufferSize = getMaxBufferSize();
if (maxBufferSize != null) {
checkArgument(
maxBufferSize > 0, invalidConfigMessage + "maxBufferSize must be greater than 0.");
}
Integer parallelism = getParallelism();
if (parallelism != null) {
checkArgument(parallelism > 0, invalidConfigMessage + "parallelism must be greater than 0.");
}
ErrorHandling errorHandling = getErrorHandling();
if (errorHandling != null) {
checkArgument(
!Strings.isNullOrEmpty(errorHandling.getOutput()),
invalidConfigMessage + "Output must not be empty if error handling specified.");
}
}
Comment thread
derrickaw marked this conversation as resolved.

/** Instantiates a {@link DatadogWriteSchemaTransformConfiguration.Builder} instance. */
public static DatadogWriteSchemaTransformConfiguration.Builder builder() {
return new AutoValue_DatadogWriteSchemaTransformConfiguration.Builder();
}

@SchemaFieldDescription("The Datadog API URL.")
public abstract String getUrl();

@SchemaFieldDescription("The Datadog API key.")
public abstract String getApiKey();

@SchemaFieldDescription("The minimum number of events to batch together for each write.")
public abstract @Nullable Integer getMinBatchCount();

@SchemaFieldDescription("The number of events to batch together for each write.")
public abstract @Nullable Integer getBatchCount();

@SchemaFieldDescription("The maximum buffer size in bytes.")
public abstract @Nullable Long getMaxBufferSize();

@SchemaFieldDescription("The degree of parallelism for writing.")
public abstract @Nullable Integer getParallelism();

@SchemaFieldDescription("Specifies how to handle errors.")
public abstract @Nullable ErrorHandling getErrorHandling();

@AutoValue.Builder
public abstract static class Builder {
public abstract Builder setUrl(String url);

public abstract Builder setApiKey(String apiKey);

public abstract Builder setMinBatchCount(Integer minBatchCount);

public abstract Builder setBatchCount(Integer batchCount);

public abstract Builder setMaxBufferSize(Long maxBufferSize);

public abstract Builder setParallelism(Integer parallelism);

public abstract Builder setErrorHandling(@Nullable ErrorHandling errorHandling);

/** Builds the {@link DatadogWriteSchemaTransformConfiguration} configuration. */
public abstract DatadogWriteSchemaTransformConfiguration build();
}
}
Loading
Loading