Closed felixgao closed 11 months ago
@felixgao Have you tried use non-host
network in your docker-compose yaml?
I have not, since I am not building a docker image for my application that uses OTEL yet, I thought it would be good to setup the OTEL infrastructure locally first with docker first. That is why I want to use the host network.
you can try binding the otlp ports to a different port. i believe jaeger is now also binding to those ports, which would be causing the problem you're seeing.
you can try binding the otlp ports to a different port. i believe jaeger is now also binding to those ports, which would be causing the problem you're seeing.
I think the problem is not my host OTLP port, it is the the port inside the docker container.
I have changed my host port to
2023-10-18T17:41:26.097Z info service@v0.87.0/service.go:192 Shutdown complete.
Error: cannot start pipelines: listen tcp 0.0.0.0:4317: bind: address already in use
2023/10/18 17:41:26 collector server run finished with error: cannot start pipelines: listen tcp 0.0.0.0:4317: bind: address already in use
I think my compose is very much like the demo compose file with the major difference on using a host network. I could try to not use the host network.
Update: I have removed the network_mode: host
and service is up and running without any errors.
Right the configuration I was talking about is the collector configuration. The change would be to go from
receivers:
otlp:
protocols:
grpc:
http:
zipkin:
to something like this, i picked arbitrary ports here
receivers:
otlp:
protocols:
grpc:
endpoint: localhost:9317
http:
endpoint: localhost:9318
zipkin:
The docker compose port configuration doesn't change what port the service is binding to.
Marking this as closed based on the comment
Update: I have removed the network_mode: host and service is up and running without any errors.
Please re-open if that's not the case.
Unfortunately, I have the same problem and removing network_mode: host
from docker-compose.yaml
didn't solve the problem for me. Could you please clarify what else might help?
I tried to receive data in OpenTelemetry collector
and export it to jaeger-all-in-one
. As a source of telemetry I used telemetrygen
from official documentation example . I tried to start components from docker compose and using binaries, the error is the same (commands below are listed only for the second case ).
Config.yaml
for the collector:
user@host:~$ cat /etc/otelcol/config.yaml
extensions:
health_check: {}
pprof: {}
zpages: {}
receivers:
otlp:
protocols:
grpc:
endpoint: localhost:4317
http:
endpoint: localhost:4318
zipkin: {}
processors:
attributes:
actions:
- key: some.ip
value: "some_IP_in_future"
action: insert
batch: {}
exporters:
debug:
verbosity: detailed
otlp:
endpoint: jaeger-all-in-one:4317
tls:
insecure: true
zipkin:
endpoint: "http://zipkin:9411/api/v2/spans"
service:
pipelines:
traces:
receivers: [otlp, zipkin]
processors: [attributes, batch]
exporters: [debug, otlp]
metrics:
receivers: [otlp]
exporters: [debug, otlp]
logs:
receivers: [otlp]
processors: [batch]
exporters: [debug]
extensions: [pprof, zpages, health_check]
telemetry:
logs:
level: "debug"
Starting the collector:
user@host:~$ /usr/bin/otelcol --config=file:/etc/otelcol/config.yaml --feature-gates=-component.UseLocalHostAsDefaultHost
Starting the load:
$GOBIN/telemetrygen traces --otlp-insecure --traces 3
I see log messages in the terminal with OpenTelemetry collector
from telemetrygen
, however, jaeger-all-in-one fails with an error when I try to start it:
user@host:~/pkg/jaeger-1.61.0-linux-amd64$ ./jaeger-all-in-one --collector.otlp.enabled=true
...
could not start OTLP receiver: could not start the OTLP receiver: listen tcp :4317: bind: address already in use
OpenTelemetry collector
also sends an error to its terminal:
Exporting failed. Will retry the request after interval. {"kind": "exporter", "data_type": "traces", "name": "otlp", "error": "rpc error: code = Unavailable desc = name resolver error: produced zero addresses", "interval": "13.56862226s"}
If I don't add any endpoints both to receivers::otlp::protocols::grpc
and receivers::otlp::protocols::http
, my OpenTelemetry collector
instance doesn't receive data from the load, it is sent directly to Jaeger Collector
and further to Jaeger UI
from it, so the OpenTelemetry collector
is just ignored in this case.
Component(s)
No response
What happened?
Description
I downloaded the latest docker image and trying to bring up a collect to sent my trace/metrics over. When I tried to
compose up
my services the collector is failing withSteps to Reproduce
docker-compose up -d collector
Expected Result
services up and running
Actual Result
container exited with error.
Collector version
208830cb18d9
Environment information
Environment
OS: (e.g., "Ubuntu 20.04") macOS Ventura 13.5.2 Compiler(if manually compiled): (e.g., "go 14.2") Docker version: 4.23.0
OpenTelemetry Collector configuration
No response
Log output
lsof of listening ports
Additional context
docker-compose.yaml
otel-collector-config.yaml