mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-14 20:21:39 +03:00
fix(server): remove duplicate observability layer
This commit is contained in:
@@ -92,10 +92,6 @@ const processEffect = Effect.fnUntraced(function* (options: Options) {
|
||||
file: process.env.OPENCODE_MODELS_PATH,
|
||||
fetch: !truthy(process.env.OPENCODE_DISABLE_MODELS_FETCH),
|
||||
},
|
||||
observability: {
|
||||
endpoint: process.env.OTEL_EXPORTER_OTLP_ENDPOINT,
|
||||
headers: process.env.OTEL_EXPORTER_OTLP_HEADERS,
|
||||
},
|
||||
config: {
|
||||
directory: process.env.OPENCODE_CONFIG_DIR,
|
||||
project: !truthy(
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Database } from "@opencode-ai/core/database/database"
|
||||
import { ModelsDev } from "@opencode-ai/core/models-dev"
|
||||
import { Observability } from "@opencode-ai/util/observability"
|
||||
import { Schema } from "effect"
|
||||
|
||||
export const ServerOptions = Schema.Struct({
|
||||
@@ -22,7 +21,6 @@ export const ServerOptions = Schema.Struct({
|
||||
}),
|
||||
),
|
||||
models: Schema.optional(ModelsDev.Options),
|
||||
observability: Schema.optional(Observability.Options),
|
||||
config: Schema.optional(
|
||||
Schema.Struct({
|
||||
directory: Schema.optional(Schema.String),
|
||||
|
||||
@@ -7,7 +7,6 @@ import { AppNodeBuilder } from "@opencode-ai/core/effect/app-node-builder"
|
||||
import { Bus } from "@opencode-ai/core/bus"
|
||||
import { EventLogger } from "@opencode-ai/core/event-logger"
|
||||
import { FileSystemSearch } from "@opencode-ai/core/filesystem/search"
|
||||
import { Observability } from "@opencode-ai/util/observability"
|
||||
import { Credential } from "@opencode-ai/core/credential"
|
||||
import { Config } from "@opencode-ai/core/config"
|
||||
import { Command } from "@opencode-ai/core/command"
|
||||
@@ -131,13 +130,6 @@ function makeRoutes<AuthError, AuthServices>(
|
||||
}),
|
||||
)
|
||||
: AppNodeBuilder.build(applicationServices, replacements)
|
||||
const observability = Observability.layer({
|
||||
...options.observability,
|
||||
client: options.app?.name,
|
||||
version: options.app?.version,
|
||||
channel: options.app?.channel,
|
||||
})
|
||||
|
||||
return serviceLayer.pipe(
|
||||
Layer.flatMap((context) => {
|
||||
const services = Layer.succeedContext(context)
|
||||
@@ -161,6 +153,5 @@ function makeRoutes<AuthError, AuthServices>(
|
||||
)
|
||||
return Layer.merge(api, V1Migration.layer.pipe(Layer.provide(services)))
|
||||
}),
|
||||
Layer.provide(observability),
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user