Skip to content

Commit

Permalink
Merge pull request #1876 from undb-io/release/v1.0.0-10
Browse files Browse the repository at this point in the history
Release version v1.0.0-10
  • Loading branch information
nichenqin authored Aug 15, 2024
2 parents 4a2e18b + b0bd155 commit ae580fa
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 17 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Changelog


## v1.0.0-10

## v1.0.0-9


Expand Down
18 changes: 3 additions & 15 deletions apps/backend/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,31 +24,19 @@ import { all } from "radash"
import { v4 } from "uuid"
import { Auth, OpenAPI, Realtime, SpaceModule, TableModule, Web } from "./modules"
import { FileService } from "./modules/file/file"
import { OpenTelemetryModule } from "./modules/opentelemetry/opentelemetry.module"
import { loggerPlugin } from "./plugins/logging"

const auth = container.resolve(Auth)
const web = container.resolve(Web)
const openapi = container.resolve(OpenAPI)
const opentelemetry = container.resolve(OpenTelemetryModule)

export const app = new Elysia()
// .use(
// opentelemetry({
// spanProcessors: [
// new BatchSpanProcessor(
// new OTLPTraceExporter({
// url: "https://api.axiom.co/v1/traces",
// headers: {
// Authorization: `Bearer ${Bun.env.AXIOM_TOKEN}`,
// "X-Axiom-Dataset": Bun.env.AXIOM_DATASET,
// },
// }),
// ),
// ],
// }),
// )
.onStart(async () => {
await dbMigrate()
})
.use(opentelemetry.plugin())
.use(loggerPlugin())
.onError((ctx) => {
if (ctx.code === "NOT_FOUND") {
Expand Down
26 changes: 26 additions & 0 deletions apps/backend/src/modules/opentelemetry/opentelemetry.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { opentelemetry } from "@elysiajs/opentelemetry"
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-proto"
import { BatchSpanProcessor } from "@opentelemetry/sdk-trace-node"
import { singleton } from "@undb/di"
import Elysia from "elysia"

@singleton()
export class OpenTelemetryModule {
plugin() {
return new Elysia().use(
opentelemetry({
spanProcessors: [
new BatchSpanProcessor(
new OTLPTraceExporter({
url: "https://api.axiom.co/v1/traces",
headers: {
Authorization: `Bearer ${Bun.env.AXIOM_TOKEN}`,
"X-Axiom-Dataset": Bun.env.AXIOM_DATASET,
},
}),
),
],
}),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,9 @@
</div>
<div class="flex w-full justify-end border-t pt-4">
<Button disabled={$updateFieldMutation.isPending} type="submit" variant="outline" class="w-full" size="sm">
<LoaderCircleIcon class="mr-2 h-5 w-5 animate-spin" />
{#if $updateFieldMutation.isPending}
<LoaderCircleIcon class="mr-2 h-5 w-5 animate-spin" />
{/if}
Submit</Button
>
</div>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "undb",
"version": "1.0.0-9",
"version": "1.0.0-10",
"private": true,
"scripts": {
"build": "NODE_ENV=production bun --bun turbo build",
Expand Down

0 comments on commit ae580fa

Please sign in to comment.