Skip to content

Commit

Permalink
Added schema URL for all packages lower than 1.0.0 (#273)
Browse files Browse the repository at this point in the history
  • Loading branch information
weslenteche authored Jun 25, 2024
1 parent bd28407 commit 9dec658
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 15 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"require": {
"php": "^8.0",
"ext-opentelemetry": "*",
"open-telemetry/api": ">=1.0.0RC2",
"open-telemetry/sem-conv": "^1.23",
"open-telemetry/api": "^1.0",
"open-telemetry/sem-conv": "^1.24",
"psr/log": "^1 || ^2 || ^3"
},
"autoload": {
Expand Down
6 changes: 5 additions & 1 deletion src/Psr3Instrumentation.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ public static function register(): void
break;
case self::MODE_EXPORT:
static $instrumentation;
$instrumentation ??= new CachedInstrumentation('psr3');
$instrumentation ??= new CachedInstrumentation(
'io.opentelemetry.contrib.php.psr3',
null,
'https://opentelemetry.io/schemas/1.24.0'
);
if ($function === 'log') {
$level = $params[0];
$body = $params[1] ?? '';
Expand Down
4 changes: 2 additions & 2 deletions tests/phpt/export_apix.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ $span->end();
},
"scopes": [
{
"name": "psr3",
"name": "io.opentelemetry.contrib.php.psr3",
"version": null,
"attributes": [],
"dropped_attributes_count": 0,
"schema_url": null,
"schema_url": "https:\/\/opentelemetry.io\/schemas\/1.24.0",
"logs": [
{
"timestamp": null,
Expand Down
4 changes: 2 additions & 2 deletions tests/phpt/export_cake.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ $span->end();
},
"scopes": [
{
"name": "psr3",
"name": "io.opentelemetry.contrib.php.psr3",
"version": null,
"attributes": [],
"dropped_attributes_count": 0,
"schema_url": null,
"schema_url": "https:\/\/opentelemetry.io\/schemas\/1.24.0",
"logs": [
{
"timestamp": null,
Expand Down
4 changes: 2 additions & 2 deletions tests/phpt/export_monolog.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ $span->end();
},
"scopes": [
{
"name": "psr3",
"name": "io.opentelemetry.contrib.php.psr3",
"version": null,
"attributes": [],
"dropped_attributes_count": 0,
"schema_url": null,
"schema_url": "https:\/\/opentelemetry.io\/schemas\/1.24.0",
"logs": [
{
"timestamp": null,
Expand Down
4 changes: 2 additions & 2 deletions tests/phpt/export_multi.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ category: '%s'
},
"scopes": [
{
"name": "psr3",
"name": "io.opentelemetry.contrib.php.psr3",
"version": null,
"attributes": [],
"dropped_attributes_count": 0,
"schema_url": null,
"schema_url": "https:\/\/opentelemetry.io\/schemas\/1.24.0",
"logs": [
{
"timestamp": null,
Expand Down
4 changes: 2 additions & 2 deletions tests/phpt/export_symfony.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ $span->end();
},
"scopes": [
{
"name": "psr3",
"name": "io.opentelemetry.contrib.php.psr3",
"version": null,
"attributes": [],
"dropped_attributes_count": 0,
"schema_url": null,
"schema_url": "https:\/\/opentelemetry.io\/schemas\/1.24.0",
"logs": [
{
"timestamp": null,
Expand Down
4 changes: 2 additions & 2 deletions tests/phpt/export_yii.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ category: '%s'
},
"scopes": [
{
"name": "psr3",
"name": "io.opentelemetry.contrib.php.psr3",
"version": null,
"attributes": [],
"dropped_attributes_count": 0,
"schema_url": null,
"schema_url": "https:\/\/opentelemetry.io\/schemas\/1.24.0",
"logs": [
{
"timestamp": null,
Expand Down

0 comments on commit 9dec658

Please sign in to comment.