Skip to content

Commit f4ad1a4

Browse files
feat: add hikari logs to otel (#179)
* feat: add hikari logs to otel * Update build.gradle * fix: update config from env * fix: changelog --------- Co-authored-by: Sattvik Chakravarthy <[email protected]> Co-authored-by: Sattvik Chakravarthy <[email protected]>
1 parent ca7ce2a commit f4ad1a4

File tree

4 files changed

+39
-3
lines changed

4 files changed

+39
-3
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
99

10+
## [8.1.0]
11+
12+
- Adds OpenTelemetry support for the plugin interface
13+
- Adds `updateConfigJsonFromEnv` for the plugin interface
14+
1015
## [8.0.2]
1116

1217
- Adds back `implementationDependencies.json` file, but now it is generated by the build process

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ plugins {
22
id 'java-library'
33
}
44

5-
version = "8.0.2"
5+
version = "8.1.0"
66

77
repositories {
88
mavenCentral()
@@ -27,4 +27,4 @@ tasks.register('copyJars', Copy) {
2727

2828
test {
2929
systemProperty 'noSetup', System.getProperty('noSetup')
30-
}
30+
}

src/main/java/io/supertokens/pluginInterface/Storage.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import io.supertokens.pluginInterface.multitenancy.AppIdentifier;
2525
import io.supertokens.pluginInterface.multitenancy.TenantIdentifier;
2626
import io.supertokens.pluginInterface.multitenancy.exceptions.TenantOrAppNotFoundException;
27+
import io.supertokens.pluginInterface.opentelemetry.OtelProvider;
2728

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

55-
void initFileLogging(String infoLogPath, String errorLogPath);
56+
void initFileLogging(String infoLogPath, String errorLogPath, OtelProvider otelProvider);
5657

5758
void stopLogging();
5859

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

7576
void setStorageLayerEnabled(boolean enabled);
7677

78+
void updateConfigJsonFromEnv(JsonObject configJson);
79+
7780
boolean canBeUsed(JsonObject configJson) throws InvalidConfigException;
7881

7982
// this function will be used in the createUserIdMapping and deleteUserIdMapping functions to check if the userId is
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
* Copyright (c) 2025, VRAI Labs and/or its affiliates. All rights reserved.
3+
*
4+
* This software is licensed under the Apache License, Version 2.0 (the
5+
* "License") as published by the Apache Software Foundation.
6+
*
7+
* You may not use this file except in compliance with the License. You may
8+
* obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13+
* License for the specific language governing permissions and limitations
14+
* under the License.
15+
*/
16+
17+
package io.supertokens.pluginInterface.opentelemetry;
18+
19+
import io.supertokens.pluginInterface.multitenancy.TenantIdentifier;
20+
21+
import java.util.Map;
22+
23+
public interface OtelProvider {
24+
static final String RESOURCE_ID = "io.supertokens.telemetry.TelemetryProvider";
25+
26+
public void createLogEvent(TenantIdentifier tenantIdentifier, String logMessage, String logLevel);
27+
public void createLogEvent(TenantIdentifier tenantIdentifier, String logMessage, String logLevel, Map<String, String> additionalAttributes);
28+
}

0 commit comments

Comments
 (0)