Skip to content

Make downstream otlp host configurable - #734

Draft
jorbaum wants to merge 3 commits into
mainfrom
configurable-otlp-host
Draft

jorbaum wants to merge 3 commits into
mainfrom
configurable-otlp-host

Conversation

@jorbaum

@jorbaum jorbaum commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Make downstream otlp host configurable. Similar to https://github.com/cloudfoundry/loggregator-agent-release/pull/708/changes , but for otlp egress, not for loggregator envelope ingress.

We need this as in kind-deployment otel-collector and forwarder agent do not run on the same machine (see cloudfoundry/kind-deployment#493 ).

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Testing performed?

  • Unit tests
  • Integration tests
  • Acceptance tests

Checklist:

  • This PR is being made against the main branch, or relevant version branch
  • I have made corresponding changes to the documentation
  • I have added testing for my changes

If you have any questions, or want to get attention for a PR or issue please reach out on the #logging-and-metrics channel in the cloudfoundry slack

In K8s otel-collector and forwarder agent likely do not run on the
same machine.
@jorbaum

jorbaum commented Oct 13, 2026

Copy link
Copy Markdown
Contributor Author

Tested by deploying this in cf on kind via cloudfoundry/kind-deployment#493 and checking via an external otel-collector-outside-kind that metrics are being forwarded.

I think this is a small enough change so we do not need to verify this again on an actual foundation. However, I could test it there again as well if required.

@jorbaum
jorbaum marked this pull request as ready for review October 13, 2026 15:25
@jorbaum
jorbaum requested a review from a team as a code owner October 13, 2026 15:25

@chombium chombium left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jorbaum Looks good, but I have few small objections about the test setup.

ExpectWithOffset(1, err).ToNot(HaveOccurred())

lis, err := net.Listen("tcp", "127.0.0.1:")
listenHost := host

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why don't you work directly with the host variable? If it's not set it will have to default to localhost, anyways. I woudn't say that the test will run with a remote downstream consumer.


contents := fmt.Sprintf(configTempl, port[len(port)-1])
contents := fmt.Sprintf(configTempl, port)
if host != "" {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why printing the port only if it's set? IMO it can be always printed out for better clarity.

ingress: %d
protocol: otelcol
`, port)
host: %q

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

About my comment from above: what will be printed here if the 'host = ""`? :)

ingress: %d
protocol: otelcol
`, port)
host: %q

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same as above

protocol: otelcol
`, port)
host: %q
`, port, host)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same as above

ingress: %d
protocol: otelcol
`, port)
host: %q

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

same as above

// DownstreamIngressPortCfg will define consumers on localhost that will
// receive each envelope. It is assumed to adhere to the Loggregator Ingress
// Service and use the provided TLS configuration.
// DownstreamIngressPortCfg defines consumers that receive each envelope.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe .. define consumers on predefined host which in case is missing defaults to localhost.

I would have left the rest as is.

@github-project-automation github-project-automation Bot moved this from Inbox to Pending Merge | Prioritized in Application Runtime Platform Working Group Oct 19, 2026
@chombium
chombium self-requested a review October 19, 2026 09:50

@chombium chombium left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@jorbaum it looks good, but I have a small objection about the test setup

@jorbaum
jorbaum marked this pull request as draft October 19, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Pending Merge | Prioritized

Development

Successfully merging this pull request may close these issues.

2 participants