* feat: add telemetry helper utils
Signed-off-by: liran2000 <liran2000@gmail.com>
* updates
Signed-off-by: liran2000 <liran2000@gmail.com>
* fixup: apply changes according to the semconv
The semconv has changed, and some attributes have been
renamed. Furthermore, the body usage is deprecated
and should be part of the attributes.
see: https://github.com/open-telemetry/semantic-conventions/pull/1990/
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
* fixup: fix tests
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
* fixup: fix spotless
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
---------
Signed-off-by: liran2000 <liran2000@gmail.com>
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
Co-authored-by: Simon Schrottner <simon.schrottner@dynatrace.com>
Our tests are great, but often we rely on our own Singelton for testing purposes.
This can create concurrency issues or make testing really hard.
By instantiating a own API object for each test we ensure that we are not messing
with each other.
Furthermore we should not use `.getInstance()` within our own implementation.
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
* Move event emitting off the main thread to avoid deadlocks
When stacking event emitting inside an EventProvider, when using sychronization
the EventProvider can deadlock, to avoid this move the event emitting of the
main thread.
Signed-off-by: Philipp Fehre <philipp@fehre.co.uk>
* Test fixes
Test provider should respect the init-delay during all test
Signed-off-by: Philipp Fehre <philipp@fehre.co.uk>
* Add timeout to EventProviderTest
With the events being executed on a different thread, we need to wait to make
sure the thread is scheduled to have the events emitted.
Signed-off-by: Philipp Fehre <philipp@fehre.co.uk>
* Don't reuse the JVM Process
Signed-off-by: Philipp Fehre <philipp@fehre.co.uk>
---------
Signed-off-by: Philipp Fehre <philipp@fehre.co.uk>
Co-authored-by: Philipp Fehre <philipp.fehre@mollie.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
* Allowing flowcontrol with out exceptions
So far we used exception to handle our flowcontrol, but
Exceptions are costly. In the end we enriched our
evaluation Details with errorCode and errorMessage.
This can be also handled by the providers if desired,
to reduce the execution footprint in errornous cases,
which do not have to be exceptions.
Eg FlagNotFound - it might be the case, but in performance
critical environments, an exception rather than a normal
return, can cause overhead and can be already too costly.
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
* fix: adding reason, and removing stacktraces from errors
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
* Update src/main/java/dev/openfeature/sdk/exceptions/TypeMismatchError.java
Co-authored-by: Justin Abrahms <justin@abrah.ms>
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
---------
Signed-off-by: Simon Schrottner <simon.schrottner@dynatrace.com>
Co-authored-by: Justin Abrahms <justin@abrah.ms>
* fix: Use ConcurrentHashMap for InMemoryProvider
Signed-off-by: Ryan Prayogo <57620+ryanprayogo@users.noreply.github.com>
* fix: make the flags field variable final
Signed-off-by: Ryan Prayogo <57620+ryanprayogo@users.noreply.github.com>
* chore: Use Collections.singletonList instead of Arrays.asList
Signed-off-by: Ryan Prayogo <57620+ryanprayogo@users.noreply.github.com>
* chore: Update javadoc and parameter name
Signed-off-by: Ryan Prayogo <57620+ryanprayogo@users.noreply.github.com>
* fixup: await verify
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
* fixup: remove test, key diffing
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
---------
Signed-off-by: Ryan Prayogo <57620+ryanprayogo@users.noreply.github.com>
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>
* fix: issue #859 Added failing tests
Signed-off-by: Adam Roberts <adam.roberts@collibra.com>
* fix: issue #859 Fixed the logic to allow the tests to pass by copying the passed in attributes
Signed-off-by: Adam Roberts <adam.roberts@collibra.com>
---------
Signed-off-by: Adam Roberts <adam.roberts@collibra.com>
* feat: implement spec 0.7.0 changes
* run any event handler immediately if the provider is in the associated state, not just ready
* add providerName to event details
* add STALE provider state
* update/add associated tests
* also fixed spec/test associations mismatches from previous changes
Signed-off-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Thiyagu GK <thiyagu103@gmail.com>
* feat: spec 1.1.8 - setProviderAndWait
The API SHOULD provide functions to set a provider and wait for the initialize function to return or throw
Signed-off-by: liran2000 <liran2000@gmail.com>
* remove method overloading from package private class
Signed-off-by: liran2000 <liran2000@gmail.com>
* add test case for spec 2.4.5
Signed-off-by: liran2000 <liran2000@gmail.com>
* minor updates
Signed-off-by: liran2000 <liran2000@gmail.com>
---------
Signed-off-by: liran2000 <liran2000@gmail.com>
Co-authored-by: Todd Baert <todd.baert@dynatrace.com>
Co-authored-by: Michael Beemer <beeme1mr@users.noreply.github.com>