Skip to content

Commit 1fa3dea

Browse files
authored
Add version, when available, to distributed logging (Azure#23999)
Resolves Azure#12907
1 parent 85516db commit 1fa3dea

File tree

6 files changed

+22
-0
lines changed

6 files changed

+22
-0
lines changed

sdk/keyvault/Azure.Security.KeyVault.Certificates/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
### Bugs Fixed
1212

13+
- Added certificate version to distributed tracing. ([#12907](https://github.com/Azure/azure-sdk-for-net/issues/12907))
14+
1315
### Other Changes
1416

1517
## 4.3.0-beta.1 (2021-08-10)

sdk/keyvault/Azure.Security.KeyVault.Certificates/src/CertificateClient.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ public virtual Response<X509Certificate2> DownloadCertificate(string certificate
181181

182182
using DiagnosticScope scope = _pipeline.CreateScope($"{nameof(CertificateClient)}.{nameof(DownloadCertificate)}");
183183
scope.AddAttribute("certificate", certificateName);
184+
scope.AddAttribute("version", version);
184185
scope.Start();
185186

186187
try
@@ -244,6 +245,7 @@ public virtual async Task<Response<X509Certificate2>> DownloadCertificateAsync(s
244245

245246
using DiagnosticScope scope = _pipeline.CreateScope($"{nameof(CertificateClient)}.{nameof(DownloadCertificate)}");
246247
scope.AddAttribute("certificate", certificateName);
248+
scope.AddAttribute("version", version);
247249
scope.Start();
248250

249251
try
@@ -351,6 +353,7 @@ public virtual Response<KeyVaultCertificate> GetCertificateVersion(string certif
351353

352354
using DiagnosticScope scope = _pipeline.CreateScope($"{nameof(CertificateClient)}.{nameof(GetCertificateVersion)}");
353355
scope.AddAttribute("certificate", certificateName);
356+
scope.AddAttribute("version", version);
354357
scope.Start();
355358

356359
try
@@ -380,6 +383,7 @@ public virtual async Task<Response<KeyVaultCertificate>> GetCertificateVersionAs
380383

381384
using DiagnosticScope scope = _pipeline.CreateScope($"{nameof(CertificateClient)}.{nameof(GetCertificateVersion)}");
382385
scope.AddAttribute("certificate", certificateName);
386+
scope.AddAttribute("version", version);
383387
scope.Start();
384388

385389
try
@@ -408,6 +412,7 @@ public virtual Response<KeyVaultCertificate> UpdateCertificateProperties(Certifi
408412

409413
using DiagnosticScope scope = _pipeline.CreateScope($"{nameof(CertificateClient)}.{nameof(UpdateCertificateProperties)}");
410414
scope.AddAttribute("certificate", properties.Name);
415+
scope.AddAttribute("version", properties.Version);
411416
scope.Start();
412417

413418
try
@@ -436,6 +441,7 @@ public virtual async Task<Response<KeyVaultCertificate>> UpdateCertificateProper
436441

437442
using DiagnosticScope scope = _pipeline.CreateScope($"{nameof(CertificateClient)}.{nameof(UpdateCertificateProperties)}");
438443
scope.AddAttribute("certificate", properties.Name);
444+
scope.AddAttribute("version", properties.Version);
439445
scope.Start();
440446

441447
try

sdk/keyvault/Azure.Security.KeyVault.Keys/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
### Bugs Fixed
1313

14+
- Added key version to distributed tracing. ([#12907](https://github.com/Azure/azure-sdk-for-net/issues/12907))
15+
1416
### Other Changes
1517

1618
## 4.3.0-beta.1 (2021-08-10)

sdk/keyvault/Azure.Security.KeyVault.Keys/src/KeyClient.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ public virtual Response<KeyVaultKey> UpdateKeyProperties(KeyProperties propertie
340340

341341
using DiagnosticScope scope = _pipeline.CreateScope($"{nameof(KeyClient)}.{nameof(UpdateKeyProperties)}");
342342
scope.AddAttribute("key", properties.Name);
343+
scope.AddAttribute("version", properties.Version);
343344
scope.Start();
344345

345346
try
@@ -376,6 +377,7 @@ public virtual async Task<Response<KeyVaultKey>> UpdateKeyPropertiesAsync(KeyPro
376377

377378
using DiagnosticScope scope = _pipeline.CreateScope($"{nameof(KeyClient)}.{nameof(UpdateKeyProperties)}");
378379
scope.AddAttribute("key", properties.Name);
380+
scope.AddAttribute("version", properties.Version);
379381
scope.Start();
380382

381383
try
@@ -409,6 +411,7 @@ public virtual Response<KeyVaultKey> GetKey(string name, string version = null,
409411

410412
using DiagnosticScope scope = _pipeline.CreateScope($"{nameof(KeyClient)}.{nameof(GetKey)}");
411413
scope.AddAttribute("key", name);
414+
scope.AddAttribute("version", version);
412415
scope.Start();
413416

414417
try
@@ -442,6 +445,7 @@ public virtual async Task<Response<KeyVaultKey>> GetKeyAsync(string name, string
442445

443446
using DiagnosticScope scope = _pipeline.CreateScope($"{nameof(KeyClient)}.{nameof(GetKey)}");
444447
scope.AddAttribute("key", name);
448+
scope.AddAttribute("version", version);
445449
scope.Start();
446450

447451
try
@@ -1263,6 +1267,7 @@ public virtual Response<ReleaseKeyResult> ReleaseKey(string name, string version
12631267

12641268
using DiagnosticScope scope = _pipeline.CreateScope($"{nameof(KeyClient)}.{nameof(ReleaseKey)}");
12651269
scope.AddAttribute("key", name);
1270+
scope.AddAttribute("version", version);
12661271
scope.Start();
12671272

12681273
options ??= new();
@@ -1320,6 +1325,7 @@ public virtual async Task<Response<ReleaseKeyResult>> ReleaseKeyAsync(string nam
13201325

13211326
using DiagnosticScope scope = _pipeline.CreateScope($"{nameof(KeyClient)}.{nameof(ReleaseKey)}");
13221327
scope.AddAttribute("key", name);
1328+
scope.AddAttribute("version", version);
13231329
scope.Start();
13241330

13251331
options ??= new();

sdk/keyvault/Azure.Security.KeyVault.Secrets/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
### Bugs Fixed
1212

13+
- Added secret version to distributed tracing. ([#12907](https://github.com/Azure/azure-sdk-for-net/issues/12907))
14+
1315
### Other Changes
1416

1517
## 4.3.0-beta.1 (2021-08-10)

sdk/keyvault/Azure.Security.KeyVault.Secrets/src/SecretClient.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ public virtual async Task<Response<KeyVaultSecret>> GetSecretAsync(string name,
9090

9191
using DiagnosticScope scope = _pipeline.CreateScope($"{nameof(SecretClient)}.{nameof(GetSecret)}");
9292
scope.AddAttribute("secret", name);
93+
scope.AddAttribute("version", version);
9394
scope.Start();
9495

9596
try
@@ -122,6 +123,7 @@ public virtual Response<KeyVaultSecret> GetSecret(string name, string version =
122123

123124
using DiagnosticScope scope = _pipeline.CreateScope($"{nameof(SecretClient)}.{nameof(GetSecret)}");
124125
scope.AddAttribute("secret", name);
126+
scope.AddAttribute("version", version);
125127
scope.Start();
126128

127129
try
@@ -235,6 +237,7 @@ public virtual async Task<Response<SecretProperties>> UpdateSecretPropertiesAsyn
235237

236238
using DiagnosticScope scope = _pipeline.CreateScope($"{nameof(SecretClient)}.{nameof(UpdateSecretProperties)}");
237239
scope.AddAttribute("secret", properties.Name);
240+
scope.AddAttribute("version", properties.Version);
238241
scope.Start();
239242

240243
try
@@ -268,6 +271,7 @@ public virtual Response<SecretProperties> UpdateSecretProperties(SecretPropertie
268271

269272
using DiagnosticScope scope = _pipeline.CreateScope($"{nameof(SecretClient)}.{nameof(UpdateSecretProperties)}");
270273
scope.AddAttribute("secret", properties.Name);
274+
scope.AddAttribute("version", properties.Version);
271275
scope.Start();
272276

273277
try

0 commit comments

Comments
 (0)