-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3bfa1c
commit 50d181f
Showing
8 changed files
with
153 additions
and
4 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
docs/apidiffs/current_vs_latest/opentelemetry-instrumentation-annotations.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Comparing source compatibility of opentelemetry-instrumentation-annotations-2.11.0.jar against opentelemetry-instrumentation-annotations-2.10.0.jar | ||
Comparing source compatibility of opentelemetry-instrumentation-annotations-2.11.0.jar against opentelemetry-instrumentation-annotations-2.11.0.jar | ||
No changes. |
2 changes: 1 addition & 1 deletion
2
docs/apidiffs/current_vs_latest/opentelemetry-instrumentation-api.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Comparing source compatibility of opentelemetry-instrumentation-api-2.11.0.jar against opentelemetry-instrumentation-api-2.10.0.jar | ||
Comparing source compatibility of opentelemetry-instrumentation-api-2.11.0.jar against opentelemetry-instrumentation-api-2.11.0.jar | ||
No changes. |
2 changes: 1 addition & 1 deletion
2
docs/apidiffs/current_vs_latest/opentelemetry-spring-boot-autoconfigure.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Comparing source compatibility of opentelemetry-spring-boot-autoconfigure-2.11.0.jar against opentelemetry-spring-boot-autoconfigure-2.10.0.jar | ||
Comparing source compatibility of opentelemetry-spring-boot-autoconfigure-2.11.0.jar against opentelemetry-spring-boot-autoconfigure-2.11.0.jar | ||
No changes. |
2 changes: 1 addition & 1 deletion
2
docs/apidiffs/current_vs_latest/opentelemetry-spring-boot-starter.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
Comparing source compatibility of opentelemetry-spring-boot-starter-2.11.0.jar against opentelemetry-spring-boot-starter-2.10.0.jar | ||
Comparing source compatibility of opentelemetry-spring-boot-starter-2.11.0.jar against opentelemetry-spring-boot-starter-2.11.0.jar | ||
No changes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
.../jdbc/library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/DbSetArgs.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.instrumentation.jdbc.internal; | ||
|
||
import java.util.HashMap; | ||
|
||
/** | ||
* This class is internal and is hence not for public use. Its APIs are unstable and can change at | ||
* any time. | ||
*/ | ||
public final class DbSetArgs { | ||
private HashMap<Integer, String> args; | ||
|
||
@SuppressWarnings("NonApiType") | ||
public DbSetArgs(HashMap<Integer, String> map) { | ||
this.args = map; | ||
} | ||
|
||
@SuppressWarnings("NonApiType") | ||
public HashMap<Integer, String> getArgs() { | ||
return this.args; | ||
} | ||
|
||
@SuppressWarnings("NonApiType") | ||
public void setArgs(HashMap<Integer, String> args) { | ||
this.args = args; | ||
} | ||
|
||
public void setArg(Integer index, String arg) { | ||
this.args.put(index, arg); | ||
} | ||
|
||
public void resetArgs() { | ||
this.args = new HashMap<Integer, String>(); | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
.../library/src/main/java/io/opentelemetry/instrumentation/jdbc/internal/JdbcAttributes.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Copyright The OpenTelemetry Authors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
package io.opentelemetry.instrumentation.jdbc.internal; | ||
|
||
import static io.opentelemetry.instrumentation.api.internal.AttributesExtractorUtil.internalSet; | ||
|
||
import io.opentelemetry.api.common.AttributeKey; | ||
import io.opentelemetry.api.common.AttributesBuilder; | ||
import io.opentelemetry.context.Context; | ||
import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; | ||
import java.util.Map; | ||
import javax.annotation.Nullable; | ||
|
||
/** | ||
* This class is internal and is hence not for public use. Its APIs are unstable and can change at | ||
* any time. | ||
*/ | ||
@SuppressWarnings("UnusedTypeParameter") | ||
public final class JdbcAttributes<REQUEST, RESPONSE> implements AttributesExtractor<REQUEST, RESPONSE> { | ||
|
||
private DbSetArgs args; | ||
|
||
private JdbcAttributes(){} | ||
|
||
public static JdbcAttributes<DbRequest, Void> create(DbSetArgs args) { | ||
JdbcAttributes<DbRequest, Void> j = new JdbcAttributes<>(); | ||
j.setArgs(args); | ||
return j; | ||
} | ||
|
||
private void setArgs(DbSetArgs args) { | ||
this.args = args; | ||
} | ||
|
||
@Override | ||
public void onStart(AttributesBuilder attributes, Context parentContext, REQUEST request) { | ||
if (this.args == null || this.args.getArgs()==null){ | ||
return; | ||
} | ||
StringBuilder sb = new StringBuilder(); | ||
for (Map.Entry<Integer,String> entry : args.getArgs().entrySet()) { | ||
// internalSet(attributes, AttributeKey.stringKey("origin_sql_"+entry.getKey()),entry.getValue()); | ||
sb.append("index_"). | ||
append(entry.getKey()). | ||
append(":"). | ||
append(entry.getValue()). | ||
append(", "); | ||
} | ||
internalSet(attributes, AttributeKey.stringKey("db_args"),sb.toString()); | ||
} | ||
|
||
@Override | ||
public void onEnd(AttributesBuilder attributes, Context context, REQUEST request, | ||
@Nullable RESPONSE response, @Nullable Throwable error) { | ||
} | ||
} |