Repository navigation
Conversation
In K8s otel-collector and forwarder agent likely do not run on the same machine.
|
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. |
| ExpectWithOffset(1, err).ToNot(HaveOccurred()) | ||
|
|
||
| lis, err := net.Listen("tcp", "127.0.0.1:") | ||
| listenHost := host |
There was a problem hiding this comment.
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 != "" { |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
About my comment from above: what will be printed here if the 'host = ""`? :)
| ingress: %d | ||
| protocol: otelcol | ||
| `, port) | ||
| host: %q |
| protocol: otelcol | ||
| `, port) | ||
| host: %q | ||
| `, port, host) |
| ingress: %d | ||
| protocol: otelcol | ||
| `, port) | ||
| host: %q |
| // 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. |
There was a problem hiding this comment.
Maybe .. define consumers on predefined host which in case is missing defaults to localhost.
I would have left the rest as is.
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
Testing performed?
Checklist:
mainbranch, or relevant version branchIf 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