Skip to content
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
12 changes: 5 additions & 7 deletions .github/workflows/flaky-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,16 @@ jobs:
repo: core

# Options
# Because -m starts with a dash,
# click (the library used to build the CLI) will
# Because -m starts with a dash,
# click (the library used to build the CLI) will
# interpret it as an option, not as an argument.
# To avoid this, using -- syntax,
# which tells the command that everything following it
# To avoid this, using -- syntax,
# which tells the command that everything following it
# should be treated as positional arguments, not options
pytest-args: '-m flaky'
secrets: inherit

permissions:
# needed for codecov in test-target.yml, allows the action to get a JWT signed by Github
id-token: write
# needed for compute-matrix in test-target.yml
contents: read

Expand All @@ -45,7 +43,7 @@ jobs:
checks: write # Needed for test-results-master
contents: write # Needed for test-results-master
pull-requests: write # Needed for test-results-master

uses: ./.github/workflows/test-results-master.yml
secrets: inherit

Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,21 @@ jobs:
repo: core

# Options
# Because -m starts with a dash,
# click (the library used to build the CLI) will
# Because -m starts with a dash,
# click (the library used to build the CLI) will
# interpret it as an option, not as an argument.
# To avoid this, using -- syntax,
# which tells the command that everything following it
# To avoid this, using -- syntax,
# which tells the command that everything following it
# should be treated as positional arguments, not options
pytest-args: '-m "not flaky"'
secrets: inherit

permissions:
# needed for codecov in test-target.yml, allows the action to get a JWT signed by Github
id-token: write
# needed for compute-matrix in test-target.yml
contents: read

publish-test-results:

needs:
- test

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/nightly-base-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
uses: ./.github/workflows/test-all.yml

permissions:
# needed for codecov in test-target.yml, allows the action to get a JWT signed by Github
id-token: write
# needed for compute-matrix in test-target.yml
contents: read

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/pr-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
uses: ./.github/workflows/test-all.yml

permissions:
# needed for codecov in test-target.yml, allows the action to get a JWT signed by Github
id-token: write
# needed for compute-matrix in test-target.yml
contents: read

Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,5 @@ jobs:
secrets: inherit

permissions:
# needed for codecov in test-target.yml, allows the action to get a JWT signed by Github
id-token: write
# needed for compute-matrix in test-target.yml
contents: read
2 changes: 0 additions & 2 deletions .github/workflows/test-agent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ jobs:
skip-ddev-tests: true
secrets: inherit
permissions:
# needed for codecov in test-target.yml, allows the action to get a JWT signed by Github
id-token: write
# needed for compute-matrix in test-target.yml
contents: read

Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/test-fips-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ jobs:
TRACE_CAPTURE_LOG: "trace-captures/output.log"

permissions:
# needed for codecov in test-target.yml, allows the action to get a JWT signed by Github
id-token: write
# needed for compute-matrix in test-target.yml
contents: read

Expand Down Expand Up @@ -151,12 +149,3 @@ jobs:
name: "test-results-${{ inputs.target || 'tls' }}"
path: "${{ env.TEST_RESULTS_BASE_DIR }}"

- name: Upload coverage data
if: >
!github.event.repository.private &&
always()
uses: codecov/codecov-action@15559ed290fa727036809b67ab0f646ffa6c5158
with:
use_oidc: true
files: "${{ inputs.target || 'tls' }}/coverage.xml"
flags: "${{ inputs.target || 'tls' }}"
16 changes: 1 addition & 15 deletions .github/workflows/test-target.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
description: "Specific target env to run"
required: false
default: ""
type: string
type: string
platform:
required: true
type: string
Expand Down Expand Up @@ -114,8 +114,6 @@ jobs:
TRACE_CAPTURE_LOG: "trace-captures/output.log"

permissions:
# needed for codecov in test-target.yml, allows the action to get a JWT signed by Github
id-token: write
# needed for compute-matrix in test-target.yml
contents: read
steps:
Expand Down Expand Up @@ -413,15 +411,3 @@ jobs:
with:
name: "test-results-${{ inputs.target }}${{ inputs.target-env && format('-{0}', inputs.target-env) || '' }}-${{ inputs.platform }}"
path: "${{ env.TEST_RESULTS_BASE_DIR }}"

- name: Upload coverage data
if: >
!github.event.repository.private &&
always() &&
inputs.pytest-args != '-m flaky'
# Flaky tests will have low coverage, don't upload it to avoid pipeline failure
uses: codecov/codecov-action@15559ed290fa727036809b67ab0f646ffa6c5158
with:
use_oidc: true
files: "${{ inputs.target }}/coverage.xml"
flags: "${{ inputs.target }}"
2 changes: 0 additions & 2 deletions .github/workflows/weekly-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
latest: true
secrets: inherit
permissions:
# needed for codecov in test-target.yml, allows the action to get a JWT signed by Github
id-token: write
# needed for compute-matrix in test-target.yml
contents: read

Expand Down
1 change: 1 addition & 0 deletions LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ cryptography,PyPI,BSD-3-Clause,Copyright (c) Individual contributors.
cryptography,PyPI,PSF,Copyright (c) Individual contributors.
ddtrace,PyPI,BSD-3-Clause,"Copyright 2016 Datadog, Inc."
dnspython,PyPI,ISC,Copyright (C) Dnspython Contributors
fastavro,PyPI,MIT,Copyright (c) 2011 Miki Tebeka
flup,Vendor,BSD-3-Clause,Copyright (c) 2005 Allan Saddi. All Rights Reserved.
flup-py3,Vendor,BSD-3-Clause,"Copyright (c) 2005, 2006 Allan Saddi <allan@saddi.com> All rights reserved."
foundationdb,PyPI,Apache-2.0,Copyright 2017 FoundationDB
Expand Down
1 change: 1 addition & 0 deletions agent_requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ confluent-kafka==2.8.0
cryptography==45.0.4
ddtrace==3.9.3
dnspython==2.7.0
fastavro==1.11.1
foundationdb==6.3.25
hazelcast-python-client==5.5.0
in-toto==2.0.0
Expand Down
1 change: 1 addition & 0 deletions kafka_consumer/changelog.d/20862.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for Avro and Protobuf formats for Data Streams messages feature.
38 changes: 33 additions & 5 deletions kafka_consumer/datadog_checks/kafka_consumer/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,47 @@ def _validate_live_messages_configs(self):
):
self.log.debug('Data Streams live messages configuration missing required kafka parameters.', kafka)
continue
# Only json format is supported for Data Streams live messages

# Validate value format
if kafka.get('value_format', '') == '':
kafka['value_format'] = 'json'
if kafka['value_format'] != 'json':
value_format = kafka['value_format']
if value_format not in ['json', 'avro', 'protobuf']:
self.log.debug(
'Only json format is supported for Data Streams live messages, got %s', kafka['value_format']
'Unsupported value format for Data Streams live messages, got %s. '
'Supported formats: json, avro, protobuf',
value_format,
)
continue

# Validate key format
if kafka.get('key_format', '') == '':
kafka['key_format'] = 'json'
if kafka['key_format'] != 'json':
key_format = kafka['key_format']
if key_format not in ['json', 'avro', 'protobuf']:
self.log.debug(
'Only json format is supported for Data Streams live messages, got %s', kafka['key_format']
'Unsupported key format for Data Streams live messages, got %s. '
'Supported formats: json, avro, protobuf',
key_format,
)
continue

# Validate schemas for non-JSON formats
if value_format in ['avro', 'protobuf']:
if 'value_schema' not in kafka or not kafka['value_schema']:
self.log.debug(
'Value schema is required for %s format in Data Streams live messages configuration',
value_format,
)
continue

if key_format in ['avro', 'protobuf']:
if 'key_schema' not in kafka or not kafka['key_schema']:
self.log.debug(
'Key schema is required for %s format in Data Streams live messages configuration', key_format
)
continue

live_messages_configs.append(config)
self.live_messages_configs = live_messages_configs

Expand Down
Loading
Loading