Skip to content

Commit 4e5cade

Browse files
committed
Use warn level for Provider fallback catch
The Provider catch is defense-in-depth for when FlagEvalMetrics class itself can't load (OTel API absent entirely). The detailed error message is logged inside FlagEvalMetrics when it CAN load but SDK init fails. Using error level here caused the openfeature smoke test to fail (it asserts no ERROR entries in application logs).
1 parent 5128259 commit 4e5cade

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature

products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/Provider.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ public Provider(final Options options) {
5252
metrics = new FlagEvalMetrics();
5353
hook = new FlagEvalHook(metrics);
5454
} catch (LinkageError | Exception e) {
55-
log.error("Failed to initialize evaluation metrics — metrics disabled", e);
55+
// FlagEvalMetrics logs the detailed error when it can load but OTel SDK init fails.
56+
// This outer catch fires when the class itself can't load (OTel API absent entirely).
57+
log.warn("Evaluation metrics unavailable — OTel classes not on classpath", e);
5658
}
5759
}
5860
this.flagEvalMetrics = metrics;

0 commit comments

Comments
 (0)