Commit Graph

712 Commits

Author SHA1 Message Date
Przemyslaw Delewski 4ff6ae4dbe
Updating CONTRIBUTING.md (#1194) 2023-12-19 10:14:38 +11:00
Tobias Bachert d4149990a3
Serialize protobuf enums as integer (#1192)
Spec: "Values of enum fields MUST be encoded as integer values."
2023-12-18 10:25:22 +11:00
Weslen Teche d8827f9681
Add Jaeger Propagator (#1188)
* jaeger propagator

* adjust readme

* add baggage and debug flag

* add units tests

* code review fixs and baggage separator

* update readme and register

* improve more tests

* fix php ci

* fix knowvalues jaeger baggage
2023-12-16 10:12:26 +11:00
Tobias Bachert d3765662f9
Add instrument advisory parameter (#1186)
* Add instrument advisory parameter

* Undo bucket boundaries change to preserve BC

"SDKs SHOULD use the default value when boundaries are not explicitly provided, unless they have good reasons to use something different (e.g. for backward compatibility reasons in a stable SDK release)."

* Add note that passing callback instead of advisory is deprecated
2023-12-13 13:03:10 +11:00
Tobias Bachert a6d15cf26e
Fix typo and deptrac rule (#1156)
* Fix typo "interal" -> "internal"
* Remove semconv from API deptrac ruleset
Removed in https://github.com/open-telemetry/opentelemetry-php/pull/965.
2023-12-08 09:54:20 +11:00
Jeremy Nikitin a568dde3f3
Rename XCloudTrace to CloudTrace (#1142) 2023-11-27 15:26:07 +11:00
Brett McBride 28657a9ec1
generate semconv for 1.23.1 (#1145)
a bug in 1.23.0 meant that cloud, container and oci resource attributes were incorrectly published under trace attributes.
sort the attributes, so that future diffs are easier to read.
2023-11-22 09:12:22 +11:00
Jeremy Nikitin d6c4c89bf4
Implement GCP X-Cloud-Trace-Context Propagator (#1132) 2023-11-14 09:04:22 +11:00
Brett McBride 30b73d948c
generate semantic conventions for 1.23.0 (#1137) 2023-11-08 10:26:31 +11:00
Brett McBride 42a8b95501
adding 1.19->1.22 semconv traceattributes deprecations (#1129) 2023-10-20 07:10:44 +11:00
Brett McBride a325a8f0bd
update semconv to 1.22.0 (#1126)
* update semver to 1.22.0
Since 1.19.0, the source has been split out of opentelemetry-specifiction into semantic-conventions. Update the build script accordingly.
Update to latest generator.
Add 2 new deprecations for semconvs which were renamed since 1.19
* update telemetry semconv
2023-10-19 07:53:08 +11:00
Brett McBride 842aa4121d
update SemConv readme (#1128)
mention that tags align with the upstream semantic conventions repo
2023-10-19 07:49:03 +11:00
Weslen Teche f22ffa0137
improving more tests (#1127) 2023-10-15 12:06:52 +11:00
Weslen Teche ea86fe1891
fix: documentations links (#1125) 2023-10-13 11:48:23 +11:00
Roman Kovalev b5170bf202
chore: fix broken link to env specs (#1122) 2023-10-05 16:29:42 +11:00
Brett McBride 75bb45fa71
adding 8.2 + 8.3 to build matrix (#1107)
8.3 is in RC, so add it to the matrix.
bump 8.2 to non-experimental, which should have happened some time ago.
remove deprecated assert_options call from test bootstrap
2023-10-05 12:45:08 +11:00
Brett McBride 8809c2a0b5
remove global configuration resolver (#1118)
Exposing it through Globals can cause a race condition. If something (eg, a contrib module)
retrieves the configuration resolver from Globals too early during autoloading, then it
causes the rest of the objects from Globals to be initialized. This can happen before all
required modules have been registered (depending on autoload->files execution order, which
is variable). Instead, create a simple API config resolver which does the basics of what the
SDK one does (without all the type checking and validation).
2023-09-28 09:15:51 +10:00
Greg Pinnington 3032304c3b
Add 'Contributing' message (#1108)
Co-authored-by: RoBorg <roborg@gmail.com>
2023-09-05 13:38:44 +10:00
Brett McBride 1852d514ca
fixing some psalm 5 complaints (#1110)
Whilst investigating upgrading to psalm 5, I notice that it generates a lot of new complaints. This fixes the ones that looked legit and
require an API change, or were trivial. Does not upgrade to psalm 5 yet, though. That's a bigger job for another day.
2023-09-05 08:56:24 +10:00
Brett McBride 73ff5adcb8
refactor sdk/api logging (#1105)
send errors/warnings/etc by default through PHP's error_log. This gives more control to administrators, since error_log can
be configured to write to any stream (file, stderr, etc). I think it's also less surprising for people trying out otel (particularly
with development PHP settings, where trigger_error often breaks an application).
Adding a configuration value to control where logs go: OTEL_PHP_LOG_DESTINATION.
2023-08-31 09:39:33 +10:00
Brett McBride 197a7a4c2c
optional internal metrics (#1106)
adding a configuration option OTEL_PHP_INTERNAL_METRICS_ENABLED which
controls whether the SDK will emit its own metrics (eg batch processor
state).
2023-08-31 09:23:20 +10:00
Brett McBride 62a14d1c20
remove deprecated code and BC hacks (#1099)
in preparation for RC, removing deprecations and BC hacks so that we have a clean slate for 1.0.0
2023-08-16 21:51:46 +10:00
Brett McBride 82f0c4477e
move temporality into own interface (#1098)
per TC review, temporality is not part of MetricExporterInterface. Riffing on Java's solution, this moves
`temporality` into `AggregationTemporalitySelectorInterface`, and adds that interface to MetricExporter instances
that use it (everything except `NoopMetricExporter`).
2023-08-10 08:11:34 +10:00
Brett McBride 55c08f3f44
adding PushMetricExporterInterface (#1097)
https://github.com/open-telemetry/opentelemetry-specification/pull/3563 clarifies the behaviour of
forceFlush with push/non-push metric exporters.
Break forceFlush out into a PushMetricExporterInterface, and update ExportingReader to only collect/flush
if exporter is a push metric exporter.
2023-08-10 07:47:46 +10:00
Greg Pinnington 9f358617f1
Fix for maxRetries < 1 (#1094)
* Fix for maxRetries=0
* Don't loop infinitely for negative maxRetries
2023-08-08 14:12:26 +10:00
Greg Pinnington c61f148d64
OtlpHttpTransportFactory should pass all arguments to PsrTransportFactory (#1093)
Co-authored-by: RoBorg <roborg@gmail.com>
2023-08-02 21:26:10 +10:00
Brett McBride ff15cc7037
document that examplars are not stable (#1091)
noted in TC review. Java moved their examplar code into an internal package, and
documented that it may change. We don't have an internal package, so document
the warning in a few places.
2023-08-01 08:09:07 +10:00
Brett McBride 7b8daff5ef
adding configuration resolver (#1083)
adding a configuration resolver interface, and api+sdk implementations. the resolver is globally configured.
this allows contrib modules to fetch config if an SDK is installed, without directly using the SDK (per spec).
2023-07-31 13:43:09 +10:00
Levi Morrison 1905dbfcd5
fix: fiber observers by FFI are not safe on ZTS (#1090)
They aren't _truly_ safe on NTS builds either, as the functions used
are only expected to be set at certain times of the lifecycle, but in
practice it's safe enough on NTS.

However, for ZTS, these APIs are not safe to call at runtime at all.
2023-07-26 09:47:28 +10:00
Brett McBride 4d9720f19e
improving test coverage (#1084) 2023-07-20 09:31:32 +10:00
Brett McBride 29cff8b991
fixing minor static analysis complaints (#1080)
fixing static analysis complaints, most of which were from psalm
when run with --show-info
remove deprecated httplug discovery
static data providers (phpunit10 requirement)
2023-07-20 09:30:31 +10:00
Tobias Bachert 926f6e5583
Always weaken asynchronous callbacks (#1081)
* Always weaken asynchronous callbacks
* Update comment regarding weak callbacks
2023-07-17 08:42:06 +10:00
Tobias Bachert cf8be76463
Remove workaround for php GH-8995 (#1082) 2023-07-17 08:38:33 +10:00
Brett McBride a60d0ad80c
rename log record processors (#1073)
per TC review, align log record processor names with those used in the spec
2023-07-11 09:37:28 +10:00
Brett McBride da219a9829
handle KeyValue otlp attributes (#1077)
if an array is non-simple (has keys), it should be represented as a KeyValue in the generated
protobuf-encoded output.
Since we also need to support simple arrays of primitives, I've added a basic check so that
those are still represented as ArrayValue.
2023-07-11 09:36:39 +10:00
Brett McBride 5853adabf1
phpdocs and example of weakening metric observer (#1078) 2023-07-11 09:36:04 +10:00
Brett McBride c9c83117e7
refactor attribute validation (#1072)
moving private method into a testable class, introduce attribute validation class
which applies to most attribute. LogRecord attributes are allowed to be complex,
so introduce a validator for these which lets everything through.
2023-07-11 09:35:24 +10:00
Brett McBride 3246ca8e4d
set schemaUrl for logs output (#1071) 2023-07-11 09:26:40 +10:00
Brett McBride cc92a07eac
update proto files to 1.0.0 (#1070)
no change from 0.20.0 (which was a release candidate)
2023-07-05 08:02:44 -04:00
Brett McBride 638799275c
require google/protobuf (native) (#1067)
We made protobuf implementation optional back in #949 however it seems to be tripping up
a number of developers. Since native + extension can be installed at the same time (with
extension taking priority), I think that users will be less surprised when starting out
if there is a working implementation by default.
2023-07-04 14:47:34 +10:00
Brett McBride 5e827ab7fc
improve logs console output (#1060)
support multiple scopes in console log output, and update batch example to illustrate
2023-07-04 14:46:57 +10:00
Brett McBride cb45b4a75d
fixing homogenous check for attributes with non-numeric keys (#1057)
use reset() instead of trying to get zero array key
2023-06-28 08:25:27 +02:00
Brett McBride d6e0689604
readme badges and cleanup (#1053)
* adding badges to the various readme files to make more obvious the current versions
* list all packages and versions in main readme
* remove old README documentation (excluding development-specific), and direct users to opentelemetry.io
* link to opentelemetry.io where possible in package readme
* adding a badge to link to releases
releases are not easy to find, since they exist only in the subtree split repository
2023-06-26 21:10:20 +10:00
Brett McBride a0601c41ec
adding sdk console metrics exporter (#1055)
to make getting started easier (in opentelemetry.io docs), create an sdk-based metrics
exporter. this means we can export all signals without needing a protobuf implementation.
since console export is only useful for playing around, the change in format to a
simpler human-readable output seems reasonable.
2023-06-26 20:59:08 +10:00
Brett McBride dc9501e8a9
adding support info to composer.json files (#1054) 2023-06-26 20:57:52 +10:00
Brett McBride 49638eae02
deprecate sdk/common/dsn (#1037)
I can't find any usage of these classes anywhere in main or contrib repo. rather than delete, lets deprecate and remove closer to release candidate
2023-06-23 21:02:56 +10:00
Brett McBride 58e19760e3
fixing broken links (#1052)
* fixing broken link in logs readme
* typo
* another broken link
2023-06-23 21:00:17 +10:00
Brett McBride 51137bfea6
adding support info to sdk composer (#1036)
* adding some links to try to make it easier for users to find the right support/repositories etc
just doing one composer file to see if it works, and will follow-up with more in a later PR
* change forum to chat
2023-06-23 17:49:28 +10:00
Brett McBride fed6413a76
moving some otlp code out of sdk (#1039)
otlp exporter code belongs in contrib/otlp
2023-06-23 10:31:32 +10:00
Brett McBride 4913926ec1
error log backtrace and OTEL_LOG_LEVEL support (#1043)
* Adding a backtrace to the errors reported via error_log (which is the default)
* Implement OTEL_LOG_LEVEL, which can be used to control which errors are reported via error_log. Note that
this doesn't use configuration code from the SDK, as the usage is in the API (because messages are logged
from many packages) and deptrac rightly complains about the dependency on SDK.
2023-06-23 10:30:46 +10:00