Skip to content

Commit

Permalink
Update demo app to build image and use otel-go v0.19.0 (#2760)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aneurysm9 authored Mar 22, 2021
1 parent 3660f5c commit 3657cf6
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
19 changes: 19 additions & 0 deletions examples/demo/app/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM golang:1.14
COPY . /usr/src/app/
WORKDIR /usr/src/app/
RUN go env -w GOPROXY=direct
RUN go install ./main.go
CMD ["/go/bin/main"]
2 changes: 1 addition & 1 deletion examples/demo/app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func initProvider() func() {

otelAgentAddr, ok := os.LookupEnv("OTEL_AGENT_ENDPOINT")
if !ok {
otelAgentAddr = "0.0.0.0:55680"
otelAgentAddr = "0.0.0.0:4317"
}

exp, err := otlp.NewExporter(ctx, otlpgrpc.NewDriver(
Expand Down
10 changes: 4 additions & 6 deletions examples/demo/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,11 @@ services:
- otel-agent

metrics-load-generator:
image: golang:1.12.7
volumes:
- ./app/main.go:/usr/src/main.go
build:
dockerfile: $PWD/app/Dockerfile
context: ./app
environment:
- GO111MODULE=on
- OTEL_AGENT_ENDPOINT=otel-agent:55678
command: ["bash", "-c", "go run /usr/src/main.go"]
- OTEL_AGENT_ENDPOINT=otel-agent:4317
depends_on:
- otel-agent

Expand Down

0 comments on commit 3657cf6

Please sign in to comment.