Skip to content

fix(outputs.azure_monitor): Keep rejected metrics on a failed batch - #20185

Merged
srebhan merged 1 commit into
influxdata:masterfrom
skartikey:fix/azure-monitor-partial-write-reject
Nov 18, 2026
Merged

srebhan merged 1 commit into
influxdata:masterfrom
skartikey:fix/azure-monitor-partial-write-reject

Conversation

@skartikey

@skartikey skartikey commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

When a batch fails with a non-retryable error (HTTP 400), Write builds the list of rejected metrics from the accepted ones instead of appending to the rejected ones.

This has two effects:

  • Metrics rejected earlier in the same call, for being outside the time limits or failing translation, are dropped from the list. They stay in the buffer and are retried on every flush.
  • If an earlier request of the same call succeeded, its metrics are reported as both accepted and rejected.

This PR appends to the list of rejected metrics in both places. The new test writes one metric outside the time limits and one valid metric against a server answering 400, and checks that both are reported as rejected.

I noticed this while reviewing #20033.

Checklist

Related issues

related to #20033

When a batch failed with a non-retryable error, Write built the list of rejected metrics from the accepted ones. Metrics already rejected for being outside the time limits or failing translation were dropped from the list and stayed in the buffer, and metrics accepted in an earlier request were reported as both accepted and rejected. Append to the list of rejected metrics and cover it with a test.
@telegraf-tiger telegraf-tiger Bot added fix pr to fix corresponding bug plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins labels Nov 17, 2026
@skartikey skartikey self-assigned this Nov 17, 2026
@telegraf-tiger

Copy link
Copy Markdown
Contributor

Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip.
Downloads for additional architectures and packages are available below.

⚠️ This pull request increases the Telegraf binary size by 7.66 % for linux amd64 (new size: 331.9 MB, nightly size 308.2 MB)

📦 Click here to get additional PR build artifacts

Artifact URLs

. DEB . RPM . TAR . GZ . ZIP
amd64.deb aarch64.rpm darwin_amd64.tar.gz windows_amd64.zip
arm64.deb armel.rpm darwin_arm64.tar.gz windows_arm64.zip
armel.deb armv6hl.rpm freebsd_amd64.tar.gz windows_i386.zip
armhf.deb i386.rpm freebsd_armv7.tar.gz
i386.deb ppc64le.rpm freebsd_i386.tar.gz
mips.deb riscv64.rpm linux_amd64.tar.gz
mipsel.deb s390x.rpm linux_arm64.tar.gz
ppc64el.deb x86_64.rpm linux_armel.tar.gz
riscv64.deb linux_armhf.tar.gz
s390x.deb linux_i386.tar.gz
linux_mips.tar.gz
linux_mipsel.tar.gz
linux_ppc64le.tar.gz
linux_riscv64.tar.gz
linux_s390x.tar.gz

@skartikey skartikey added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Nov 18, 2026
@skartikey skartikey assigned srebhan and unassigned skartikey Nov 18, 2026

@srebhan srebhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! Thanks @skartikey!

@srebhan
srebhan merged commit 0649734 into influxdata:master Nov 18, 2026
29 checks passed
@github-actions github-actions Bot added this to the v1.40.4 milestone Nov 18, 2026
srebhan pushed a commit that referenced this pull request Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix pr to fix corresponding bug plugin/output 1. Request for new output plugins 2. Issues/PRs that are related to out plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants