Commit Graph

712 Commits

Author SHA1 Message Date
Brett McBride 29dc1a414f
fixing http client implementation (#1041)
We do not actually require an async http client, so use psr/http-client-implementation instead.
We depend on the psr/http-client interface, so require it (which has a side-effect of un-breaking
the symfony http client which is frequently auto-installed by php-http/discovery's plugin)
2023-06-23 10:24:12 +10:00
Brett McBride 8fe898bdb4
adding batch span processor builder (#1046) 2023-06-23 10:22:49 +10:00
Brett McBride 1caf77b436
fixing backwards-compatibility (#1044)
- sdk BC was not being loaded at all in the sdk package (only in the monorepo), so add it to autoload->files
- fixing api/common BC layer (removing .php and fixing one of the FQCNs)
2023-06-20 16:43:03 +10:00
Brett McBride 1aea1f23b9
moving api/common classes up to api (#1033)
- apply TC review feedback to move Globals to top-level.
it was suggested to move Instrumentation into its own package, but I chose instead to just move that dir
up to the top level of API
- added a BC layer to alias the moved classes
- added some more examples
2023-06-16 08:51:03 +10:00
Brett McBride d81874ed11
allow http/message 2 (#1034) 2023-06-15 16:35:51 +02:00
Brett McBride ea09e53519
drop attributes with non-homogenous array values (#1023)
per spec, arrays MUST contain only the same types. I've allowed for numeric types
(integer + double) to be treated as equivalent.
2023-06-09 09:34:20 +10:00
Brett McBride 22542528af
adding meter provider builder example (#1026)
adding an example using the meter provider builder, and deprecating a redundant method, `registerMetricReader`
2023-06-09 09:32:18 +10:00
Brett McBride e8ee4363e7
update proto to 0.20.0 (#1029) 2023-06-09 09:25:59 +10:00
Brett McBride 2601eaafe8
move trace flags consts into TraceFlags interface (#1028) 2023-06-07 22:34:13 +10:00
Brett McBride 32c161b167
rename span builder parameter (#1024)
TC feedback suggested to rename param to hint at the type (nano seconds)
2023-06-07 13:51:31 +02:00
Brett McBride 6a77cf5ba4
improve documented scope return values (#1025)
TC review suggests that DETACHED and INACTIVE responses need clarification
2023-06-07 13:49:12 +02:00
Brett McBride 23cc194da1
psalm check examples (#1006)
Configure psalm to run over all examples, and fixing the issues it identified.
2023-05-31 08:13:35 +02:00
Brett McBride 1b63a3b1c3
adding console metric exporter (#1005)
allow the existing metric exporter to be created from env vars, by creating a factory
and registering it against 'console'. Now, OTEL_METRICS_EXPORTER=console will create
a metrics provider with console output. Note that it lives in contrib/otlp, since it
uses the existing otlp converters.
2023-05-17 10:41:55 +10:00
Brett McBride 82b30dc437
remove container detector (#1004)
per spec, container detector has been moved into contrib and is published as a composer package
2023-05-17 08:34:51 +10:00
Brett McBride 65491ab66b
adding resource detectors to registry (#999)
To enable registering non-SDK resource detectors within the SDK, extend the SDK Registry.
Detectors will be looked up by name and applied as part of 'all', or as part of a list
of detectors
2023-05-10 09:16:45 +10:00
Brett McBride 5d35c998e7
remove proprietary new relic exporters (#998)
New Relic now fully supports OTLP ingestion, and having proprietary exporters is no longer their strategy. The proprietary exporters have been marked as abandoned in packagist, and suggest exporter-otlp as a replacement.
2023-05-09 20:20:50 +10:00
Brett McBride 593fa344bc
removing prometheus example (#996)
the example is very old, does not work, and it doesn't look like the capability
is in the spec these days. Remove the code so that it doesn't cause confusion.
2023-05-08 19:51:22 +10:00
Tobias Bachert e7be05c73e
Fix `weaken()` scope not preserved for first class callables when scope not equals target class (#995) 2023-05-08 09:17:00 +10:00
Brett McBride bd02259089
resourceinfo spec compliance, instrumentation attribute (#989)
Introduce spec-compliant ResourceInfo::merge, and deprecate our current implementation.
When merging resources, later (updating) keys should override existing keys, per spec.
Reorganise detectors so that environment has highest priority (per spec, OTEL_SERVICE_NAME should be the highest priority built-in way of setting service name)
Adding the experimental telemetry.auto.version attribute, if the auto-instrumentation extension is installed.
2023-05-08 09:15:45 +10:00
Brett McBride efe696f285
temporality preference from env (#990)
Implement OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE, which controls the temporality of meters when creating from environment vars.
Add OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION to variables, although we do not yet have anything that uses it.
2023-05-05 09:32:14 +10:00
Brett McBride c701693c25
remove 'include context' parameter from logging examples (#992)
the param was removed from spec, and our API implementation recently, but
I missed these examples.
2023-05-04 16:35:24 +02:00
Brett McBride 952c069792
adding batch LogRecord processor env config (#991)
Adding new spec variables for configuring batch LogRecord processor from environment.
2023-05-04 10:58:07 +10:00
Tobias Bachert 1976f53f92
Add branch aliases (#988) 2023-05-03 08:59:57 +10:00
Brett McBride 4890bd4a27
dotenv file plus rector (#983)
use docker compose 'env_file' to include all .env file vars in container env
make the default rector action dry-run, which allows developers to inspect code changes
before applying them (and therefore giving the option to disable new rules before they
are applied to WIP).
2023-05-02 19:53:04 +10:00
Tobias Bachert 77da9503fb
Use noop staleness handler factory by default (#987) 2023-04-30 20:06:59 +10:00
Tobias Bachert a7a28616b2
Move metric collection to `MeterProvider`-wide registry (#979)
* Add metric registry
* Use metric registry to record and collect metrics
* Minor cleanup
2023-04-27 08:15:20 +10:00
Brett McBride 6fd6a3c180
adding local dev prefer-lowest (#976)
Adding some make targets which will install composer dependencies with the lowest
package versions. This highlights some small issues with older versions, so bump up
the minimums of a few dev dependencies.

Adding more make targets:
- all-lowest (run all checks after updating with --prefer-lowest)
- all-checks (run all checks without first running a composer update)
- update-lowest (update dependencies to lowest installable versions)

Quieten unit test output (the previous testdox output is available via `make test-verbose`)
2023-04-27 08:14:56 +10:00
Brett McBride 9bccde9f03
update semantic conventions to v1.19 (#965)
* update semantic conventions to v1.19
* updating semconv readme
* dropping attribute values
I can't find any usage of the various AttributeValues being used, and other SIGs
no longer generate them, so removing them
* removing semconv usage from API
allow deprecations of moved/removed attributes so that we don't break things across different
semconv versions (similar to how java does it, except I moved them into a file which is
imported
2023-04-27 08:13:26 +10:00
Brett McBride 80ac91fddd
fixing symfony link in readme (#982) 2023-04-26 07:13:23 +02:00
Brett McBride 659a705d95
relax default logging levels (#975)
without a psr-3 logger, we use trigger_error. Using this with E_USER_ERROR is fatal, so adjust the level down.
2023-04-19 17:21:16 +02:00
Brett McBride 8f70a6d19f
apply logging spec updates (#977)
Removing include_trace_context parameter
Set ObservedTimestamp on emit if not already set
Rename logRecord to emit
2023-04-18 14:43:09 +02:00
Tobias Bachert 0e61e95f3c
Fix otlp json trace id and span id (#973)
* Fix otlp json trace id and span id format

* Ignore unknown fields in otlp json response

* Suppress incorrect phan error
2023-04-18 14:08:20 +02:00
Tobias Bachert 23762dbbd3
Split metric collection from metric streams (#972)
Split metric collection from metric streams
2023-04-15 22:09:43 +10:00
Brett McBride a06e5e4e45
Multiple log processors (#967)
adding support for multiple log processors
2023-04-15 09:27:50 +10:00
Brett McBride c687df160d
report dropped counts in non-otel exporters (#966)
per spec, exporters MUST report on dropped attributes/links/events using keys defined in spec
2023-04-15 09:25:44 +10:00
Brett McBride e22007a98e
documenting logs bridge api, adding memory exporter (#959)
* implement bridge api

* adding logs memory exporter

* clarify bridge api not for developers

* adding logger provider builder

* review feedback

* removing Bridge and documenting what a bridge is
2023-04-12 08:06:41 -04:00
Brett McBride 653a726959
new rector rules (#964)
apply one new rector rule, and disable FlipTypeControlToUseExclusiveTypeRector (which changes about 40 files, and IMO makes it harder to comprehend)
2023-04-07 12:36:40 +10:00
Cedric Ziel ca2df9f307
Update publish-otel-php-base-docker-image.yml (#961)
Use correct arm64 platform for building docker images.

My previous PR in #960 used the wrong platform for M1/Apple silicon
2023-04-05 18:55:19 -04:00
Cedric Ziel 72e9f56fbb
Build arm64 base images (#960) 2023-04-05 14:58:02 -04:00
Brett McBride 502df0eded
adding LogRecord phpdocs (#956)
clarify that timestamps expect timestamp in nanoseconds, plus minor logging example fixes.
2023-04-05 22:42:42 +10:00
Piotr Antosik a3abdcdb0d
add composer resource detector defaults (#952)
- add composer to defaults
- update readme: missing info about container & composer
2023-04-05 12:18:57 +10:00
Brett McBride 0a6d7cb8e4
fail if no protobuf implementation found (#958)
the otlp exporters (logs, metrics, traces) will fail to export if there is no protobuf implementation (which we have
just made optional, to allow users to choose between extension and native). Add a check to
the constructors which will throw a runtime exception.
If creating the exporter directly, it will be uncaught. If using a factory, it will report a
warning and return a no-op exporter.
2023-04-05 10:02:44 +10:00
Brett McBride dd23c8d0ea
pre-GA doco cleanup (#946)
moving lots of documentation into opentelemetry.io, which is
the official source and where we should send people in the
first instance.
2023-04-02 21:00:34 +10:00
Sem Schilder 711ebf98c6
Rename extension (#955) 2023-04-01 12:48:42 +02:00
Sem Schilder 4544cbd94a
Make protobuf implementation optional (#949)
* 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
2023-03-30 20:16:18 +11:00
Brett McBride 83bacc9d40
remove create_releases script (#945)
create_releases has been replaced by an improved version in https://github.com/opentelemetry-php/dev-tools
2023-03-29 08:02:36 -04:00
Cedric Ziel a2a4d4d0a1
Ensure base64 encoded values can be used as headers from env (#943)
This change instructs explode to extract at most 2 parts.

Given an example value of 
```
OTEL_EXPORTER_OTLP_HEADERS=Authorization=Basic bla64=
```

The config parser would have created the elements, where only two are required. The trailing `=` in base64 headers would then have been effectively discarded, leading to invalid configuration.
2023-03-27 09:16:47 +11:00
Brett McBride c899f08dc1
adding brettmc company affiliation (#942) 2023-03-25 08:16:07 -04:00
Brett McBride 41945220b9
do not gitsplit sdk-contrib or tags (#939)
sdk-contrib is abandoned in packagist, because we publish the packages individually
and at independent versions. for the same reason, do not gitsplit tags, only main
as we do the tagging in the read-only repos now
2023-03-23 20:56:35 +11:00
Przemyslaw Delewski ac1d03784f
open stream failure (#940)
* open stream failure

* Update src/SDK/Resource/Detectors/Container.php

Co-authored-by: Tobias Bachert <git@b-privat.de>

---------

Co-authored-by: Tobias Bachert <git@b-privat.de>
2023-03-22 19:31:01 +01:00