Skip to content

Commit 9a8ed8e

Browse files
committed
refactor(observability): name the resource attribute layer the way the repo names layers
Signed-off-by: Yordis Prieto <[email protected]>
1 parent c507b5c commit 9a8ed8e

4 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎apps/desktop/src/app/DesktopObservability.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ const telemetryLayer = Layer.unwrap(
692692

693693
return otelWarningsLayer.pipe(
694694
Layer.provideMerge(Layer.mergeAll(loggerLayer, tracerLayer)),
695-
Layer.provide(OtelEnvironment.resourceAttributesLayer(endpoints.resourceAttributes)),
695+
Layer.provide(OtelEnvironment.layerResourceAttributes(endpoints.resourceAttributes)),
696696
);
697697
}),
698698
);

‎apps/server/src/observability/Layers/Observability.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export const ObservabilityLive = Layer.unwrap(
9898
Layer.mergeAll(ServerLoggerLive, traceReferencesLayer, tracerLayer, metricsLayer),
9999
),
100100
Layer.provide(
101-
OtelEnvironment.resourceAttributesLayer(config.otelEnvironment.resourceAttributes),
101+
OtelEnvironment.layerResourceAttributes(config.otelEnvironment.resourceAttributes),
102102
),
103103
);
104104
}),

‎packages/shared/src/otelEnvironment.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ describe("OtelEnvironment", () => {
106106
}),
107107
);
108108

109-
describe("resourceAttributesLayer", () => {
109+
describe("layerResourceAttributes", () => {
110110
it.effect.each([
111111
{ name: "a list that does not decode", raw: "team=%zz", attributes: [] },
112112
{ name: "encoded separators", raw: "a%2Cb=x%3Dy", attributes: ["a,b"] },
@@ -118,7 +118,7 @@ describe("OtelEnvironment", () => {
118118
const otel = yield* OtelEnvironment.load.pipe(Effect.provide(env));
119119
const resource = yield* OtlpResource.fromConfig({ serviceName: "t3" }).pipe(
120120
Effect.provide(
121-
Layer.provide(OtelEnvironment.resourceAttributesLayer(otel.resourceAttributes), env),
121+
Layer.provide(OtelEnvironment.layerResourceAttributes(otel.resourceAttributes), env),
122122
),
123123
);
124124
assert.deepStrictEqual(

‎packages/shared/src/otelEnvironment.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export const load: Effect.Effect<OtelEnvironment> = Config.all({
135135
* `OTEL_RESOURCE_ATTRIBUTES` for themselves and die when it does not decode,
136136
* so they see what `load` accepted instead.
137137
*/
138-
export const resourceAttributesLayer = (attributes: Readonly<Record<string, string>>) =>
138+
export const layerResourceAttributes = (attributes: Readonly<Record<string, string>>) =>
139139
ConfigProvider.layerAdd(
140140
ConfigProvider.fromEnv({
141141
env: {

0 commit comments

Comments
 (0)