Skip to content

Commit

Permalink
chore(deps): bump @opentelemetry/instrumentation-ioredis (#1616)
Browse files Browse the repository at this point in the history
Bumps [@opentelemetry/instrumentation-ioredis](https://github.com/open-telemetry/opentelemetry-js-contrib) from 0.30.0 to 0.31.0.
- [Release notes](https://github.com/open-telemetry/opentelemetry-js-contrib/releases)
- [Changelog](https://github.com/open-telemetry/opentelemetry-js-contrib/blob/main/CHANGELOG.md)
- [Commits](open-telemetry/opentelemetry-js-contrib@contrib-test-utils-v0.30.0...contrib-test-utils-v0.31.0)

---
updated-dependencies:
- dependency-name: "@opentelemetry/instrumentation-ioredis"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
dependabot[bot] authored and vindard committed Sep 1, 2022
1 parent d398d13 commit a88c53a
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 17 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@opentelemetry/instrumentation-graphql": "^0.29.0",
"@opentelemetry/instrumentation-grpc": "^0.32.0",
"@opentelemetry/instrumentation-http": "^0.32.0",
"@opentelemetry/instrumentation-ioredis": "^0.30.0",
"@opentelemetry/instrumentation-ioredis": "^0.31.0",
"@opentelemetry/instrumentation-mongodb": "^0.31.1",
"@opentelemetry/resources": "^1.6.0",
"@opentelemetry/sdk-trace-base": "^1.6.0",
Expand Down
42 changes: 30 additions & 12 deletions src/services/tracing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,29 +79,47 @@ const recordGqlErrors = ({
)
const firstErr = errors[0]
if (firstErr.message != "") {
span.setAttribute(`graphql.${subPath}error.message`, firstErr.message)
const value = firstErr.message
span.setAttribute(`graphql.${subPath}error.message`, value)
if (span.attributes[`graphql.error.message`] === undefined) {
span.setAttribute(`graphql.error.message`, value)
}
}
if (firstErr.constructor?.name) {
span.setAttribute(`graphql.${subPath}error.type`, firstErr.constructor.name)
const value = firstErr.constructor.name
span.setAttribute(`graphql.${subPath}error.type`, value)
if (span.attributes[`graphql.error.type`] === undefined) {
span.setAttribute(`graphql.error.type`, value)
}
}
if (firstErr.path) {
span.setAttribute(`graphql.${subPath}error.path`, firstErr.path.join("."))
const value = firstErr.path.join(".")
span.setAttribute(`graphql.${subPath}error.path`, value)
if (span.attributes[`graphql.error.path`] === undefined) {
span.setAttribute(`graphql.error.path`, value)
}
}
if (firstErr.extensions?.code) {
span.setAttribute(`graphql.${subPath}error.code`, firstErr.extensions.code)
const value = firstErr.extensions.code
span.setAttribute(`graphql.${subPath}error.code`, value)
if (span.attributes[`graphql.error.code`] === undefined) {
span.setAttribute(`graphql.error.code`, value)
}
}
if (firstErr.originalError) {
if (firstErr.originalError.constructor?.name) {
span.setAttribute(
`graphql.${subPath}error.original.type`,
firstErr.originalError.constructor.name,
)
const value = firstErr.originalError.constructor.name
span.setAttribute(`graphql.${subPath}error.original.type`, value)
if (span.attributes[`graphql.error.original.type`] === undefined) {
span.setAttribute(`graphql.error.original.type`, value)
}
}
if (firstErr.originalError.message != "") {
span.setAttribute(
`graphql.${subPath}error.original.message`,
firstErr.originalError.message,
)
const value = firstErr.originalError.message
span.setAttribute(`graphql.${subPath}error.original.message`, value)
if (span.attributes[`graphql.error.original.message`] === undefined) {
span.setAttribute(`graphql.error.original.message`, value)
}
}
}

Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2124,10 +2124,10 @@
"@opentelemetry/semantic-conventions" "1.6.0"
semver "^7.3.5"

"@opentelemetry/instrumentation-ioredis@^0.30.0":
version "0.30.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-ioredis/-/instrumentation-ioredis-0.30.0.tgz#514212de763c079c8a2e345de688f19acd0f6b78"
integrity sha512-iYdVWRz53kZ3DsEMt5es8KF+OrfRi4M6gSQYA7q6OcVXrucAUZA+juK8Rl3IgWjXG5wKCzr/liKs6HDAVJ9f/Q==
"@opentelemetry/instrumentation-ioredis@^0.31.0":
version "0.31.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-ioredis/-/instrumentation-ioredis-0.31.0.tgz#1f11278508da9ec5ff5b2012c2057218a9c98ef1"
integrity sha512-wP9KbFxdcrI1uQ5QATOfzhEUhb6gM+HY0rwgnch0Q/IpItstowUiQ+IwaOSTQVmPoh7frdSbIXAmFBO6mJyBVQ==
dependencies:
"@opentelemetry/instrumentation" "^0.29.2"
"@opentelemetry/semantic-conventions" "^1.0.0"
Expand Down

0 comments on commit a88c53a

Please sign in to comment.