forked from redwoodjs/redwood
-
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.
Merge branch 'main' of github.com:redwoodjs/redwood into codemod/repl…
…ace-svg-as-components * 'main' of github.com:redwoodjs/redwood: (25 commits) fix(deps): update dependency @whatwg-node/fetch to v0.9.7 (redwoodjs#8702) fix(deps): update dependency @heroicons/react to v2.0.18 (redwoodjs#8701) fix(deps): update dependency @headlessui/react to v1.7.15 (redwoodjs#8700) fix(deps): update dependency webpack to v5.88.0 (redwoodjs#8697) fix(deps): update dependency @graphiql/toolkit to v0.8.4 (redwoodjs#8698) fix(deps): update dependency react-error-boundary to v4.0.10 (redwoodjs#8693) Rename cache file (redwoodjs#8699) fix(clerk): add alternative decoder (redwoodjs#8642) fix(deps): update dependency @vitejs/plugin-react to v4.0.1 (redwoodjs#8692) chore(deps): update dependency @simplewebauthn/server to v7.3.1 (redwoodjs#8690) chore(rwfw): Add force optimise to vite.config when running project:sync (redwoodjs#8688) fix(deps): update storybook monorepo to v7.0.23 (redwoodjs#8696) fix(deps): update dependency react-toastify to v9.1.3 (redwoodjs#8694) fix(deps): update prisma monorepo to v4.16.1 (redwoodjs#8695) Mark broken gql prerender test as slow (redwoodjs#8687) fix(deps): update dependency @graphiql/plugin-explorer to v0.1.20 (redwoodjs#8691) fix(deps): update typescript-eslint monorepo to v5.60.0 (redwoodjs#8660) fix(deps): update dependency @fastify/http-proxy to v9.2.1 (redwoodjs#8680) chore(deps): update dependency vite to v4.3.9 (redwoodjs#8682) fix(deps): update prisma monorepo to v4.16.0 (redwoodjs#8684) ...
- Loading branch information
Showing
108 changed files
with
2,423 additions
and
1,159 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
export { authDecoder } from './decoder' | ||
export { authDecoder, clerkAuthDecoder } from './decoder' |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import opentelemetry, { | ||
SpanStatusCode, | ||
AttributeValue, | ||
Span, | ||
} from '@opentelemetry/api' | ||
|
||
type TelemetryAttributes = { | ||
[key: string]: AttributeValue | ||
} | ||
|
||
/** | ||
* Safely records attributes to the opentelemetry span | ||
* | ||
* @param attributes An object of key-value pairs to be individually recorded as attributes | ||
* @param span An optional span to record the attributes to. If not provided, the current active span will be used | ||
*/ | ||
export function recordTelemetryAttributes( | ||
attributes: TelemetryAttributes, | ||
span?: Span | ||
) { | ||
const spanToRecord = span ?? opentelemetry.trace.getActiveSpan() | ||
if (spanToRecord === undefined) { | ||
return | ||
} | ||
for (const [key, value] of Object.entries(attributes)) { | ||
spanToRecord.setAttribute(key, value) | ||
} | ||
} | ||
|
||
/** | ||
* Safely records an error to the opentelemetry span | ||
* | ||
* @param error An error to record to the span | ||
* @param span An optional span to record the error to. If not provided, the current active span will be used | ||
*/ | ||
export function recordTelemetryError(error: any, span?: Span) { | ||
const spanToRecord = span ?? opentelemetry.trace.getActiveSpan() | ||
if (spanToRecord === undefined) { | ||
return | ||
} | ||
spanToRecord.setStatus({ | ||
code: SpanStatusCode.ERROR, | ||
message: error.toString().split('\n')[0], | ||
}) | ||
spanToRecord.recordException(error) | ||
} |
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
Oops, something went wrong.