-
Notifications
You must be signed in to change notification settings - Fork 1k
Db error type #13640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Db error type #13640
Changes from 4 commits
81f3150
5dc4f51
aeb5b6b
f89d54b
507442b
8ab9374
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| /* | ||
| * Copyright The OpenTelemetry Authors | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| package io.opentelemetry.instrumentation.api.incubator.semconv.db; | ||
|
|
||
| import javax.annotation.Nullable; | ||
|
|
||
| public class DbResponseStatusUtil { | ||
| private DbResponseStatusUtil() {} | ||
|
|
||
| @Nullable | ||
| public static String dbResponseStatusCode(int responseStatusCode) { | ||
| return isError(responseStatusCode) ? Integer.toString(responseStatusCode) : null; | ||
| } | ||
|
|
||
| private static boolean isError(int responseStatusCode) { | ||
| return responseStatusCode >= 400 | ||
| || | ||
| // invalid status code, does not exist | ||
| responseStatusCode < 100; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,13 +12,31 @@ muzzle { | |
| } | ||
|
|
||
| dependencies { | ||
| library("io.vertx:vertx-sql-client:4.0.0") | ||
| compileOnly("io.vertx:vertx-codegen:4.0.0") | ||
| val version = "4.0.0" | ||
| library("io.vertx:vertx-sql-client:$version") | ||
| compileOnly("io.vertx:vertx-codegen:$version") | ||
|
|
||
| testInstrumentation(project(":instrumentation:netty:netty-4.1:javaagent")) | ||
|
|
||
| testLibrary("io.vertx:vertx-pg-client:4.0.0") | ||
| testLibrary("io.vertx:vertx-codegen:4.0.0") | ||
| testLibrary("io.vertx:vertx-pg-client:$version") | ||
| testLibrary("io.vertx:vertx-codegen:$version") | ||
| } | ||
|
|
||
| testing { | ||
|
||
| suites { | ||
| val testVertx5 by registering(JvmTestSuite::class) { | ||
zeitlinger marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| val version = "4.5.13" | ||
| dependencies { | ||
| implementation(project()) | ||
| implementation("io.vertx:vertx-sql-client:$version") | ||
| implementation("io.vertx:vertx-codegen:$version") | ||
| implementation("io.vertx:vertx-pg-client:$version") | ||
| implementation("org.testcontainers:testcontainers") | ||
|
|
||
| implementation(project(":instrumentation:netty:netty-4.1:javaagent")) | ||
zeitlinger marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| tasks { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be final, also I think it should be moved to internal package