Skip to content

[exporter/datadog] trim whitespace from hostname - #50945

Open
chandan009s wants to merge 2 commits into
open-telemetry:mainfrom
chandan009s:fix/datadog-file-hostname-newline
Open

[exporter/datadog] trim whitespace from hostname#50945
chandan009s wants to merge 2 commits into
open-telemetry:mainfrom
chandan009s:fix/datadog-file-hostname-newline

Conversation

@chandan009s

Copy link
Copy Markdown

Description

When the Datadog exporter hostname is configured using the ${file:} provider,
the trailing newline from the file is preserved and causes hostname validation
to fail.

This change trims surrounding whitespace from the configured hostname during
unmarshalling so file-based hostnames such as my-hostname\n are accepted.

Link to tracking issue

Fixes #50935

Testing

Added a regression test covering a hostname with a trailing newline.

Tests run:

  • go test ./... in pkg/datadog/config

Documentation

No documentation changes.

Authorship

  • I, a human, wrote this pull request description myself.

@chandan009s
chandan009s requested review from a team, mx-psi and songy23 as code owners September 13, 2026 05:48
@linux-foundation-easycla

linux-foundation-easycla Bot commented Sep 13, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: chandan009s / name: chandan009s (773c73b)

@github-actions github-actions Bot added the first-time contributor PRs made by new contributors label Sep 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib.

Important reminders:

  • Read our Contributing Guidelines.
  • Sign the CLA if you haven't already.
  • Follow the OpenTelemetry Generative AI policy: disclose any AI use in your contribution, and communicate (PR descriptions, review replies) in your own words rather than AI-generated text.
  • Give reviewers at least a few days before pinging them for feedback.
  • If you need help with general setup, development process, or contributor etiquette, ask in #opentelemetry-new-contributors.
  • First-time contributors should keep at most one PR marked as ready for review until their first PR is merged; once two are open for review, any further PR is automatically converted to draft.
  • If your change isn't one of our priority components, reviews may take more time.
  • Raise technical or Collector-specific questions in #otel-collector-dev or a Collector SIG meeting.

@opentelemetry-pr-dashboard

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-09-13 22:39 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

first-time contributor PRs made by new contributors pkg/datadog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[exporter/datadog] hostname read via ${file:} keeps the trailing newline and fails validation

1 participant