Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [8.1.0]

- Adds OpenTelemetry support for the plugin interface
- Adds `updateConfigJsonFromEnv` for the plugin interface

## [8.0.2]

- Adds back `implementationDependencies.json` file, but now it is generated by the build process
Expand Down
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java-library'
}

version = "8.0.2"
version = "8.1.0"

repositories {
mavenCentral()
Expand All @@ -27,4 +27,4 @@ tasks.register('copyJars', Copy) {

test {
systemProperty 'noSetup', System.getProperty('noSetup')
}
}
5 changes: 4 additions & 1 deletion src/main/java/io/supertokens/pluginInterface/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import io.supertokens.pluginInterface.multitenancy.AppIdentifier;
import io.supertokens.pluginInterface.multitenancy.TenantIdentifier;
import io.supertokens.pluginInterface.multitenancy.exceptions.TenantOrAppNotFoundException;
import io.supertokens.pluginInterface.opentelemetry.OtelProvider;

import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -52,7 +53,7 @@ void loadConfig(JsonObject jsonConfig, Set<LOG_LEVEL> logLevels, TenantIdentifie
// then this function should throw an error since this is a misconfig from ther user's side.
void assertThatConfigFromSameUserPoolIsNotConflicting(JsonObject otherConfig) throws InvalidConfigException;

void initFileLogging(String infoLogPath, String errorLogPath);
void initFileLogging(String infoLogPath, String errorLogPath, OtelProvider otelProvider);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API Breaking Change: Modifying the initFileLogging method signature adds a required parameter that will break backward compatibility with existing implementations of the Storage interface. Consider one of these approaches:

  1. Create an overloaded method that maintains the original signature and internally calls the new implementation with a default value
  2. Provide a default implementation (if using Java 8+)
  3. Ensure all implementations are updated simultaneously with this change

This change requires careful coordination to prevent runtime errors when existing code calls this interface method.

Suggested change
void initFileLogging(String infoLogPath, String errorLogPath, OtelProvider otelProvider);
void initFileLogging(String infoLogPath, String errorLogPath);
void initFileLogging(String infoLogPath, String errorLogPath, OtelProvider otelProvider);

Spotted by Diamond

Is this helpful? React 👍 or 👎 to let us know.


void stopLogging();

Expand All @@ -74,6 +75,8 @@ void setKeyValue(TenantIdentifier tenantIdentifier, String key, KeyValueInfo inf

void setStorageLayerEnabled(boolean enabled);

void updateConfigJsonFromEnv(JsonObject configJson);

boolean canBeUsed(JsonObject configJson) throws InvalidConfigException;

// this function will be used in the createUserIdMapping and deleteUserIdMapping functions to check if the userId is
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* 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 io.supertokens.pluginInterface.multitenancy.TenantIdentifier;

import java.util.Map;

public interface OtelProvider {
static final String RESOURCE_ID = "io.supertokens.telemetry.TelemetryProvider";

public void createLogEvent(TenantIdentifier tenantIdentifier, String logMessage, String logLevel);
public void createLogEvent(TenantIdentifier tenantIdentifier, String logMessage, String logLevel, Map<String, String> additionalAttributes);
}