Currently, I use the docker-compose.yaml file and the Collector-gateway.yaml file as the otel collector to send tracking information to jaeger. What I want to achieve is data persistence using postgresql and I'm trying to use this github repo: text. However, I keep getting this error when launching docker containers using docker-compose up.
Error log:
jaeger-postgresql-jaeger-all-in-one-1 | {"level":"fatal","ts":1696996008.1216166,"caller":"./main.go:110","msg":"Failed to init storage factory","error":"grpc-plugin builder failed to create a store: error attempting to connect to plugin rpc client: fork/exec /etc/cmd/jaeger-pg-store: exec format error","stacktrace":"main.main.func1\n\t./main.go:110\ngithub.com/spf13/cobra.(*Command).execute\n\tgithub.com/spf13/[email protected]/command.go:940\ngithub.com/spf13/cobra.(*Command).ExecuteC\n\tgithub.com/spf13/[email protected]/command.go:1068\ngithub.com/spf13/cobra.(*Command).Execute\n\tgithub.com/spf13/[email protected]/command.go:992\nmain.main\n\t./main.go:243\nruntime.main\n\truntime/proc.go:267"}
More context about my code docker-compose.yaml:
version: "3" services: # Jaeger jaeger-all-in-one: image: jaegertracing/all-in-one:latest ports: - "16686:16686" - "14268" - "14250" environment: - SPAN_STORAGE_TYPE=grpc-plugin - COLLECTOR_OTLP_ENABLED=true volumes: - ./jaeger-pg-store:/etc/cmd/jaeger-pg-store - ./collector-gateway.yaml:/etc/collector-gateway.yaml command: ["--grpc-storage-plugin.binary=/etc/cmd/jaeger-pg-store", "--grpc-storage-plugin.configuration-file=/etc/collector-gateway.yaml"] # Collector collector-gateway: image: otel/opentelemetry-collector-contrib:0.53.0 volumes: - ./collector-gateway.yaml:/etc/collector-gateway.yaml - ./jaeger-pg-store:/etc/cmd command: [ "--config=/etc/collector-gateway.yaml"] ports: - "1888:1888" # pprof extension - "13133:13133" # health_check extension - "4317:4317" # OTLP gRPC receiver - "4318:4318" # OTLP HTTP receiver - "55670:55679" # zpages extension depends_on: - jaeger-all-in-one links: - jaeger-all-in-one
Since I'm on a mac system, I've tried building jaeger-plugin-store with CGO_ENABLED=0 GOARCH=amd64 GOOS=darwin. Overall, I'm still relatively new.
The weird thing is that when I follow the normal instructions in the readme, which run jaeger-all-in-one as an executable from a binary, rather than through docker-compose, it works Works but cannot detect my postgres database. However, I'd better like to run it with my docker-compose file.
The related error is
fork/exec /etc/cmd/jaeger-pg-store: exec format error
This indicates that the binary format is incompatible. When you run in a Docker container, your binary has a different view of the operating system than your local machine, i.e. you are using a Docker image that was built for Linux, but you are trying to point it to a plugin binary built for MacOS. You also need to build the plugin binaries for Linux.
The above is the detailed content of jaeger-all-in-one docker-compose.yaml configuration for storing traces into postgresql. For more information, please follow other related articles on the PHP Chinese website!