Skip to content

Commit

Permalink
Make protobuf implementation optional (#949)
Browse files Browse the repository at this point in the history
* Make google/protobuf an optional dependency
* Update the README with more information on installing protobuf implementation
* Add some extra documentation in the OTLP exporter library
* Update proto/otel/README.md
  • Loading branch information
xvilo authored Mar 30, 2023
1 parent 69d803b commit aa8a62f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
# OpenTelemetry protobuf files

## Protobuf Runtime library

There exist two protobuf runtime libraries that offer the same set of APIs, allowing developers to choose the one that
best suits their needs.

The first and easiest option is to install the Protobuf PHP Runtime Library through composer. This can be the easiest
way to get started quickly. Either run `composer require google/protobuf`, or update your `composer.json` as follows:

```json
"require": {
"google/protobuf": "^v3.3.0"
}
```

Alternatively, and the recommended option for production is to install the Protobuf C extension for PHP. The extension
makes both exporters _significantly_ more performant. This can be easily installed with the following command:
```sh
$ sudo pecl install protobuf
```
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
}
],
"require": {
"php": "^7.4 || ^8.0",
"google/protobuf": "^v3.3.0"
"php": "^7.4 || ^8.0"
},
"autoload": {
"psr-4": {
Expand All @@ -22,6 +21,7 @@
},
"suggest": {
"ext-protobuf": "For better performance, when dealing with the protobuf format",
"google/protobuf": "To get started quickly, install the native protobuf library.",
"ext-grpc": "To use the gRPC based exporters"
}
}

0 comments on commit aa8a62f

Please sign in to comment.