Skip to content

Commit

Permalink
chore: apply comment
Browse files Browse the repository at this point in the history
  • Loading branch information
moronyoh authored and rlemaitre committed Jan 14, 2025
1 parent 2e001a8 commit f8516a5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions modules/core/src/main/scala/pillars/Observability.scala
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ object Observability:
Observability(Tracer.noop[F], Meter.noop[F], EndpointInterceptor.noop[F]).pure[F]

def init[F[_]: LiftIO: Async: Parallel: Console](appInfo: AppInfo, config: Config): Resource[F, Observability[F]] =
if config.enabled && (config.traces.enabled || config.metrics.enabled) then
if config.isEnabled then
for
otel4s <- OpenTelemetrySdk.autoConfigured[F]: builder =>
builder
Expand Down Expand Up @@ -75,7 +75,9 @@ object Observability:
metrics: Config.Metrics = Config.Metrics(),
traces: Config.Traces = Config.Traces(),
serviceName: ServiceName = ServiceName("pillars")
) extends pillars.Config
) extends pillars.Config:
def isEnabled: Boolean = enabled && (metrics.enabled || traces.enabled)
end Config

object Config:
given Configuration = Configuration.default.withKebabCaseMemberNames.withKebabCaseConstructorNames.withDefaults
Expand Down

0 comments on commit f8516a5

Please sign in to comment.