@@ -61,8 +61,11 @@ func newClient(endpoint string, authPolicy policy.Policy, options *ClientOptions
6161 }
6262
6363 cache := synctoken .NewCache ()
64- client , err := azcore .NewClient (moduleName + ".Client" , moduleVersion , runtime.PipelineOptions {
64+ client , err := azcore .NewClient (moduleName , moduleVersion , runtime.PipelineOptions {
6565 PerRetry : []policy.Policy {authPolicy , synctoken .NewPolicy (cache )},
66+ Tracing : runtime.TracingOptions {
67+ Namespace : "Microsoft.AppConfig" ,
68+ },
6669 }, & options .ClientOptions )
6770 if err != nil {
6871 return nil , err
@@ -87,6 +90,10 @@ func (c *Client) SetSyncToken(syncToken SyncToken) error {
8790// - value is the value for the setting. pass nil if the setting doesn't have a value
8891// - options contains the optional values. can be nil
8992func (c * Client ) AddSetting (ctx context.Context , key string , value * string , options * AddSettingOptions ) (AddSettingResponse , error ) {
93+ var err error
94+ ctx , endSpan := runtime .StartSpan (ctx , "Client.AddSetting" , c .appConfigClient .Tracer (), nil )
95+ defer func () { endSpan (err ) }()
96+
9097 if options == nil {
9198 options = & AddSettingOptions {}
9299 }
@@ -108,6 +115,10 @@ func (c *Client) AddSetting(ctx context.Context, key string, value *string, opti
108115
109116// DeleteSetting deletes a configuration setting from the configuration store.
110117func (c * Client ) DeleteSetting (ctx context.Context , key string , options * DeleteSettingOptions ) (DeleteSettingResponse , error ) {
118+ var err error
119+ ctx , endSpan := runtime .StartSpan (ctx , "Client.DeleteSetting" , c .appConfigClient .Tracer (), nil )
120+ defer func () { endSpan (err ) }()
121+
111122 if options == nil {
112123 options = & DeleteSettingOptions {}
113124 }
@@ -127,6 +138,10 @@ func (c *Client) DeleteSetting(ctx context.Context, key string, options *DeleteS
127138
128139// GetSetting retrieves an existing configuration setting from the configuration store.
129140func (c * Client ) GetSetting (ctx context.Context , key string , options * GetSettingOptions ) (GetSettingResponse , error ) {
141+ var err error
142+ ctx , endSpan := runtime .StartSpan (ctx , "Client.GetSetting" , c .appConfigClient .Tracer (), nil )
143+ defer func () { endSpan (err ) }()
144+
130145 if options == nil {
131146 options = & GetSettingOptions {}
132147 }
@@ -147,13 +162,16 @@ func (c *Client) GetSetting(ctx context.Context, key string, options *GetSetting
147162
148163// SetReadOnly sets an existing configuration setting to read only or read write state in the configuration store.
149164func (c * Client ) SetReadOnly (ctx context.Context , key string , isReadOnly bool , options * SetReadOnlyOptions ) (SetReadOnlyResponse , error ) {
165+ var err error
166+ ctx , endSpan := runtime .StartSpan (ctx , "Client.SetReadOnly" , c .appConfigClient .Tracer (), nil )
167+ defer func () { endSpan (err ) }()
168+
150169 if options == nil {
151170 options = & SetReadOnlyOptions {}
152171 }
153172
154173 setting := Setting {Key : & key , Label : options .Label }
155174
156- var err error
157175 if isReadOnly {
158176 var resp generated.AzureAppConfigurationClientPutLockResponse
159177 resp , err = c .appConfigClient .PutLock (ctx , * setting .Key , setting .toGeneratedPutLockOptions (options .OnlyIfUnchanged ))
@@ -183,6 +201,10 @@ func (c *Client) SetReadOnly(ctx context.Context, key string, isReadOnly bool, o
183201// - value is the value for the setting. pass nil if the setting doesn't have a value
184202// - options contains the optional values. can be nil
185203func (c * Client ) SetSetting (ctx context.Context , key string , value * string , options * SetSettingOptions ) (SetSettingResponse , error ) {
204+ var err error
205+ ctx , endSpan := runtime .StartSpan (ctx , "Client.SetSetting" , c .appConfigClient .Tracer (), nil )
206+ defer func () { endSpan (err ) }()
207+
186208 if options == nil {
187209 options = & SetSettingOptions {}
188210 }
@@ -226,6 +248,7 @@ func (c *Client) NewListRevisionsPager(selector SettingSelector, options *ListRe
226248 SyncToken : SyncToken (* page .SyncToken ),
227249 }, nil
228250 },
251+ Tracer : c .appConfigClient .Tracer (),
229252 })
230253}
231254
@@ -253,5 +276,6 @@ func (c *Client) NewListSettingsPager(selector SettingSelector, options *ListSet
253276 SyncToken : SyncToken (* page .SyncToken ),
254277 }, nil
255278 },
279+ Tracer : c .appConfigClient .Tracer (),
256280 })
257281}
0 commit comments