Skip to content

Commit

Permalink
Update docker image in examples/demo from 0.88.0 to 0.116.1 (Closes #…
Browse files Browse the repository at this point in the history
…37031) (#37063)

Update docker image and collector configuration in examples/demo to keep
metrics working on port 8888

*The gap between versions 0.88.0 and 0.116.1 is widening*

<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
#### Description

Update docker image used in the example from
otel/opentelemetry-collector:**0.88.0** to
otel/opentelemetry-collector:**0.116.1**. This update requires some
changes to the collector configuration (otel-collector-config.yaml) due
to a breaking change in the collector. In version 0.116.1, the collector
no longer exposes configurations on 0.0.0.0 by default.

Collector configuration to keep metrics working on port 8888

```
  telemetry:
    metrics:
      readers:
        - pull:
            exporter:
              prometheus:
                host: '0.0.0.0'
                port: 8888
```

<!-- Issue number (e.g. #1234) or full URL to issue, if applicable. -->
#### Link to tracking issue
Closes #37031

<!--Describe what testing was performed and which tests were added.-->
#### Testing

- Traces are exactly the same in Jaeger after updating the image/config
- Traces are exactly the same in Zipkin after updating the image/config
- Metrics endpoint 8889 is working /metrics
- Metrics endpoint 8888 is working /metrics (after adjustment in the
collector at service/telemetry/metrics/readers)
<!--Describe the documentation added.-->

```
cd examples/demo/ && docker compose up
```
✔️ All services are up and running
✔️ Metric logs are visible
✔️ Trace logs are visible
✔️ Client and server tracing are available in both Zipkin and Jaeger

```
otel-collector-1     | 2025-01-07T10:43:29.029Z info    Traces  {"kind": "exporter", "data_type": "traces", "name": "debug", "resource spans": 1, "spans": 8}
otel-collector-1     | 2025-01-07T10:43:29.029Z info    Metrics {"kind": "exporter", "data_type": "metrics", "name": "debug", "resource metrics": 1, "metrics": 7, "data points": 7}
```

---------

Co-authored-by: Curtis Robert <[email protected]>
  • Loading branch information
apolzek and crobert-1 authored Jan 8, 2025
1 parent 127051a commit e102cf0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 0 additions & 2 deletions examples/demo/.env

This file was deleted.

4 changes: 2 additions & 2 deletions examples/demo/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ services:

# Collector
otel-collector:
image: ${OTELCOL_IMG}
image: otel/opentelemetry-collector:0.116.1
restart: always
command: ["--config=/etc/otel-collector-config.yaml", "${OTELCOL_ARGS}"]
command: ["--config=/etc/otel-collector-config.yaml"]
volumes:
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
ports:
Expand Down
8 changes: 8 additions & 0 deletions examples/demo/otel-collector-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,11 @@ service:
receivers: [otlp]
processors: [batch]
exporters: [debug, prometheus]
telemetry:
metrics:
readers:
- pull:
exporter:
prometheus:
host: '0.0.0.0'
port: 8888

0 comments on commit e102cf0

Please sign in to comment.