Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,3 +271,7 @@ significant modifications will be credited to OpenTelemetry Authors.
([#764](https://github.com/open-telemetry/opentelemetry-demo/pull/764))
* [chore] align memory limits with Helm chart
([#781](https://github.com/open-telemetry/opentelemetry-demo/pull/781))
* [bug] fixing quoteservice metrics exporting (PHP)
([#793)(https://github.com/open-telemetry/opentelemetry-demo/pull/793))
D
([#793]())
Comment thread
brettmc marked this conversation as resolved.
Outdated
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ services:
ports:
- "${QUOTE_SERVICE_PORT}"
environment:
- OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:4318/v1/traces
- OTEL_EXPORTER_OTLP_ENDPOINT=http://${OTEL_COLLECTOR_HOST}:4318
- OTEL_PHP_AUTOLOAD_ENABLED=true
- QUOTE_SERVICE_PORT
- OTEL_RESOURCE_ATTRIBUTES
Expand Down
9 changes: 7 additions & 2 deletions src/quoteservice/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"php": ">= 8.2",
"ext-json": "*",
"monolog/monolog": "2.8.0",
"open-telemetry/sdk": "1.0.0beta1",
"open-telemetry/exporter-otlp": "1.0.0beta1",
"open-telemetry/sdk": "1.0.0beta3",
"open-telemetry/exporter-otlp": "1.0.0beta3",
"open-telemetry/opentelemetry-auto-slim": "1.0.0beta4",
"guzzlehttp/guzzle": "7.4.5",
"php-di/php-di": "6.4.0",
Expand All @@ -21,5 +21,10 @@
"psr-4": {
"App\\": "src/"
}
},
"config": {
"allow-plugins": {
"php-http/discovery": false
}
}
}
8 changes: 8 additions & 0 deletions src/quoteservice/public/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@

use DI\Bridge\Slim\Bridge;
use DI\ContainerBuilder;
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
use OpenTelemetry\API\Common\Log\LoggerHolder;
use Psr\Log\LogLevel;
use Slim\Factory\AppFactory;

require __DIR__ . '/../vendor/autoload.php';

LoggerHolder::set(
new Logger('otel-php', [new StreamHandler('php://stdout', LogLevel::DEBUG)])
);

// Instantiate PHP-DI ContainerBuilder
$containerBuilder = new ContainerBuilder();

Expand Down