Skip to content
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

chore: use Option.isNone in examples/http-server #42

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"typescript.tsdk": "node_modules/typescript/lib",
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true,
"eslint.format.enable": true
}
6 changes: 3 additions & 3 deletions examples/http-server/src/Tracing.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as NodeSdk from "@effect/opentelemetry/NodeSdk"
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-http"
import { BatchSpanProcessor } from "@opentelemetry/sdk-trace-base"
import { Config, Effect, Layer, Redacted } from "effect"
import { Config, Effect, Layer, Option, Redacted } from "effect"

export const TracingLive = Layer.unwrapEffect(
Effect.gen(function*() {
Expand All @@ -10,11 +10,11 @@ export const TracingLive = Layer.unwrapEffect(
Config.string("HONEYCOMB_DATASET"),
"stremio-effect"
)
if (apiKey._tag === "None") {
if (Option.isNone(apiKey)) {
const endpoint = yield* Config.option(
Config.string("OTEL_EXPORTER_OTLP_ENDPOINT")
)
if (endpoint._tag === "None") {
if (Option.isNone(endpoint)) {
return Layer.empty
}
return NodeSdk.layer(() => ({
Expand Down