diff --git a/aws-ecs-otel-collector/Dockerfile b/aws-ecs-otel-collector/Dockerfile index 597bfbf..b437847 100644 --- a/aws-ecs-otel-collector/Dockerfile +++ b/aws-ecs-otel-collector/Dockerfile @@ -1,5 +1,10 @@ -FROM public.ecr.aws/aws-observability/aws-otel-collector:v0.41.0 +FROM public.ecr.aws/aws-observability/aws-otel-collector:v0.43.2 LABEL org.opencontainers.image.source = https://github.com/base2Services/build-containers; COPY --chmod=777 ecs_sd_targets.yaml /etc/ecs_sd_targets.yaml + +# Debug tools +COPY --chmod=777 cat /bin/cat +COPY --chmod=777 gurl /bin/gurl +# See https://github.com/ericbsantana/gurl diff --git a/aws-ecs-otel-collector/cat b/aws-ecs-otel-collector/cat new file mode 100644 index 0000000..090ac8c Binary files /dev/null and b/aws-ecs-otel-collector/cat differ diff --git a/aws-ecs-otel-collector/cat.go b/aws-ecs-otel-collector/cat.go new file mode 100644 index 0000000..08677a4 --- /dev/null +++ b/aws-ecs-otel-collector/cat.go @@ -0,0 +1,44 @@ +package main + +import ( + "fmt" + "os" + "io" + "log" + "io/ioutil" +) + +// This script implements the unix cat. +func cat(r io.Reader) ([]byte, error) { + data, err := ioutil.ReadAll(r); + if (err != nil) { + return nil, err + } + return data, nil +} + +func main() { + var output []byte + var err error + args := os.Args[1:] + if len(args) > 0 { + for _, file := range args { + data, err := os.Open(file) + defer data.Close() + if err != nil { + log.Panic(err) + } + output, err = cat(data) + if err != nil { + log.Panic(err) + } + fmt.Print(string(output)) + } + } else { + output, err = cat(os.Stdin) + if err != nil { + log.Panic(err) + } + fmt.Print(string(output)) + } +} \ No newline at end of file diff --git a/aws-ecs-otel-collector/gurl b/aws-ecs-otel-collector/gurl new file mode 100644 index 0000000..c1d14c3 Binary files /dev/null and b/aws-ecs-otel-collector/gurl differ