package Ġuk . gov . just ice . h mp ps . off ender search . config Ċ Ċ import Ġcom . microsoft . application insights . Telemetry Client Ċ import Ġorg . springframework . context . annotation . Bean Ċ import Ġorg . springframework . context . annotation . Condition Ċ import Ġorg . springframework . context . annotation . Condition Context Ċ import Ġorg . springframework . context . annotation . Conditional Ċ import Ġorg . springframework . context . annotation . Configuration Ċ import Ġorg . springframework . core . type . Annotated Type Metadata Ċ Ċ /** Ċ Ġ* ĠApplication Ġinsights Ġnow Ġcontrolled Ġby Ġthe Ġspring - boot - starter Ġdependency . Ġ ĠHowever Ġwhen Ġthe Ġkey Ġis Ġnot Ġspecified Ċ Ġ* Ġwe Ġdon 't Ġget Ġa Ġtelemetry Ġbean Ġand Ġapplication Ġwon 't Ġstart . Ġ ĠTherefore Ġneed Ġthis Ġbackup Ġconfiguration . Ċ Ġ*/ Ċ @ Configuration Ċ class ĠApplication Insights Configuration Ġ{ ĊĠ Ġ@ Bean ĊĠ Ġ@ Conditional ( App Insight Key Absent Condition :: class ) ĊĠ Ġfun Ġtelemetry Client (): ĠTe lemetry Client Ġ{ ĊĠĠĠ Ġreturn ĠTe lemetry Client () ĊĠ Ġ} ĊĊĠ Ġclass ĠApp Insight Key Absent Condition Ġ: ĠCondition Ġ{ ĊĠĠĠ Ġoverride Ġfun Ġmatches ( context : ĠCondition Context , Ġmetadata : ĠAnnot ated Type Metadata ): ĠBoolean Ġ{ ĊĠĠĠĠĠ Ġval Ġtelemetry Key Ġ= Ġcontext . environment . getProperty (" app insights . instrumentation key ") ĊĠĠĠĠĠ Ġreturn Ġtelemetry Key . isNull Or Blank () ĊĠĠĠ Ġ} ĊĠ Ġ} Ċ } Ċ