Skip to content

Commit 4e32645

Browse files
authored
Fixing protobuf generation and InstrumentationScope (#665)
* updating proto generation switching over to using opentelemetry-proto's own mechanism for generating protobuf interfaces, and updating interfaces to latest version * downgrade protobuf interfaces to 0.14.0 this is the latest version that seems to work with out grpc exporter, further investigation required for 0.15.0+ * tidy up script * renaming InstrumentationLibrary to InstrumentationScope and bumping protobuf InstrumentationLibrary is now deprecated in favour of InstrumentationScope. Making this change resolves issues with grpc+protobuf exports being ignored by the otel collector, so we now can update the proto interfaces to latest. * rename collector docker-compose file
1 parent 9138d78 commit 4e32645

File tree

103 files changed

+2000
-923
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+2000
-923
lines changed

.phan/config.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,10 +359,12 @@
359359
// your application should be included in this list.
360360
'directory_list' => [
361361
'src',
362-
'proto',
362+
'proto/otel/GPBMetadata',
363+
'proto/otel/Opentelemetry',
363364
'thrift',
364365
'vendor/packaged/thrift',
365366
'vendor/composer',
367+
'vendor/grpc/grpc/src/lib',
366368
'vendor/guzzlehttp',
367369
'vendor/psr',
368370
'vendor/php-http',

Makefile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ psalm:
2424
psalm-info:
2525
$(DC_RUN_PHP) env XDEBUG_MODE=off vendor/bin/psalm --show-info=true --threads=1
2626
phpstan:
27-
$(DC_RUN_PHP) env XDEBUG_MODE=off vendor/bin/phpstan analyse
27+
$(DC_RUN_PHP) env XDEBUG_MODE=off vendor/bin/phpstan analyse --memory-limit=256M
2828
benchmark:
2929
$(DC_RUN_PHP) env XDEBUG_MODE=off vendor/bin/phpbench run --report=default
3030
phpmetrics:
@@ -39,9 +39,9 @@ trace examples: FORCE
3939
docker-compose run -e NEW_RELIC_ENDPOINT -e NEW_RELIC_INSERT_KEY --rm php php ./examples/AlwaysOnZipkinToNewrelicExample.php
4040
docker-compose stop
4141
collector:
42-
docker-compose -f docker-compose-collector.yaml up -d --remove-orphans
43-
docker-compose -f docker-compose-collector.yaml run -e OTEL_EXPORTER_OTLP_ENDPOINT=otel-collector:4317 --rm php php ./examples/AlwaysOnOTLPGrpcExample2.php
44-
docker-compose -f docker-compose-collector.yaml stop
42+
docker-compose -f docker-compose.collector.yaml up -d --remove-orphans
43+
docker-compose -f docker-compose.collector.yaml run -e OTEL_EXPORTER_OTLP_ENDPOINT=collector:4317 --rm php php ./examples/AlwaysOnOTLPGrpcExample.php
44+
docker-compose -f docker-compose.collector.yaml stop
4545

4646
fiber-ffi-example:
4747
@docker-compose -f docker-compose.fiber-ffi.yaml -p opentelemetry-php_fiber-ffi-example up -d web
@@ -51,7 +51,7 @@ metrics-prometheus-example:
5151
stop-prometheus:
5252
@docker-compose -f docker-compose.prometheus.yaml -p opentelemetry-php_metrics-prometheus-example stop
5353
protobuf:
54-
@docker-compose -f docker-compose.proto.yaml up proto
54+
./script/proto_gen.sh
5555
thrift:
5656
./script/thrift_gen.sh
5757
bash:

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,8 @@ To generate protobuf files for use with this repository, you can run the followi
205205
make protobuf
206206
```
207207

208-
Change into the root of this directory. This will create a `/proto` folder in the root
209-
directory of the
210-
repository.
208+
This will replace `proto/otel/Opentelemetry` and `proto/otel/GPBMetadata` with freshly generated code based on the latest
209+
tag from `opentelemetry-proto`, which can then be committed.
211210

212211

213212
## Semantic Conventions Generation

docker-compose-collector.yaml renamed to docker-compose.collector.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ services:
77
volumes:
88
- ./:/usr/src/myapp
99
depends_on:
10-
- otel-collector
10+
- collector
1111
zipkin:
1212
image: openzipkin/zipkin-slim
1313
ports:
@@ -19,8 +19,7 @@ services:
1919
ports:
2020
- 9412:9412
2121
- 16686:16686
22-
otel-collector:
23-
platform: linux/amd64
22+
collector:
2423
image: otel/opentelemetry-collector-contrib
2524
command: ["--config=/etc/otel-collector-config.yml"]
2625
volumes:

docker-compose.proto.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

proto/otel/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
opentelemetry-proto
Binary file not shown.
Binary file not shown.
Binary file not shown.
-1.23 KB
Binary file not shown.

0 commit comments

Comments
 (0)