From 86cc97d3a2074245514cba19aacc58745ee8189c Mon Sep 17 00:00:00 2001 From: tamassoltesz Date: Thu, 25 Sep 2025 22:28:12 +0200 Subject: [PATCH 1/3] feat: annotation for aspect weaving marker --- .../multitenancy/AppIdentifier.java | 16 ++++------- .../multitenancy/TenantIdentifier.java | 7 +++-- .../opentelemetry/WithinOtelSpan.java | 27 +++++++++++++++++++ 3 files changed, 37 insertions(+), 13 deletions(-) create mode 100644 src/main/java/io/supertokens/pluginInterface/opentelemetry/WithinOtelSpan.java diff --git a/src/main/java/io/supertokens/pluginInterface/multitenancy/AppIdentifier.java b/src/main/java/io/supertokens/pluginInterface/multitenancy/AppIdentifier.java index 9241ccf3..d11ca82b 100644 --- a/src/main/java/io/supertokens/pluginInterface/multitenancy/AppIdentifier.java +++ b/src/main/java/io/supertokens/pluginInterface/multitenancy/AppIdentifier.java @@ -16,17 +16,6 @@ package io.supertokens.pluginInterface.multitenancy; -import io.supertokens.pluginInterface.STORAGE_TYPE; -import io.supertokens.pluginInterface.Storage; -import io.supertokens.pluginInterface.authRecipe.AuthRecipeStorage; -import io.supertokens.pluginInterface.emailpassword.sqlStorage.EmailPasswordSQLStorage; -import io.supertokens.pluginInterface.emailverification.sqlStorage.EmailVerificationSQLStorage; -import io.supertokens.pluginInterface.multitenancy.exceptions.TenantOrAppNotFoundException; -import io.supertokens.pluginInterface.session.SessionStorage; -import io.supertokens.pluginInterface.useridmapping.UserIdMappingStorage; -import io.supertokens.pluginInterface.usermetadata.sqlStorage.UserMetadataSQLStorage; -import io.supertokens.pluginInterface.userroles.sqlStorage.UserRolesSQLStorage; - import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -77,6 +66,11 @@ public int hashCode() { this.getAppId()).hashCode(); } + @Override + public String toString() { + return getConnectionUriDomain() + " | " + getAppId(); + } + public TenantIdentifier getAsPublicTenantIdentifier() { return new TenantIdentifier(this.getConnectionUriDomain(), this.getAppId(), null); } diff --git a/src/main/java/io/supertokens/pluginInterface/multitenancy/TenantIdentifier.java b/src/main/java/io/supertokens/pluginInterface/multitenancy/TenantIdentifier.java index ad782b1d..dd320473 100644 --- a/src/main/java/io/supertokens/pluginInterface/multitenancy/TenantIdentifier.java +++ b/src/main/java/io/supertokens/pluginInterface/multitenancy/TenantIdentifier.java @@ -16,8 +16,6 @@ package io.supertokens.pluginInterface.multitenancy; -import io.supertokens.pluginInterface.Storage; - import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -84,6 +82,11 @@ public int hashCode() { this.getAppId()).hashCode(); } + @Override + public String toString() { + return getConnectionUriDomain() + " | " + getAppId() + " | " + getTenantId(); + } + public AppIdentifier toAppIdentifier() { return new AppIdentifier(this.getConnectionUriDomain(), this.getAppId()); } diff --git a/src/main/java/io/supertokens/pluginInterface/opentelemetry/WithinOtelSpan.java b/src/main/java/io/supertokens/pluginInterface/opentelemetry/WithinOtelSpan.java new file mode 100644 index 00000000..5b87c821 --- /dev/null +++ b/src/main/java/io/supertokens/pluginInterface/opentelemetry/WithinOtelSpan.java @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2025, VRAI Labs and/or its affiliates. All rights reserved. + * + * This software is licensed under the Apache License, Version 2.0 (the + * "License") as published by the Apache Software Foundation. + * + * You may not use this file except in compliance with the License. You may + * obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + +package io.supertokens.pluginInterface.opentelemetry; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Target({ElementType.METHOD, ElementType.TYPE}) +@Retention(RetentionPolicy.RUNTIME) +public @interface WithinOtelSpan { +} From 7513e77a1209435871b47208199f819a3d020b23 Mon Sep 17 00:00:00 2001 From: tamassoltesz Date: Mon, 6 Oct 2025 14:37:41 +0200 Subject: [PATCH 2/3] fix: changelog and build version --- CHANGELOG.md | 4 ++++ build.gradle | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99dcc9c4..ec5710bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +## [8.1.1] + +- Adds OpenTelemetry javaagent support + ## [8.1.0] - Adds OpenTelemetry support for the plugin interface diff --git a/build.gradle b/build.gradle index eeee1fe1..b8491832 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ plugins { id 'java-library' } -version = "8.1.0" +version = "8.1.1" repositories { mavenCentral() From 46ba4578dc8cace8f10b34ab70977a29af0757bd Mon Sep 17 00:00:00 2001 From: tamassoltesz Date: Wed, 22 Oct 2025 11:17:09 +0200 Subject: [PATCH 3/3] fix: update build version --- CHANGELOG.md | 2 +- build.gradle | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec5710bf..931d87df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] -## [8.1.1] +## [8.2.0] - Adds OpenTelemetry javaagent support diff --git a/build.gradle b/build.gradle index b8491832..18746ad6 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ plugins { id 'java-library' } -version = "8.1.1" +version = "8.2.0" repositories { mavenCentral()