diff --git a/src/go/.gitignore b/src/go/.gitignore index afa0fff..0cd94cb 100644 --- a/src/go/.gitignore +++ b/src/go/.gitignore @@ -1,25 +1,22 @@ -# Allowlisting gitignore template for GO projects prevents us -# from adding various unwanted local files, such as generated -# files, developer configurations or IDE-specific files etc. +# If you prefer the allow list template instead of the deny list, see community template: +# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore # -# Recommended: Go.AllowList.gitignore +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib +.idea/ -# Ignore everything -* +# Test binary, built with `go test -c` +*.test -# But not these files... -!/.gitignore +# Output of the go coverage tool, specifically when used with LiteIDE +*.out -!*.go -!go.sum -!go.mod -!recipefile.json -!Dockerfile +# Dependency directories (remove the comment below to include it) +# vendor/ -!README.md -!LICENSE - -# !Makefile - -# ...even if they are in subdirectories -!*/ +# Go workspace file +go.work diff --git a/src/go/trace/console/collector-config.yaml b/src/go/trace/console/collector-config.yaml new file mode 100644 index 0000000..31c8c36 --- /dev/null +++ b/src/go/trace/console/collector-config.yaml @@ -0,0 +1,17 @@ +receivers: + otlp: + protocols: + grpc: + http: +processors: +exporters: + debug: + verbosity: detailed + otlphttp: + endpoint: http://otlp-backend:4319 + compression: none +service: + pipelines: + traces: + receivers: [otlp] + exporters: [otlphttp, debug] diff --git a/src/go/trace/console/docker-compose.yml b/src/go/trace/console/docker-compose.yml new file mode 100644 index 0000000..8f7142b --- /dev/null +++ b/src/go/trace/console/docker-compose.yml @@ -0,0 +1,37 @@ +version: "2.4" +services: + + app: + build: + context: . + dockerfile: Dockerfile + depends_on: + - otlp-backend + - collector-otel-recipes + networks: + - otel-recipes + + otlp-backend: + build: + context: ../../../../internal/otlp_backend + dockerfile: Dockerfile + ports: + - "4319:4319" # OTLP HTTP receiver + networks: + - otel-recipes + + collector-otel-recipes: + image: otel/opentelemetry-collector-contrib:0.96.0 + command: ["--config=/etc/collector-config.yaml", "${OTELCOL_ARGS}"] + volumes: + - ./collector-config.yaml:/etc/collector-config.yaml + ports: + - "13133:13133" # health_check extension + - "4317:4317" # OTLP gRPC receiver + - "4318:4318" # OTLP HTTP receiver + depends_on: + - otlp-backend + networks: + - otel-recipes +networks: + otel-recipes: diff --git a/src/go/trace/gin-api/collector-config.yaml b/src/go/trace/gin-api/collector-config.yaml new file mode 100644 index 0000000..31c8c36 --- /dev/null +++ b/src/go/trace/gin-api/collector-config.yaml @@ -0,0 +1,17 @@ +receivers: + otlp: + protocols: + grpc: + http: +processors: +exporters: + debug: + verbosity: detailed + otlphttp: + endpoint: http://otlp-backend:4319 + compression: none +service: + pipelines: + traces: + receivers: [otlp] + exporters: [otlphttp, debug] diff --git a/src/go/trace/gin-api/docker-compose.yml b/src/go/trace/gin-api/docker-compose.yml new file mode 100644 index 0000000..d8637de --- /dev/null +++ b/src/go/trace/gin-api/docker-compose.yml @@ -0,0 +1,39 @@ +version: "2.4" +services: + + app: + build: + context: . + dockerfile: Dockerfile + ports: + - "8080:8080" + depends_on: + - otlp-backend + - collector-otel-recipes + networks: + - otel-recipes + + otlp-backend: + build: + context: ../../../../internal/otlp_backend + dockerfile: Dockerfile + ports: + - "4319:4319" # OTLP HTTP receiver + networks: + - otel-recipes + + collector-otel-recipes: + image: otel/opentelemetry-collector-contrib:0.96.0 + command: ["--config=/etc/collector-config.yaml", "${OTELCOL_ARGS}"] + volumes: + - ./collector-config.yaml:/etc/collector-config.yaml + ports: + - "13133:13133" # health_check extension + - "4317:4317" # OTLP gRPC receiver + - "4318:4318" # OTLP HTTP receiver + depends_on: + - otlp-backend + networks: + - otel-recipes +networks: + otel-recipes: