Compare commits

...

384 Commits

Author SHA1 Message Date
Martin Costello f153e130b4
[Infra] Fix issue templates (#6455)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
2025-09-04 10:06:15 -07:00
dependabot[bot] b659171101
Bump github/codeql-action from 3.29.11 to 3.30.0 (#6460)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-09-03 07:21:26 -07:00
Martin Costello 2a9c406b6d
[Infra] Simplify span slicing (#6456) 2025-08-28 12:14:14 -07:00
Martin Costello bab4b954cd
[OpenTelemetry] Fix assertion failures in debug (#6304)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-08-28 09:10:46 -07:00
OpenTelemetry Bot cd522d9081
Add subscript to issue templates (#6423)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
Co-authored-by: Cijo Thomas <cijo.thomas@gmail.com>
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-08-26 11:46:52 -07:00
Martin Costello 8321588b28
[infra] Use Artifacts Output layout (#6301)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-08-25 13:44:57 -07:00
dependabot[bot] 62162211ad
Bump github/codeql-action from 3.29.10 to 3.29.11 (#6450)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-25 09:02:49 -07:00
Martin Costello 7a4643a829
[OTLP] Set TE header for gRPC calls (#6449) 2025-08-22 08:39:37 -07:00
dependabot[bot] 84b3ca4e11
Bump codecov/codecov-action from 5.4.3 to 5.5.0 (#6448)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-20 11:59:43 -07:00
dependabot[bot] 0ebe718c70
Bump github/codeql-action from 3.29.6 to 3.29.10 (#6445)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
2025-08-19 10:38:26 -07:00
dependabot[bot] a871f0fc68
Bump github/codeql-action from 3.29.6 to 3.29.9 (#6436)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-08-18 10:41:17 -07:00
dependabot[bot] 44f46b1656
Bump actions/checkout from 4.2.2 to 5.0.0 (#6437)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-08-18 10:01:09 -07:00
Martin Costello ca892e44a9
[Infra] Pin aiohttp (#6442)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-08-18 09:46:03 -07:00
dependabot[bot] a067b8f437
Bump ubuntu from `a08e551` to `7c06e91` in /test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests (#6438)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-08-18 09:27:49 -07:00
dependabot[bot] 2e73a2c468
Bump dotnet/aspnet from `6d8901f` to `6d40ae7` in /examples/MicroserviceExample/WebApi (#6439)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-08-18 09:04:16 -07:00
dependabot[bot] 4bab51a01a
Bump dotnet/sdk from `45e41fe` to `7fd287c` in /examples/MicroserviceExample/WebApi (#6440)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-15 17:16:31 -07:00
dependabot[bot] 81f29e6068
Bump github/codeql-action from 3.29.5 to 3.29.6 (#6433)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-08-07 21:41:44 -07:00
dependabot[bot] 583166cc71
Bump dotnet/aspnet from 8.0.18 to 8.0.19 in /examples/MicroserviceExample/WebApi (#6429)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: martincostello <martin@martincostello.com>
2025-08-07 20:59:46 -07:00
dependabot[bot] e2fdf99f52
Bump dotnet/sdk from 8.0.412 to 8.0.413 in /examples/MicroserviceExample/WebApi (#6428)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-06 22:48:22 -07:00
Cijo Thomas d2f8e54bb9
Self-diagnostics - support formatted message for better human readability (#6411)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-08-05 10:25:11 -07:00
dependabot[bot] 27234c2a14
Bump github/codeql-action from 3.29.4 to 3.29.5 (#6419)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-31 02:25:38 -07:00
Martin Costello 6b58da89e2
[Infra] Bump Cosign to v2.5.3 (#6417) 2025-07-30 10:03:29 -07:00
Martin Costello accfea63fe
[Infra] Improve CodeQL analysis (#6415)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-07-30 08:33:23 -07:00
Martin Costello 570a6fa687
[OTLP] Dispose exporter if setup fails (#6398)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-07-30 06:40:11 -07:00
Martin Costello 4dc60007ca
[Infra] Exclude keep-open label from stale (#6413)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-07-30 05:41:00 -07:00
Piotr Kiełkowicz e67ecf8164
[docs] Contributing - reporting bug/feature requests (#6414) 2025-07-30 05:26:53 -07:00
Piotr Kiełkowicz 98a8d38e8a
[infra] use env. var. to read github body comment (#6409) 2025-07-25 08:26:46 -07:00
dependabot[bot] e5b9a9a3db
Bump dotnet-sdk from 9.0.302 to 9.0.303 (#6402)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
2025-07-24 22:53:27 -07:00
OpenTelemetry Bot be60150962
[infra] Add minimum token permissions for all github workflow files (#6357)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-07-24 03:50:45 -07:00
dependabot[bot] 7f111ea831
Bump dotnet/aspnet from `35095f3` to `fbc9110` in /examples/MicroserviceExample/WorkerService (#6399)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-07-24 01:49:19 -07:00
dependabot[bot] a8ef3e1888
Bump dotnet/sdk from `e6748a3` to `4763fe4` in /examples/MicroserviceExample/WorkerService (#6400)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-07-24 01:34:33 -07:00
dependabot[bot] 9480cb3e9a
Bump github/codeql-action from 3.29.3 to 3.29.4 (#6401)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-07-24 01:33:27 -07:00
dependabot[bot] b921486b67
Bump ubuntu from `c4570d2` to `a08e551` in /test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests (#6403)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-07-24 01:17:54 -07:00
dependabot[bot] 5ff15e58c1
Bump dotnet/sdk from `e6748a3` to `4763fe4` in /test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests (#6404)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-07-24 00:51:20 -07:00
dependabot[bot] 872ab2b80c
Bump dotnet/sdk from `e6748a3` to `4763fe4` in /test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/IntegrationTest (#6405)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-07-24 00:42:27 -07:00
dependabot[bot] 21af34df63
Bump dotnet/sdk from `3da7c41` to `3da7c41` in /examples/MicroserviceExample/WebApi (#6406)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-07-24 00:32:51 -07:00
dependabot[bot] 2b20ffc1ed
Bump dotnet/aspnet from `35095f3` to `fbc9110` in /examples/MicroserviceExample/WebApi (#6407)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-23 22:38:36 -07:00
Paulo Morgado 7ccfda242a
Refactor serialization error handling and buffer logic (#6392) 2025-07-22 13:07:42 -07:00
dependabot[bot] 6f805344dd
Bump github/codeql-action from 3.29.2 to 3.29.3 (#6393)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-21 19:37:30 -07:00
Martin Costello d8dfaa84a3
[OTLP] Refactor ProtobufSerializer.WriteReservedLength() to improve performance (#6367) 2025-07-21 06:16:07 -07:00
Martin Costello 361a1655b9
[Infra] Remove AssemblyInfo files (#6382)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-07-21 05:55:14 -07:00
Cijo Thomas a2679d5a6d
Improve Console Metric Exporter Output (#6388)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
2025-07-21 03:50:00 -07:00
Cijo Thomas 0ad46df6cf
Add Martin Costello as Approver (#6383)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-07-19 23:19:19 -07:00
dependabot[bot] 393b5e04f3
Bump sigstore/cosign-installer from 3.9.1 to 3.9.2 (#6390)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-19 22:34:48 -07:00
dependabot[bot] 5963d1d710
Bump ubuntu from `440dcf6` to `c4570d2` in /test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests (#6381)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-07-17 09:37:42 -07:00
Cijo Thomas afe1a5bb11
Add explicit warning on ConsoleExporter (#6385)
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-07-17 09:28:26 -07:00
Cijo Thomas 4e9e37fa35
Slight improvement to readability to Metric ConsoleExporter (#6384) 2025-07-17 09:23:15 -07:00
Martin Costello f8dc06acf2
Remove redundant test (#6369)
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-07-14 17:03:46 -07:00
dependabot[bot] 869d9475ef
Bump dotnet-sdk from 9.0.300 to 9.0.302 (#6374)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-07-14 16:53:18 -07:00
dependabot[bot] 12b994ceda
Bump dotnet/sdk from 8.0.411 to 8.0.412 in /test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests (#6370)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-07-14 14:44:59 -07:00
dependabot[bot] 5a89e2cfe8
Bump dotnet/aspnet from 8.0.17 to 8.0.18 in /examples/MicroserviceExample/WorkerService (#6371)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-07-14 14:18:22 -07:00
dependabot[bot] cd796552ef
Bump dotnet/sdk from 8.0.411 to 8.0.412 in /examples/MicroserviceExample/WorkerService (#6372)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-07-14 14:17:15 -07:00
dependabot[bot] 42fe0738cb
Bump dotnet/sdk from 8.0.411 to 8.0.412 in /test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/IntegrationTest (#6373)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-07-14 13:02:30 -07:00
dependabot[bot] 796be6b4a9
Bump dotnet/sdk from 8.0.411 to 8.0.412 in /examples/MicroserviceExample/WebApi (#6375)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-07-14 11:28:51 -07:00
dependabot[bot] e58ee78c2d
Bump dotnet/aspnet from 8.0.17 to 8.0.18 in /examples/MicroserviceExample/WebApi (#6376)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-14 11:27:54 -07:00
dependabot[bot] 309ed2e7a8
Bump github/codeql-action from 3.29.1 to 3.29.2 (#6359)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-07-03 16:57:29 -07:00
dependabot[bot] 04a48b6033
Bump ubuntu from `b59d215` to `440dcf6` in /test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests (#6360)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-07-03 16:46:43 -07:00
dependabot[bot] 4eb55be9a9
Bump dotnet/sdk from `e6a5a8d` to `57c3bf9` in /test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests (#6361)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-07-03 16:43:59 -07:00
dependabot[bot] 19afd63555
Bump dotnet/aspnet from `d5c0d91` to `68669af` in /examples/MicroserviceExample/WebApi (#6362)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-07-03 16:30:10 -07:00
dependabot[bot] b76121e858
Bump dotnet/sdk from `e6a5a8d` to `57c3bf9` in /examples/MicroserviceExample/WebApi (#6363)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-07-03 16:28:45 -07:00
dependabot[bot] b83bc6800e
Bump dotnet/sdk from `e6a5a8d` to `57c3bf9` in /test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/IntegrationTest (#6364)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-07-03 16:26:36 -07:00
dependabot[bot] 7ed91a108f
Bump dotnet/aspnet from `d5c0d91` to `68669af` in /examples/MicroserviceExample/WorkerService (#6365)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-07-03 16:06:57 -07:00
dependabot[bot] 5acf77cf04
Bump dotnet/sdk from `e6a5a8d` to `57c3bf9` in /examples/MicroserviceExample/WorkerService (#6366)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-07-03 15:56:00 -07:00
dependabot[bot] 1479b236f7
Bump github/codeql-action from 3.29.0 to 3.29.1 (#6356)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-06-30 16:10:52 -07:00
OpenTelemetry Bot 05f74a4c36
Fix outdated community membership link (#6355)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
2025-06-30 11:37:05 -07:00
Julius Koval a2bb510f79
Adding EventName to LogRecord (#6306)
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-06-26 12:41:08 -07:00
Piotr Kiełkowicz 4f51654047
[repo] CLOMonitor - disable Artifact hub check (#6354)
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-06-26 12:08:50 -07:00
Piotr Kiełkowicz bd434cc9ae
[repo] Enable analysis globally (#6344) 2025-06-26 12:05:16 -07:00
OpenTelemetry Bot e76e0f9f44
Update community member listings (#6351)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
2025-06-25 21:54:00 -07:00
Piotr Kiełkowicz 3401b31085
[docs] Best practices badges (#6349) 2025-06-25 10:06:16 -07:00
dependabot[bot] 5f9b011c0f
Bump sigstore/cosign-installer from 3.9.0 to 3.9.1 (#6346)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-06-24 00:58:52 -07:00
Alexander Nikolaev e9cfc33fad
Add the default ports for Tempo in the example. (#6345) 2025-06-24 00:43:20 -07:00
Martin Costello 154a6dc10b
[W3C] Refactor W3C integration tests (#6328) 2025-06-19 08:49:07 -07:00
dependabot[bot] 21993b01a3
Bump dotnet/sdk from 8.0.410 to 8.0.411 in /examples/MicroserviceExample/WorkerService (#6336)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-18 11:24:20 -07:00
dependabot[bot] d324abb29d
Bump dotnet/sdk from 8.0.410 to 8.0.411 in /test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/IntegrationTest (#6337)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-18 11:23:43 -07:00
dependabot[bot] 7cad682002
Bump dotnet/aspnet from 8.0.16 to 8.0.17 in /examples/MicroserviceExample/WebApi (#6338)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-18 11:23:23 -07:00
dependabot[bot] 52edab3c8c
Bump dotnet/sdk from 8.0.410 to 8.0.411 in /test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests (#6339)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-06-18 11:23:00 -07:00
dependabot[bot] eb0ddd1273
Bump ubuntu from `7229784` to `b59d215` in /test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests (#6322)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-06-18 06:16:29 -07:00
Martin Costello dde8f4024b
[Infra] Avoid test flakiness (#6329) 2025-06-18 05:59:15 -07:00
Martin Costello e21e9ccd24
[Infra] Remove Source Link package (#6331)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-06-18 04:29:44 -07:00
dependabot[bot] a10f955cd9
Bump sigstore/cosign-installer from 3.8.2 to 3.9.0 (#6335)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-06-18 04:03:25 -07:00
Martin Costello 6c826c7176
[Infra] Remove redundant item (#6330)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-06-18 03:11:11 -07:00
dependabot[bot] 260e25271d
Bump github/codeql-action from 3.28.19 to 3.29.0 (#6318)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-06-18 02:30:05 -07:00
dependabot[bot] f067d0db96
Bump dotnet/aspnet from 8.0.16 to 8.0.17 in /examples/MicroserviceExample/WorkerService (#6340)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-17 14:26:05 -07:00
dependabot[bot] ed26d99bf5
Bump dotnet/sdk from 8.0.410 to 8.0.411 in /examples/MicroserviceExample/WebApi (#6341)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-17 14:25:07 -07:00
Martin Costello 78a71ebbf7
[Infra] Ignore major/minor Docker updates (#6326) 2025-06-17 14:21:26 -07:00
Martin Costello 3f86f47ac3
[Infra] Ensure .NET 8 is installed (#6313) 2025-06-11 16:32:11 -07:00
Martin Costello 4e84aa72dd
[Infra] Update Dockerfiles with dependabot (#6315) 2025-06-11 16:30:26 -07:00
Martin Costello b552c7f9bf
[w3c] Remove redundant RUN command (#6312) 2025-06-09 16:59:45 -07:00
Martin Costello 74352b8769
[infra] Use PublicApiAnalyzers from NuGet.org (#6311)
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-06-09 11:36:00 -07:00
Martin Costello 1f9fa9ffe7
[infra] Remove obsolete compose attribute (#6310) 2025-06-09 11:27:01 -07:00
Valerio Arena 77e73ced3c
Introducing AddLink method in TelemetrySpan (#6305)
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-06-09 10:22:08 -07:00
Martin Costello 15446598f6
[infra] Avoid port conflicts in tests (#6308)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-06-07 17:21:38 -07:00
Martin Costello ec554f9eb0
[infra] Fix line endings for shell scripts (#6309) 2025-06-07 14:10:57 -07:00
Martin Costello 9ecf6b77bc
[OpenTelemetry] Fix CA1305 warning (#6299)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-06-03 21:24:57 -07:00
Martin Costello fb4bb17b34
[infra] Ensure test-threadSafety.ps1 fails (#6302)
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-06-03 16:30:26 -07:00
dependabot[bot] b884697d47
Bump github/codeql-action from 3.28.18 to 3.28.19 (#6303)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-06-03 13:50:05 -07:00
Rajkumar Rangaraj d5f6732118
Update Mothra affiliation (#6298) 2025-06-02 14:07:08 -07:00
dependabot[bot] 1065e43060
Bump ossf/scorecard-action from 2.4.1 to 2.4.2 (#6297)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-30 11:54:22 -07:00
dependabot[bot] 0ad6a95bf2
Bump dotnet-sdk from 9.0.203 to 9.0.300 (#6283)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-05-30 09:38:20 -07:00
Piotr Kiełkowicz 3c9beb896b
[OpenTelemetry] enable analysis - part 2 - final (#6279)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-05-29 15:03:40 -07:00
Simão Ribeiro 7abe983ac0
Add ConnectionRefused as transient network error so gRPC retry works when collector is down (#6259)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-05-27 22:39:49 -07:00
dependabot[bot] 844e148f68
Bump DavidAnson/markdownlint-cli2-action from 19.1.0 to 20.0.0 (#6285)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-05-27 22:12:04 -07:00
StepSecurity Bot 3f9b636f06
[StepSecurity] ci: Harden GitHub Actions (#6286)
Signed-off-by: StepSecurity Bot <bot@stepsecurity.io>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
Co-authored-by: Cijo Thomas <cijo.thomas@gmail.com>
2025-05-27 21:40:26 -07:00
dependabot[bot] 6209ed8f80
Bump codecov/test-results-action from 1.1.0 to 1.1.1 (#6293)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-05-25 12:21:56 -07:00
Yevhenii Solomchenko 60a3839591
[Exporter.Zipkin] Update remote endpoint and remove the peer.service attribute (#6191)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
2025-05-23 11:41:27 -07:00
Ivan Cherkashnev 805dd6b4ab
Clean up infinite explicit bucket bounds to prevent duplicate histogram bucket output (#6290)
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-05-20 14:29:45 -07:00
dependabot[bot] 6828791c61
Bump github/codeql-action from 3.28.17 to 3.28.18 (#6288)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-05-19 15:15:12 -07:00
dependabot[bot] c638ef67cf
Bump codecov/codecov-action from 5.4.2 to 5.4.3 (#6289)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-19 14:46:21 -07:00
dependabot[bot] 6420be005b
Bump fossas/fossa-action from 1.6.0 to 1.7.0 (#6284)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-05-16 10:25:09 -07:00
彭伟 ee720ba3a3
[otlp] Correct initial write position for gRPC in .NET Framework OTLP exporters (#6280)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-05-15 21:33:39 -07:00
Piotr Kiełkowicz 8c1e63894f
[OpenTelemetry] enable analysis - part 1 (#6263) 2025-05-07 22:22:15 -07:00
dependabot[bot] 9c9d8585f3
Bump github/codeql-action from 3.28.16 to 3.28.17 (#6271)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-05-07 16:14:08 -07:00
Martin Costello c4268fe92b
[infra] Add GitHub Actions test logger (#6272)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-05-07 15:55:11 -07:00
OpenTelemetry Bot e371d7f02d
[release] Prepare release coreunstable-1.12.0-beta.1 (#6276) 2025-05-06 16:12:11 -07:00
Piotr Kiełkowicz 24a13ab91c
[OpenTelemetry.Tests] enable analysis (#6265) 2025-04-30 11:32:32 -07:00
OpenTelemetry Bot 2ec8931fc8
[release] Core stable release 1.12.0 updates (#6269) 2025-04-29 21:56:04 -07:00
OpenTelemetry Bot a67acd87d5
[release] Prepare release core-1.12.0 (#6268)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-04-29 13:45:34 -07:00
Piotr Kiełkowicz ceebd456f1
[Exporter.OpenTelemetry.Protocol.Tests] enable analysis (#6264) 2025-04-25 11:55:09 -07:00
Piotr Kiełkowicz 13ed63a88c
[Exporter.OpenTelemetryProtocol] enable analysis (#6251) 2025-04-24 11:49:15 -07:00
dependabot[bot] 0252f6ca0d
Bump sigstore/cosign-installer from 3.8.1 to 3.8.2 (#6261)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-04-23 21:34:14 -07:00
dependabot[bot] 4792d020f8
Bump github/codeql-action from 3.28.15 to 3.28.16 (#6260)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-04-23 18:44:13 -07:00
Piotr Kiełkowicz d5f44d0ae5
[Tests.Stress*] enable analysis (#6253) 2025-04-23 16:15:16 -07:00
Piotr Kiełkowicz fd1b5afd08
[Benchmarks] enable analysis (#6254)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-04-23 11:32:27 -07:00
Martin Costello 177596891a
Publish NuGet packages as GitHub Artifacts (#6255) 2025-04-22 14:03:09 -07:00
dependabot[bot] 1edcddbe00
Bump codecov/codecov-action from 5.4.0 to 5.4.2 (#6252)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
2025-04-16 09:41:25 -07:00
Piotr Kiełkowicz 31fb3bdf35
[OpenTelemetry.Api.Tests] enable analysis (#6246)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-04-14 13:46:46 -07:00
Piotr Kiełkowicz ea70cd550d
[Exporter.OpenTelemetry.Protocol] update PersistentStorage (#6249) 2025-04-14 11:38:20 -07:00
dependabot[bot] ab32e39c14
Bump dotnet-sdk from 9.0.202 to 9.0.203 (#6243)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-04-10 12:20:37 -07:00
Yevhenii Solomchenko fbbe939dd4
[Examples.Microservice] migrate to Minimal Hosting Model (#6247) 2025-04-10 11:19:39 -07:00
Piotr Kiełkowicz 7c0eab2f42
[TestApp.AspNetCore] enable analysis (#6240)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-04-09 15:22:40 -07:00
Piotr Kiełkowicz 98b3986620
[OpenTelemetry.Api] enable analysis (#6206)
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2025-04-09 13:43:15 -07:00
dependabot[bot] bb8abee277
Bump github/codeql-action from 3.28.14 to 3.28.15 (#6239)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-04-09 10:59:13 -07:00
Piotr Kiełkowicz ff009146a9
[Example/WorkerService] enable analysis (#6220)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-04-09 09:17:08 -07:00
Rajkumar Rangaraj aa73ce3aaf
[otlp] Remove Grpc.Core support for .NET Framework and .NET Standard 2.0 in OTLP exporter (#6229) 2025-04-08 12:09:30 -07:00
Piotr Kiełkowicz f183a6a11e
[Examples.Console] enable analysis (#6221)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-04-08 11:30:42 -07:00
Yevhenii Solomchenko 72f7348b57
[Examples.GrpcService] migrate to Minimal Hosting Model (#6225)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-04-08 09:54:20 -07:00
Piotr Kiełkowicz 6e6ce171e8
[repo] OpenSSF Scorecard - pin docker images to exact digest (#6230)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-04-07 16:49:40 -07:00
dependabot[bot] 04dd5d149c
Bump github/codeql-action from 3.28.12 to 3.28.14 (#6236)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-04-07 13:25:38 -07:00
Jean Bisutti 06ef55786a
Remove unused import (#6232)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-04-04 11:37:01 -07:00
Yevhenii Solomchenko 20988528fd
[OpenTelemetry] Improve memory efficiency in Dispose (#6212)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-04-04 10:56:59 -07:00
xiang17 180c9e84db
[Exporter.Console] Update otel-collector version to be compatible with debug exporter (#6223) 2025-04-02 16:03:53 -07:00
OpenTelemetry Bot 528d642b44
Add ossf-scorecard scanning workflow (#6218)
Co-authored-by: otelbot <197425009+otelbot@users.noreply.github.com>
2025-03-31 19:31:26 -07:00
Piotr Kiełkowicz 72a5f7c36e
[Example/WebApi] enable analysis (#6215) 2025-03-31 10:55:12 -07:00
Piotr Kiełkowicz 868ae707fc
[repo] GitHub Actions hardening (#6214) 2025-03-31 09:05:40 -07:00
Piotr Kiełkowicz 3e8c537192
[Examples/Utils] enable analysis (#6211) 2025-03-28 09:06:24 -07:00
Piotr Kiełkowicz 27116b2210
[AotCompatibility.TestApp] enable analysis (#6210) 2025-03-27 09:06:58 -07:00
Piotr Kiełkowicz a8ede4bdc5
[documentation] fix links to internal example (#6207) 2025-03-26 11:35:21 -07:00
Piotr Kiełkowicz f63f8d93f8
[Extensions.Hosting.Tests] enable analysis (#6204)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-03-25 20:05:43 -07:00
Piotr Kiełkowicz 242cebabfc
[W3cTraceContext.Tests] enable analysis (#6202)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-03-25 11:00:12 -07:00
Piotr Kiełkowicz c1472c76fd
[Examples.AspNetCore] enable analysis (#6193)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-03-25 10:34:21 -07:00
dependabot[bot] 6c69fb2b8c
Bump fossas/fossa-action from 1.5.0 to 1.6.0 (#6201)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-03-24 20:52:56 -07:00
Jakub Januszkiewicz d01e7f9699
[Exporter.Console] use Environment.NewLine instead of hardcoded LF in console exporters (#6203) 2025-03-24 16:01:24 -07:00
Piotr Kiełkowicz 89e5999e69
[Exporter.Console] enable analysis (#6195)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-03-21 13:24:42 -07:00
nima nikoonazar 99b686e1ad
[Exporter.OTLP] Optimize GetHeaders by Spans (#6179)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
Co-authored-by: xiang17 <xili9@microsoft.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-03-21 11:49:14 -07:00
Ali Mahboubi 647f1b17a1
[Api] support for adding default tags to tracer (#6137)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
2025-03-21 10:28:34 -07:00
dependabot[bot] 402ed87689
Bump dotnet-sdk from 9.0.201 to 9.0.202 (#6196)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-03-20 15:23:03 -07:00
Piotr Kiełkowicz 3be15201d7
[repo] Remove unused PackageVersion definitions (#6197) 2025-03-20 15:07:32 -07:00
Piotr Kiełkowicz 807aa26d20
[Exporter.Zipkin] - enable analysis (#6189)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-03-18 12:17:12 -07:00
Piotr Kiełkowicz aa5b0423ff
[Extensions.Propagators] enable analysis (#6192) 2025-03-18 11:50:53 -07:00
Piotr Kiełkowicz 643e80ef53
[repo] Standardize Tests file names (#6190) 2025-03-17 12:56:56 -07:00
Piotr Kiełkowicz a8f1076e4d
[Exporter.Prometheus] - enable analysis (#6171)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-03-13 14:43:18 -07:00
Piotr Kiełkowicz 5635e6b8d6
[Exporter.Zipkin] Unskip ErrorGettingUriFromEnvVarSetsDefaultEndpointValue test (#6184)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-03-13 14:24:47 -07:00
Piotr Kiełkowicz 2862c884e0
[Examples.GrpcService] enable analysis (#6186)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-03-13 14:09:52 -07:00
dependabot[bot] 13a06da855
Bump dotnet-sdk from 9.0.200 to 9.0.201 (#6182)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-03-13 13:52:09 -07:00
Martin Costello cc2ffdad5b
[repo] codecov - Fix workflow warning (#6185) 2025-03-13 11:26:40 -07:00
Piotr Kiełkowicz c977f73246
[Shims.OpenTracing] enable code analysis (#6160)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-03-11 14:55:03 -07:00
Piotr Kiełkowicz 8943733bcd
[Exporter.InMemory] - enable analysis (#6165) 2025-03-11 11:00:53 -07:00
Marcin Jahn 796f49bcfd
Update docs in BatchExportProcessorOptions.cs (#6177)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
2025-03-07 09:02:11 -08:00
Martin Costello 9b83e7bf09
Update OpenTelemetry.Api CHANGELOG (#6172) 2025-03-05 09:45:42 -08:00
OpenTelemetry Bot 4af4abd7c9
[release] Prepare release coreunstable-1.11.2-beta.1 (#6170) 2025-03-04 16:20:03 -08:00
OpenTelemetry Bot 0c53d9f7dd
[release] Core stable release 1.11.2 updates (#6169) 2025-03-04 14:51:54 -08:00
OpenTelemetry Bot 7f2eb92952
[release] Prepare release core-1.11.2 (#6166) 2025-03-04 13:53:31 -08:00
Piotr Kiełkowicz 2ea6e04dab
[repo] ProviderBuilderExtensions.Tests - AnalysisLevel latest-all (#6156)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-03-03 21:02:58 -08:00
Steve Gordon 1b555c1201
Revert TraceContextPropagator performance refactor from 5749 (#6161) 2025-03-03 11:55:52 -08:00
Timothy Mothra 577337c992
[OTLP] include status code in failure log (#6154) 2025-02-28 08:56:04 -08:00
Piotr Kiełkowicz 752172890c
[repo] Bump test packages (#6157) 2025-02-26 12:03:17 -08:00
Simon Cropp 71e6cb49aa
use some collection expressions (#6106)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-02-25 10:00:09 -08:00
Piotr Kiełkowicz ec9f76127e
[otlp] changelog cleanup (#6153) 2025-02-25 09:44:41 -08:00
Matt Hensley 7b076c64b0
[otlp] Change serialization of null protobuf values (#6149)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-02-24 18:46:15 -08:00
Mikel Blanchard e5f65ca696
[repo] Move Blanch to approver (#6145) 2025-02-21 12:08:24 -08:00
OpenTelemetry Bot 0aba0cdc26
Add FOSSA scanning workflow (#6136)
Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2025-02-19 10:41:46 -08:00
Simon Cropp c643b7fb22
[repo] remove incorrect null suppressions (#6075)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
2025-02-14 09:41:12 -08:00
Simon Cropp 62af9ad84f
remove some array and list allocations (#6133) 2025-02-13 11:43:22 -08:00
dependabot[bot] 3c62f6b1b1
Bump dotnet-sdk from 9.0.102 to 9.0.200 (#6131)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-12 11:31:37 -08:00
Simon Cropp 8f17a0ea54
remove redundant ?? string.Empty in GetSampler (#6078)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-02-11 17:04:04 -08:00
Simon Cropp 41e1a59eb9
Increase use of NotNullWhen polyfill (#6090)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-02-11 15:03:29 -08:00
Piotr Kiełkowicz 720d610fa8
[repo] Use public ARM64 runners (#6128)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2025-02-11 09:56:49 -08:00
Piotr Kiełkowicz 89ba8073d8
[docs] prometheus example - update feature flag to support OTLP receiver (#6130) 2025-02-11 08:33:59 -08:00
Pent Ploompuu 71abd4169b
[repo] Small cleanup/simplification (#6048)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
2025-02-08 12:38:51 -08:00
Simon Cropp 0c26ce2b3b
remove redundant isDisposing pattern in StressTest (#6082)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-02-05 18:28:26 -08:00
Simon Cropp c99f9a1d6d
remove redundant instrumentations != null checks (#6091)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-02-05 18:15:01 -08:00
Rajkumar Rangaraj 36b777b16f
[otlp] Fix incorrect length handling of Status.Description exceeding 127 bytes (#6119)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2025-01-31 16:15:30 -08:00
Simon Cropp cccf1ec3b7
fix incorrect as usage in MessageReceiver (#6105)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-01-31 09:53:07 -08:00
Alan West 0cfbf86a8c
[repo] Add Rajkumar Rangaraj as maintainer (#6114) 2025-01-30 10:50:22 -08:00
Simon Cropp 89ea5c6698
[repo] Replace some fields with auto properties (#6104)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2025-01-27 13:58:32 -08:00
Simon Cropp c44984ef93
[repo] Clean up unused variables (#6100)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2025-01-27 10:08:25 -08:00
Mikel Blanchard e5a7095daa
[repo] Fix tests reliant on bugged sampling behavior (#6097)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2025-01-27 09:50:53 -08:00
Simon Cropp cd8cb41d9f
[repo/tests] use some utf8 string literals (#6107) 2025-01-27 09:37:40 -08:00
Simon Cropp b508b84676
[Exporter.Prometheus] remove redundant if in WriteUnicodeNoEscape (#6077)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2025-01-24 10:49:16 -08:00
Simon Cropp 275a4463cf
[repo] remove redundant interpolation (#6098)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2025-01-24 09:34:54 -08:00
Simon Cropp 8fa00cb9d6
[repo] move PooledList to Zipkin (#6092) 2025-01-24 09:21:21 -08:00
Rajkumar Rangaraj 2828321d1b
[otlp] Fix .NET Framework gRPC Export Client Default Success Response Status (#6099) 2025-01-23 16:53:30 -08:00
Mikel Blanchard 292953799b
[repo] Add "release details" links in release notes (#6096) 2025-01-23 12:07:15 -08:00
Mikel Blanchard db828ceb44
[docs] Tweak releasing guide for new automation around release notes (#6089) 2025-01-23 10:53:27 -08:00
OpenTelemetry Bot ef090adab3
[release] Core stable release 1.11.1 updates (#6088)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2025-01-22 17:17:13 -08:00
Mikel Blanchard feba0d40fa
[repo] Release notes automation tweak (#6087) 2025-01-22 17:04:23 -08:00
OpenTelemetry Bot e3855e80b8
[release] Prepare release core-1.11.1 (#6086)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2025-01-22 14:47:42 -08:00
Rajkumar Rangaraj 7037824da6
[otlp] Fix issues with exporting using gRPC in .NET Framework apps (#6083)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2025-01-22 13:02:39 -08:00
Simon Cropp d9864b1e1d
[sdk] Remove redundant NotNullWhen in SelfDiagnosticsConfigParser.TryParseLogDirectory (#6073)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2025-01-21 18:37:23 -08:00
Simon Cropp 54f7d9eb87
[sdk] Simplify dispose code in SelfDiagnostics (#6072)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2025-01-21 17:56:36 -08:00
Simon Cropp 6e8e190039
[repo] remove ci-concurrency from sln items (#6071)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2025-01-21 16:50:44 -08:00
Simon Cropp 48e5a0804b
[api-logs] Remove unneeded if check in LogRecordAttributeList (#6076)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2025-01-21 16:02:56 -08:00
dependabot[bot] fdca498b44
Bump DavidAnson/markdownlint-cli2-action from 19.0.0 to 19.1.0 (#6081)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-21 15:51:21 -08:00
Mikel Blanchard c5acd9f1d3
[repo] Release notes automation (#6070) 2025-01-21 15:39:17 -08:00
Mikel Blanchard dcdaaae6e3
[docs] Add exception logging best practices (#6037) 2025-01-16 11:02:16 -08:00
OpenTelemetry Bot f7df3e1714
[release] Prepare release coreunstable-1.11.0-beta.1 (#6065) 2025-01-16 09:54:42 -08:00
OpenTelemetry Bot 75d947c58f
[release] Core stable release 1.11.0 updates (#6064) 2025-01-15 18:27:18 -08:00
OpenTelemetry Bot 837e852232
[release] Prepare release core-1.11.0 (#6063)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2025-01-15 16:06:45 -08:00
Mikel Blanchard 3d1f74db5a
[sdk-tracing] Allow samplers to set TraceState for propagation-only spans (#6058) 2025-01-15 10:47:29 -08:00
dependabot[bot] 17bbd834e5
Bump dotnet-sdk from 9.0.101 to 9.0.102 (#6061)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2025-01-15 10:35:51 -08:00
Mikel Blanchard 90dd82c382
[docs-metrics] Link to advice guide in docs (#6062) 2025-01-15 10:24:26 -08:00
Mikel Blanchard cd31c57af5
[repo] Trigger builds when SDK is changed (#6050) 2025-01-06 11:27:17 -08:00
dependabot[bot] 6100452988
Bump DavidAnson/markdownlint-cli2-action from 18.0.0 to 19.0.0 (#6044)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-31 11:36:25 -08:00
Dudi Likvornik 7ae7b131e8
[sdk-metrics] Include Meter.Tags in metric identity resolution (#5982)
Co-authored-by: Cijo Thomas <cijo.thomas@gmail.com>
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-12-26 10:38:21 -08:00
Cijo Thomas 408a52d62f
[repo] Breakdown emeritus into roles in main README (#6038) 2024-12-19 11:27:39 -08:00
Piotr Kiełkowicz 7d7d37ae42
[shared] Bump OTLP proto files to 1.5.0 (#6039) 2024-12-18 10:01:11 -08:00
Piotr Kiełkowicz 29068585a1
[Exporter.OpenTelemetryProtocol] Remove PeerServiceResolver from compilation (#6032)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-12-17 13:39:06 -08:00
Piotr Kiełkowicz c3bb89ae50
[repo] Pin Ubuntu to 22.04 (#6036) 2024-12-17 10:30:14 -08:00
Cijo Thomas e0a10f7890
Minor improvements to example doc (#6033) 2024-12-16 11:29:16 -08:00
David Ashpole c94c422e31
[prometheus] Update links to openmetrics to reference the v1.0.0 release (#6029) 2024-12-13 13:11:49 -08:00
Mikel Blanchard 8e6d814f0f
[repo] Add dependabot.yml to solution (#6028) 2024-12-13 12:20:04 -08:00
dependabot[bot] ad4e80e282
Bump DavidAnson/markdownlint-cli2-action from 16.0.0 to 18.0.0 (#6027)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-12-13 12:08:55 -08:00
dependabot[bot] fc9de8b9bc
Bump codecov/codecov-action from 4 to 5 (#6025)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-13 11:40:08 -08:00
dependabot[bot] f69d9c53e5
Bump dotnet-sdk from 9.0.100 to 9.0.101 (#6026)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-13 11:26:03 -08:00
OpenTelemetry Bot a6582704cd
[release] Prepare release core-1.11.0-rc.1 (#6021) 2024-12-11 14:55:15 -08:00
Rajkumar Rangaraj 80287c061e
[otlp] Enable OTLP exporter for multiple registrations (#6020) 2024-12-11 14:08:10 -08:00
Rajkumar Rangaraj 1f39623af5
[otlp] Avoid filling new buffer on expansion (#6019) 2024-12-10 22:19:03 -08:00
Rajkumar Rangaraj 75a683eab7
[otlp] Update changelog / Remove OtlpExporter resource modification code (#6015)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-12-10 13:23:31 -08:00
Rajkumar Rangaraj be8209987b
[otlp] Expand array buffer / add tests to existing base buffer (#6013)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-12-10 12:42:08 -08:00
Mikel Blanchard 145e7ade6f
[repo] Allow dependabot to bump SDK patch version (#6011) 2024-12-06 09:22:05 -08:00
Rajkumar Rangaraj 305597d9d5
[otlp] Fix TODOs, Refactor Buffer Size Handling, and Cleanup Environment Variables (#6009)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-12-05 11:04:12 -08:00
Timothy Mothra 0c775e58fa
[otlp] refactor constants (#6010) 2024-12-03 13:57:57 -08:00
Utkarsh Umesan Pillai 44bc90a25b
[repo] Move Utkarsh to Emeritus (#6008)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
2024-12-03 10:29:40 -08:00
Rajkumar Rangaraj b9be07a27d
[otlp] Remove the Google.Protobuf / Grpc packages, and replace the logs and metrics with the new implementation (#6005)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-12-02 16:21:30 -08:00
Rajkumar Rangaraj 84e6afbeba
[otlp] Replace the current trace implementation with the new one (#6003) 2024-11-27 14:28:38 -08:00
Mikel Blanchard 7eeddf5f22
[otlp] Refactor shared protobuf otlp export client code into a base class (#6001) 2024-11-27 11:37:55 -08:00
Rajkumar Rangaraj 88d2ad60bb
[otlp] Grpc Status check and retry (#6000)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-11-26 11:10:03 -08:00
Rajkumar Rangaraj f9a0b4c657
[otlp] Buffer Size Handling with Retry Logic and OTLP Signal Path (#5988) 2024-11-22 13:03:40 -08:00
Mikel Blanchard e3665c95c2
[otlp] Fix ProtobufOtlpLogSerializer pool handling (#5989) 2024-11-18 15:27:50 -08:00
Rajkumar Rangaraj 4bc398f9d1
[otlp] Deserialize GrpcStatusDetailsHeader to Retrieve Grpc Retry Delay (#5980)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-11-18 11:39:16 -08:00
Rajkumar Rangaraj 68c79a3bfd
[otlp] Add Grpc vendored code (#5981) 2024-11-18 11:25:50 -08:00
Utkarsh Umesan Pillai 913bccfdfc
[perf] Update Stress Test to avoid false sharing (#5985) 2024-11-18 09:45:13 -08:00
Rajkumar Rangaraj 2ae01a73fe
[otlp] Add Log and Mertic Exporter to transmit custom serialized data (#5977)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-11-15 09:05:52 -08:00
Rajkumar Rangaraj 1e7397e779
[otlp] Add Trace Exporter to transmit custom serialized data. (#5969)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-11-14 12:36:34 -08:00
Timothy Mothra b201d709c1
[otlp] OTLP Exporter Custom serializer - (Part 3) Outstanding TODOs (#5975)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-11-14 11:14:25 -08:00
Cijo Thomas 74fc70e8eb
[docs] Document links maybe added after Activity creation (#5972) 2024-11-12 22:08:12 -08:00
OpenTelemetry Bot a5fa611774
[release] Prepare release coreunstable-1.10.0-beta.1 (#5971) 2024-11-12 13:52:15 -08:00
OpenTelemetry Bot 60a683986a
[release] Core stable release 1.10.0 updates (#5970) 2024-11-12 13:46:13 -08:00
OpenTelemetry Bot 626b30e127
[release] Prepare release core-1.10.0 (#5968) 2024-11-12 12:58:56 -08:00
Mikel Blanchard 8ae945345f
[repo] Updates for .NET 9 release (#5967) 2024-11-12 12:42:14 -08:00
Tom Tan 6fbae0d655
[docs] Add digital signing section with sigstore details (#5961)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-11-12 10:57:27 -08:00
Timothy Mothra ae3feb9bcd
[otlp] OTLP Exporter Custom serializer - (Part 2) Histogram and Exponential Histogram (#5962) 2024-11-12 10:04:25 -08:00
Mikel Blanchard d113ecfbed
[docs-metrics] Add content for histogram bucket configuration via advice api (#5965) 2024-11-11 12:28:33 -08:00
Mikel Blanchard 2aae6e12d4
[tests] Clean up class structure in metrics tests (#5960) 2024-11-08 18:58:57 -08:00
Timothy Mothra 60445836cc
[otlp] OTLP Exporter Custom serializer - (Part 1) Counter and Gauge (#5958) 2024-11-08 15:29:33 -08:00
Reiley Yang e3b920c0da
Move Reiley Yang 🐇 to Emeritus👋 (#5959)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-11-08 10:13:38 -08:00
Mikel Blanchard 8c1cd6488e
[docs] Tweaks for stable metric point reclaim (#5957) 2024-11-08 10:05:36 -08:00
xiang17 112e17f50e
[sdk-metrics] Stablize MetricPoint reclaim feature for delta aggregation (#5956) 2024-11-07 15:03:16 -08:00
Alan West 1e1201ad02
[repo] Add Rajkumar Rangaraj as approver (#5953)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-11-05 17:02:19 -08:00
Mikel Blanchard 4b56c5f567
[otlp] Remove the direct dependency on Microsoft.Extensions.Configuration.Binder (#5951) 2024-11-04 13:04:35 -08:00
Mikel Blanchard 53b85ceef9
[otlp] Custom serialzer resource tweaks (#5947) 2024-11-04 11:39:28 -08:00
OpenTelemetry Bot 47aff6264e
[release] Prepare release core-1.10.0-rc.1 (#5949) 2024-11-01 14:51:08 -07:00
Mikel Blanchard 7c0f24c177
[sdk] Expose the ctor on Batch<T> which accepts a single item (#5642)
Co-authored-by: Cijo Thomas <cijo.thomas@gmail.com>
2024-11-01 14:10:00 -07:00
Rajkumar Rangaraj ed1b27f592
[otlp] Update TraceSerializer to use attributes / dropped from state. (#5946)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-10-31 17:19:25 -07:00
Mikel Blanchard dc7f1ebb6f
[otlp] OTLP Exporter Custom serializer - Log Scopes (#5945) 2024-10-31 16:58:37 -07:00
Rajkumar Rangaraj 1fc0ebcceb
[otlp] OTLP Exporter Custom serializer - Logs (#5941) 2024-10-31 11:42:05 -07:00
xiang17 09b654ec41
[docs] Update verb tense grammar for CHANGELOGs (#5940)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-10-31 10:27:45 -07:00
Mikel Blanchard 956f62146c
[repo] Add content for 1.10.0 to release notes (#5937) 2024-10-31 10:18:44 -07:00
Rajkumar Rangaraj 6fa4492a70
[otlp] OTLP Exporter Custom serializer - Complete Traces (#5930)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-10-30 11:29:41 -07:00
Mikel Blanchard 858737cdb0
[console] Support ActivitySource.Tags (#5935) 2024-10-30 09:48:42 -07:00
Tom Tan 451a94b2d0
[docs] Fix sample code in README (#5933) 2024-10-29 10:04:55 -07:00
Tom Tan 84ff215a5d
[BUILD] Signing OpenTelemetry .NET DLLs Using Sigstore certificate (#5880)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-10-28 15:31:21 -07:00
Rajkumar Rangaraj d45060b434
[otlp] OTLP Exporter Custom serializer - Spans (#5928)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-10-28 10:08:30 -07:00
xiang17 8de335c486
[sdk-metrics] Promote cardinality limit view API from experimental to stable (#5926)
Co-authored-by: Rajkumar Rangaraj <rajrang@microsoft.com>
2024-10-28 09:51:10 -07:00
xiang17 9f41eadf03
[sdk-metrics] Promote overflow attribute from experimental to stable (#5909)
Co-authored-by: Reiley Yang <reyang@microsoft.com>
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-10-25 10:58:18 -07:00
Rajkumar Rangaraj 5efc683279
[otlp] OTLP Exporter Custom serializer Part 2 - Resources (#5916)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-10-25 09:46:33 -07:00
Weihan Li 5dff99f8a0
[shared] Use nameof for CallerArgumentExpression in Guard helpers (#5917) 2024-10-22 17:46:00 -07:00
Mikel Blanchard 25a9366679
[sdk-metrics] Fix a race condition when a metric is deactivated and re-activated in the same collection cycle (#5908)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
2024-10-21 14:40:11 -07:00
Rajkumar Rangaraj 0eebf97a4b
[otlp] OTLP Exporter Custom serializer Part 1 - WritingPrimitives (#5910)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-10-21 12:53:42 -07:00
Piotr Kiełkowicz f1f2664021
[Examples.AspNetCore] Bump OTel Collector to 0.111.0 (#5913) 2024-10-21 10:30:53 -07:00
Sandy Chen 0343715f49
Improve Integration Test by Generating TLS/mTLS Certificates via MSBuild (#5818)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2024-10-16 18:22:19 -07:00
Rajkumar Rangaraj cddc09127f
[otlp] Export instrumentation scope attributes from ActivitySource.Tags (#5897)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-10-15 15:42:26 -07:00
Richard Chukwu 963ec41598
[repo] Add RELEASENOTES and READMEs to NuGet packages (#5885)
Co-authored-by: Reiley Yang <reyang@microsoft.com>
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-10-15 13:01:10 -07:00
Timothy Mothra dba7d251f6
[repo] Update stale.yml - reduce days before stale to 300 (#5902) 2024-10-14 14:35:26 -07:00
joegoldman2 bb832226d3
[sdk-metrics] Use FrozenSet when looking up explicit bounds (#5899)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-10-14 10:50:59 -07:00
Piotr Kiełkowicz 1a68b49ed6
[repo] cleanup #nullable disable (#5901)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-10-14 09:24:06 -07:00
Piotr Kiełkowicz 8df7670dd1
[docs] Nullable annotations (#5900) 2024-10-14 09:09:59 -07:00
Yevhenii Solomchenko f3cd0e7ac4
[Tests] Nullable (#5882)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-10-11 12:31:35 -07:00
Yevhenii Solomchenko 36d5900be0
[Examples] Nullable (#5881)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-10-11 11:27:43 -07:00
Cijo Thomas b0ebf3518c
[docs-metrics] Improve View documentation to show its additive nature (#5896) 2024-10-10 14:15:16 -07:00
Mikel Blanchard 331e1267b6
[repo] Directory.Packages.props cleanup (#5886) 2024-10-10 09:30:46 -07:00
Reiley Yang 2499ecdf8e
[docs] Clarify the position regarding bot generated and AI-assisted PRs (#5894) 2024-10-09 23:50:52 -07:00
Mikel Blanchard 9b08508541
[repo] Mitigate vulnerabilities in System.Text.Json 8.0.4 package (#5891) 2024-10-08 12:45:14 -07:00
Rajkumar Rangaraj 66c2e4b778
[sdk] Support split reads in OTEL_DIAGNOSTICS.json config file parser logic (#5884)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
2024-10-08 12:13:18 -07:00
Timothy Mothra a55a5ac997
[repo] Update stale.yml - reduce days before stale to 450 (#5888) 2024-10-07 16:26:10 -07:00
Mikel Blanchard 5106e3082f
[repo] Remove implicit using tweak as it is no longer needed (#5887)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
2024-10-06 09:39:57 -07:00
Yevhenii Solomchenko 02f4b2d978
[Benchmarks] Nullabe (#5875)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-10-04 14:20:03 -07:00
Mikel Blanchard 25d99a56bf
[repo] Mitigate vulnerabilities in System.Text.Json 8.0.0 packages (#5874) 2024-10-04 13:38:15 -07:00
Yevhenii Solomchenko 19e1663c1e
[Extensions.Hosting.Tests] Nullable (#5862)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-10-01 14:16:32 -07:00
OpenTelemetry Bot f5023550bc
[release] Prepare release core-1.10.0-beta.1 (#5871) 2024-09-30 14:00:22 -07:00
Paulo Ferreira 1aa101bbcf
[docs] Fix RecordAndSample typo (#5870)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-09-30 11:50:12 -07:00
Rajkumar Rangaraj f4e392301f
[sdk-metrics] Support .NET 9 Synchronous Gauge (#5867)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-09-30 11:41:21 -07:00
Piotr Kiełkowicz cc0b9e9d0f
[docs] README - Fix links to membership descriptions (#5865) 2024-09-26 09:00:16 -07:00
Mikel Blanchard 9cca0ac8f1
[repo] Add Mothra as a triager (#5864) 2024-09-25 13:25:25 -07:00
Mikel Blanchard c8a8913152
[repo] Take advantage of System.Threading.Lock when compiling against .NET9 (#5861) 2024-09-24 14:47:16 -07:00
Yevhenii Solomchenko c1f1c167d2
[Api] Nullable (#5801)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-09-24 14:31:04 -07:00
Mikel Blanchard 2097f477f3
[api] Context nullable annotations (#5850) 2024-09-24 13:52:51 -07:00
Piotr Kiełkowicz 3a09a91b1c
Cleanup W3CTraceContextTests (#5858)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-09-24 11:23:12 -07:00
Yevhenii Solomchenko 12a8ab0f45
[api] Mark ActivityExtensions.RecordException obsolete (#5841)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-09-24 10:44:10 -07:00
Timothy Mothra 3c38a4b00b
[repo] Update stale.yml - reduce days before stale to 600 (#5857) 2024-09-24 09:49:06 -07:00
Rajkumar Rangaraj d650352b8f
[sdk-metrics] Add support for .NET 9 Advice API (#5854)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
Co-authored-by: Reiley Yang <reyang@microsoft.com>
2024-09-23 15:32:46 -07:00
Mikel Blanchard 1c02da746e
[docs] Contributing updates (#5856) 2024-09-23 15:06:20 -07:00
Robert Coltheart 60b7d9baf3
[prometheus] Support meter-level tags (#5837)
Co-authored-by: Cijo Thomas <cijo.thomas@gmail.com>
2024-09-23 09:56:38 -07:00
Rajkumar Rangaraj c1a1931319
[repo] Update the System.Diagnostics.DiagnosticSource and Microsoft.Extensions.* packages to .NET 9.0 RC.1 (#5853) 2024-09-20 12:51:14 -07:00
Piotr Kiełkowicz 86c1d8c2b3
[repo] Simplify preprocessor directives after dropping support for .NET 6 and .NET7 (#5851)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-09-20 09:21:00 -07:00
Piotr Kiełkowicz b941f1e4d6
[docs] Typo fixes (double the) (#5852) 2024-09-20 09:09:52 -07:00
Rajkumar Rangaraj cd01f932a6
[repo] Replace .NET6 target with .NET9 (#5832)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
2024-09-19 17:32:10 -07:00
Mikel Blanchard 6e1b5ab577
[api] Baggage nullable annotations (#5840) 2024-09-19 13:14:57 -07:00
Yevhenii Solomchenko 1c01770882
[Shims, W3C.Tests] Nullable (#5797)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-09-16 15:03:39 -07:00
Mikel Blanchard 9b83188ccd
[console, in-memory] Tweak nullable annotations in registration extensions (#5833) 2024-09-16 11:52:30 -07:00
Yevhenii Solomchenko 82b1fbd760
[Exporter.Prometheus] Nullable (#5791)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-09-13 20:45:28 -07:00
Yevhenii Solomchenko 6194d9bb17
[repo] How to maintain PublicApi files (#5823)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-09-12 13:05:49 -07:00
benon lukyamuzi 2b43c096f8
[zipkin\otlp] Call SendAsync on mobile (#5821)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-09-12 10:23:56 -07:00
Yevhenii Solomchenko 29798920da
[repo] Add Linux ARM64 to actions CI (#5824)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-09-12 10:08:54 -07:00
Timothy Mothra f7e2a78f4f
[repo] remove questions template and redirect to discussions (#5827)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-09-12 09:53:57 -07:00
Piotr Kiełkowicz 2d6b03f296
[repo] Always execute build-test step in CI workflow (#5828) 2024-09-12 09:22:09 -07:00
Yevhenii Solomchenko dd7405654f
[Exporter.Zipkin] Nullable (#5792)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-09-11 13:07:48 -07:00
Timothy Mothra 37535a5607
[repo] Update stale.yml - reduce days before stale to 900 (#5822) 2024-09-09 14:37:22 -07:00
Vishwesh Bankwar b46aae4dff
[repo] Move Vishwesh to Emeritus approver (#5817) 2024-09-09 11:38:42 -07:00
xiang17 dc8d3fd991
[repo] Add .NET 8 target for W3C Trace Context Integration Test in CI (#5800)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
2024-09-04 10:15:03 -07:00
Piotr Kiełkowicz 1479686a6e
[sdk] Improve readability of TracerProviderSdk initialization code (#5810)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-09-04 09:49:34 -07:00
Piotr Kiełkowicz 104c9f0e82
[repo] Extend NugetAudit by indirect references (#5812) 2024-09-04 09:34:20 -07:00
xiang17 685b73d3ac
[docs] Fix OTLP Collector config in example app (#5811) 2024-08-30 09:08:07 -07:00
Cijo Thomas 1a83643284
[benchmarks.logging] Use source generator pattern (#5807)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-08-29 11:51:44 -07:00
Mikel Blanchard f3a22c3022
[otlp] Workaround DI containers which create unregistered services (#5808) 2024-08-29 10:28:28 -07:00
Piotr Kiełkowicz ba8a0e4c13
[Propagators] Nullable annotations (#5767) 2024-08-28 09:56:15 -07:00
Yevhenii Solomchenko 1b3f1894d9
[api] Mark SetStatus & GetStatus ActivityExtensions obsolete (#5781)
Co-authored-by: Vishwesh Bankwar <vishweshbankwar@users.noreply.github.com>
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-08-21 15:08:29 -07:00
xiang17 c483222ea5
[repo] Remove .NET 7 target (#5795)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-08-21 09:09:13 -07:00
Timothy Mothra 456cd26a20
[repo] Update stale.yml - reduce days before stale to 1000 (#5796) 2024-08-20 21:51:54 -07:00
Cijo Thomas 41a72f45b9
Log Stress test to follow recommended logging practise (#5790) 2024-08-19 13:04:21 -07:00
Mikel Blanchard 0e011e8c3c
[repo] Add needs-triage label to new issues created via templates (#5788) 2024-08-16 15:33:49 -07:00
Mikel Blanchard a0316ec3c6
[sdk] Switch a couple guard calls to debug.assert in CircularBuffer (#5789) 2024-08-16 12:42:42 -07:00
Timothy Mothra 5f13315926
[repo] update stale automation to inspect issues (#5787)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-08-15 10:35:03 -07:00
Yevhenii Solomchenko 5a0b686559
[repo] Enable NuGetAudit (#5784)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-08-15 09:41:23 -07:00
Mikel Blanchard 6ec1510729
[release] Add release notes link on stable releases (#5780) 2024-08-12 11:23:46 -07:00
Steve Gordon 83ecef862d
[api] Optimise `TraceContextPropagator.Extract` (#5749)
Co-authored-by: Vishwesh Bankwar <vishweshbankwar@users.noreply.github.com>
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-08-12 10:07:12 -07:00
Mikel Blanchard 230adaba57
[docs] Top-level doc showing how to initialize the OpenTelemetry SDK (#5762) 2024-08-08 11:09:06 -07:00
Vishwesh Bankwar b15f9a82e3
[repo] Add ReleaseNotes.md to include features shipped in stable release (#5772)
Co-authored-by: Cijo Thomas <cithomas@microsoft.com>
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-08-07 14:16:01 -07:00
Elmo Todurov 32c64d04de
[docs-metrics] Fix tuple vs KVP confusion in code sample (#5769) 2024-08-01 11:56:25 -07:00
Piotr Kiełkowicz 22a58aa89e
[Exporter.Console, Exporter.InMemory] Nullable (#5765) 2024-07-26 09:24:48 -07:00
Mikel Blanchard 05bb05a0dc
[sdk] Add OpenTelemetrySdk builder pattern (#5325) 2024-07-19 15:03:44 -07:00
Cijo Thomas 36c586ddcc
[benckmarks] Rename NoOp to Noop (#5752)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-07-17 11:04:36 -07:00
Steve Gordon 6a0a934107
[api] Fix `Fields` in `CompositeTextMapPropagator` (#5745)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-07-17 10:49:33 -07:00
Mikel Blanchard 46e076fbb7
[infra] Fix a couple paths in PR auto-label file change detection (#5751) 2024-07-16 12:38:35 -07:00
Cijo Thomas ccd3759ec8
[benchmarks] Add LogBenchmark when BatchProcessor is used (#5746)
Co-authored-by: Piotr Kiełkowicz <pkiekowicz@splunk.com>
Co-authored-by: Reiley Yang <reyang@microsoft.com>
2024-07-16 11:02:21 -07:00
Rajkumar Rangaraj dbe2ce35e7
Bump System.Text.Json version due to CVE-2024-30105 (#5744) 2024-07-11 11:25:23 -07:00
Piotr Kiełkowicz 46265e3379
[tests] Remove unused CustomTextMapPropagator (#5743) 2024-07-08 10:45:15 -07:00
Piotr Kiełkowicz da905a8264
[docs] Refresh getting started with AspNetCore and Jaeger (#5740) 2024-07-05 12:26:18 -07:00
Piotr Kiełkowicz 53cda157c9
Bump OTLP proto files to 1.3.2 (#5736) 2024-07-03 09:44:32 -07:00
Piotr Kiełkowicz d8ce51b1b4
[repo] Bump Microsoft.SourceLink.GitHub to 8.0.0 (#5728) 2024-06-28 09:27:15 -07:00
Mikel Blanchard 978b461771
[infra] Version validation in prepare release workflow (#5723) 2024-06-27 11:06:21 -07:00
Mikel Blanchard 7922e30255
[repo] Add Piotr as approver (#5710)
Co-authored-by: Alan West <3676547+alanwest@users.noreply.github.com>
2024-06-26 21:17:29 -07:00
Piotr Kiełkowicz 4d254eb278
[Exporter.OTLP - Tests] Nullable (#5720) 2024-06-25 10:12:30 -07:00
OpenTelemetry Bot 8cc51b8bca
[release] Prepare release coreunstable-1.9.0-beta.2 (#5716) 2024-06-24 12:57:02 -07:00
Piotr Kiełkowicz 206d117e81
[Exporter.OTLP] Mark as nullable (#5708)
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-06-24 11:59:51 -07:00
Mikel Blanchard b5cafe05f4
[infra] Prepare release automation improvements (#5714) 2024-06-24 11:29:59 -07:00
Mikel Blanchard 37b5f92254
[sdk] Organize related files into sub-folders (#5706) 2024-06-24 11:14:52 -07:00
joegoldman2 6d467d719d
[repo] Simplify preprocessor directives (#5712)
Co-authored-by: joegoldman2 <147369450+joegoldman@users.noreply.github.com>
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
2024-06-24 10:59:31 -07:00
jcin193 2f14c244e3
[prometheus] Fix collection output buffer management when its resized (#5676)
Co-authored-by: Reiley Yang <reyang@microsoft.com>
Co-authored-by: Mikel Blanchard <mblanchard@macrosssoftware.com>
Co-authored-by: Vishwesh Bankwar <vishweshbankwar@users.noreply.github.com>
2024-06-24 10:41:38 -07:00
Mikel Blanchard 4af3df9b81
[shared] Use CultureInfo.InvariantCulture in TagWriter (#5700) 2024-06-18 12:56:00 -07:00
Mikel Blanchard b1a21cc0dc
[repo] Stable version update automation tweaks (#5698) 2024-06-18 09:58:29 -07:00
OpenTelemetry Bot 237de185a7
[release] Prepare release coreunstable-1.9.0-beta.1 (#5697) 2024-06-14 15:40:23 -07:00
Mikel Blanchard 908b46ca2d
[repo] Bump OTelLatestStableVer to 1.9.0 and fix coreunstable test issues (#5696) 2024-06-14 15:34:34 -07:00
773 changed files with 18493 additions and 10343 deletions

4
.clomonitor.yml Normal file
View File

@ -0,0 +1,4 @@
# see https://github.com/cncf/clomonitor/blob/main/docs/checks.md#exemptions
exemptions:
- check: artifacthub_badge
reason: "Artifact Hub doesn't support .NET packages"

View File

@ -10,6 +10,9 @@ indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
[*.sh]
end_of_line = lf
[*.{cs,cshtml,htm,html,md,py,sln,xml}]
indent_size = 4
@ -41,7 +44,7 @@ csharp_indent_labels = flush_left
# Modifier preferences
csharp_preferred_modifier_order = public,private,protected,internal,file,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,required,volatile,async:suggestion
dotnet_style_require_accessibility_modifiers = for_non_interface_members:silent
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
# this. preferences
dotnet_style_qualification_for_field = true:suggestion
@ -53,8 +56,8 @@ dotnet_style_qualification_for_event = true:suggestion
csharp_style_var_for_built_in_types = true:silent
csharp_style_var_when_type_is_apparent = true:silent
csharp_style_var_elsewhere = true:silent
dotnet_style_predefined_type_for_locals_parameters_members = true:silent
dotnet_style_predefined_type_for_member_access = true:silent
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
# name all constant fields using PascalCase
dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = suggestion
@ -75,6 +78,7 @@ dotnet_style_readonly_field = true:suggestion
csharp_style_implicit_object_creation_when_type_is_apparent = true:suggestion
dotnet_style_prefer_simplified_interpolation = true:suggestion
dotnet_style_object_initializer = true:suggestion
csharp_style_prefer_primary_constructors = false:none
# Expression-level preferences
dotnet_style_object_initializer = true:suggestion
@ -82,21 +86,23 @@ dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_prefer_auto_properties = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable:none
# Expression-bodied members
csharp_style_expression_bodied_methods = false:silent
csharp_style_expression_bodied_constructors = false:silent
csharp_style_expression_bodied_operators = false:silent
csharp_style_expression_bodied_properties = true:silent
csharp_style_expression_bodied_indexers = true:silent
csharp_style_expression_bodied_accessors = true:silent
csharp_style_expression_bodied_methods = true:suggestion
dotnet_diagnostic.IDE0022.severity = suggestion # dotnet format doesn't respect the suggestion in the line above
csharp_style_expression_bodied_constructors = false:warning
csharp_style_expression_bodied_operators = true:suggestion
csharp_style_expression_bodied_properties = true:suggestion
csharp_style_expression_bodied_indexers = true:suggestion
csharp_style_expression_bodied_accessors = true:suggestion
# Pattern matching
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
@ -113,6 +119,7 @@ csharp_style_prefer_range_operator = false:none
csharp_style_pattern_local_over_anonymous_function = true:suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_style_namespace_declarations = file_scoped:warning
dotnet_style_namespace_match_folder = false:none
# Space preferences
csharp_space_after_cast = false
@ -128,10 +135,10 @@ csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
# Parentheses preferences
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:suggestion
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:suggestion
# Code analyzers
# CA1031: Do not catch general exception types
@ -152,7 +159,14 @@ dotnet_diagnostic.IDE0005.severity = warning
# RS0041: Public members should not use oblivious types
dotnet_diagnostic.RS0041.severity = suggestion
[obj/**.cs]
[*Tests.cs]
# CA1515: Disable making types internal for Tests classes. It is required by xunit
dotnet_diagnostic.CA1515.severity = none
# CA2007: Disable Consider calling ConfigureAwait on the awaited task. It is not working with xunit
dotnet_diagnostic.CA2007.severity = none
[**/obj/**.cs]
generated_code = true
[*.csproj]

1
.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
*.sh eol=lf

View File

@ -1,6 +1,7 @@
name: Bug report
title: "[bug] "
description: Create a report to help us improve
labels: ["bug"]
labels: [bug,needs-triage]
body:
- type: markdown
attributes:
@ -47,7 +48,7 @@ body:
- type: input
attributes:
label: Runtime Version
description: What .NET runtime version did you use? (e.g. `net462`, `net48`, `netcoreapp3.1`, `net6.0` etc. You can find this information from the `*.csproj` file)
description: What .NET runtime version did you use? (e.g. `net462`, `net48`, `net8.0`, etc. You can find this information from the `*.csproj` file)
validations:
required: true
@ -61,7 +62,7 @@ body:
- type: textarea
attributes:
label: Steps to Reproduce
description: Provide a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). We will close the issue if the repro project you share with us is complex or we cannot reproduce the behavior you are reporting. We cannot investigate custom projects, so don't point us to such, please.
description: Provide a [minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example). We will close the issue if the repro project you share with us is complex or we cannot reproduce the behavior you are reporting. We cannot investigate custom projects, so don't point us to such, please.
validations:
required: true
@ -83,3 +84,11 @@ body:
attributes:
label: Additional Context
description: Any additional information you think may be relevant to this issue.
- type: dropdown
attributes:
label: Tip
description: This element is static, used to render a helpful sub-heading for end-users and community members to help prioritize issues. Please leave as is.
options:
- "<sub>[React](https://github.blog/news-insights/product-news/add-reactions-to-pull-requests-issues-and-comments/) with :+1: to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it. Learn more [here](https://opentelemetry.io/community/end-user/issue-participation/).</sub>"
default: 0

7
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@ -0,0 +1,7 @@
# https://docs.github.com/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository#configuring-the-template-chooser
blank_issues_enabled: false
contact_links:
- name: Question
url: https://github.com/open-telemetry/opentelemetry-dotnet/discussions/new?category=q-a
about: Ask a question to help us improve our knowledge base and documentation.

View File

@ -1,6 +1,7 @@
name: Feature request
title: "[feature request] "
description: Suggest an idea for this project
labels: ["enhancement"]
labels: [enhancement,needs-triage]
body:
- type: markdown
attributes:
@ -52,3 +53,11 @@ body:
attributes:
label: Additional context
description: Any additional information you think may be relevant to this feature request.
- type: dropdown
attributes:
label: Tip
description: This element is static, used to render a helpful sub-heading for end-users and community members to help prioritize issues. Please leave as is.
options:
- "<sub>[React](https://github.blog/news-insights/product-news/add-reactions-to-pull-requests-issues-and-comments/) with :+1: to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it. Learn more [here](https://opentelemetry.io/community/end-user/issue-participation/).</sub>"
default: 0

View File

@ -1,21 +0,0 @@
name: Question
description: Ask a question to help us improve our knowledge base and documentation
labels: ["question"]
body:
- type: markdown
attributes:
value: |
> [!NOTE]
> Please ask questions using [GitHub Discussions](https://github.com/open-telemetry/opentelemetry-dotnet/discussions/new) instead of GitHub Issues.
- type: textarea
attributes:
label: What is the question?
description: Describe the question you have.
validations:
required: true
- type: textarea
attributes:
label: Additional context
description: Any additional information you think may be relevant to this question.

View File

@ -6,3 +6,70 @@ updates:
interval: "daily"
labels:
- "infra"
- package-ecosystem: "docker"
directory: "/examples/MicroserviceExample/WebApi"
schedule:
interval: "weekly"
day: "wednesday"
labels:
- "infra"
ignore:
- dependency-name: "*"
update-types:
- "version-update:semver-major"
- "version-update:semver-minor"
- package-ecosystem: "docker"
directory: "examples/MicroserviceExample/WorkerService"
schedule:
interval: "weekly"
day: "wednesday"
labels:
- "infra"
ignore:
- dependency-name: "*"
update-types:
- "version-update:semver-major"
- "version-update:semver-minor"
- package-ecosystem: "docker"
directory: "test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/IntegrationTest"
schedule:
interval: "weekly"
day: "wednesday"
labels:
- "infra"
ignore:
- dependency-name: "*"
update-types:
- "version-update:semver-major"
- "version-update:semver-minor"
- package-ecosystem: "docker"
directory: "test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests"
schedule:
interval: "weekly"
day: "wednesday"
labels:
- "infra"
ignore:
- dependency-name: "*"
update-types:
- "version-update:semver-major"
- "version-update:semver-minor"
- package-ecosystem: "dotnet-sdk"
directory: "/"
schedule:
interval: "weekly"
day: "wednesday"
labels:
- "infra"
ignore:
- dependency-name: "*"
update-types:
- "version-update:semver-major"
- "version-update:semver-minor"
- package-ecosystem: "pip"
directory: "test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests"
schedule:
interval: "weekly"
day: "wednesday"
labels:
- "infra"

View File

@ -20,14 +20,17 @@ on:
required: false
type: string
os-list:
default: '[ "windows-latest", "ubuntu-latest" ]'
default: '[ "windows-latest", "ubuntu-22.04", "ubuntu-22.04-arm" ]'
required: false
type: string
tfm-list:
default: '[ "net462", "net6.0", "net7.0", "net8.0" ]'
default: '[ "net462", "net8.0", "net9.0" ]'
required: false
type: string
permissions:
contents: read
jobs:
build-test:
@ -37,20 +40,30 @@ jobs:
os: ${{ fromJSON(inputs.os-list) }}
version: ${{ fromJSON(inputs.tfm-list) }}
exclude:
- os: ubuntu-latest
- os: ubuntu-22.04
version: net462
- os: ubuntu-22.04-arm
version: net462
- os: ubuntu-22.04-arm
version: net8.0
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
# Note: By default GitHub only fetches 1 commit. MinVer needs to find
# the version tag which is typically NOT on the first commit so we
# retrieve them all.
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v4
- name: Setup previous .NET runtimes
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
with:
dotnet-version: |
8.0.x
- name: Setup .NET
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
- name: dotnet restore ${{ inputs.project-name }}
run: dotnet restore ${{ inputs.project-name }} ${{ inputs.project-build-commands }}
@ -59,7 +72,18 @@ jobs:
run: dotnet build ${{ inputs.project-name }} --configuration Release --no-restore ${{ inputs.project-build-commands }}
- name: dotnet test ${{ inputs.project-name }}
run: dotnet test ${{ inputs.project-name }} --collect:"Code Coverage" --results-directory:TestResults --framework ${{ matrix.version }} --configuration Release --no-restore --no-build --logger:"console;verbosity=detailed" -- RunConfiguration.DisableAppDomain=true
run: >
dotnet test ${{ inputs.project-name }}
--collect:"Code Coverage"
--results-directory:TestResults
--framework ${{ matrix.version }}
--configuration Release
--no-restore
--no-build
--logger:"console;verbosity=detailed"
--logger:"GitHubActions;report-warnings=false"
--logger:"junit;LogFilePath=TestResults/junit.xml"
-- RunConfiguration.DisableAppDomain=true
- name: Install coverage tool
run: dotnet tool install -g dotnet-coverage
@ -68,15 +92,24 @@ jobs:
run: dotnet-coverage merge -f cobertura -o ./TestResults/Cobertura.xml ./TestResults/**/*.coverage
- name: Upload code coverage ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }}
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@fdcc8476540edceab3de004e990f80d881c6cc00 # v5.5.0
continue-on-error: true # Note: Don't fail for upload failures
env:
OS: ${{ matrix.os }}
TFM: ${{ matrix.version }}
token: ${{ secrets.CODECOV_TOKEN }}
with:
file: TestResults/Cobertura.xml
files: TestResults/Cobertura.xml
env_vars: OS,TFM
flags: ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }}
name: Code Coverage for ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }} on [${{ matrix.os }}.${{ matrix.version }}]
codecov_yml_path: .github/codecov.yml
token: ${{ secrets.CODECOV_TOKEN }}
- name: Upload test results ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }}
if: ${{ !cancelled() && hashFiles('./**/TestResults/junit.xml') != '' }}
uses: codecov/test-results-action@47f89e9acb64b76debcd5ea40642d25a4adced9f # v1.1.1
with:
env_vars: OS,TFM
flags: ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }}
name: Test results for ${{ inputs.code-cov-prefix }}-${{ inputs.code-cov-name }} on [${{ matrix.os }}.${{ matrix.version }}]
token: ${{ secrets.CODECOV_TOKEN }}

View File

@ -7,18 +7,19 @@ on:
branches: [ 'main*' ]
permissions:
issues: write
pull-requests: write
contents: read
jobs:
add-labels-on-issues:
permissions:
issues: write
if: github.event_name == 'issues' && !github.event.issue.pull_request
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: check out code
uses: actions/checkout@v4
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Add labels for package found in bug issue descriptions
shell: pwsh
@ -33,13 +34,15 @@ jobs:
ISSUE_BODY: ${{ github.event.issue.body }}
add-labels-on-pull-requests:
permissions:
pull-requests: write
if: github.event_name == 'pull_request_target'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: check out code
uses: actions/checkout@v4
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
ref: ${{ github.event.repository.default_branch }} # Note: Do not run on the PR branch we want to execute add-labels.psm1 from main on the base repo only because pull_request_target can see secrets

View File

@ -15,10 +15,13 @@ on:
OPENTELEMETRYBOT_GITHUB_TOKEN:
required: false
permissions:
contents: read
jobs:
resolve-automation:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
outputs:
enabled: ${{ steps.evaluate.outputs.enabled }}

View File

@ -9,6 +9,9 @@ on:
pull_request:
branches: [ 'main*' ]
permissions:
contents: read
jobs:
lint-misspell-sanitycheck:
uses: ./.github/workflows/sanitycheck.yml
@ -18,13 +21,13 @@ jobs:
outputs:
changes: ${{ steps.changes.outputs.changes }}
steps:
- uses: actions/checkout@v4
- uses: AurorNZ/paths-filter@v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: AurorNZ/paths-filter@3b1f3abc3371cca888d8eb03dfa70bc8a9867629 # v4.0.0
id: changes
with:
filters: |
md: ['**.md']
build: ['build/**', '.github/**/*.yml', '**/*.targets', '**/*.props']
build: ['build/**', '.github/**/*.yml', '**/*.targets', '**/*.props', 'global.json']
shared: ['src/Shared/**']
code: ['**.cs', '**.csproj', '.editorconfig']
solution: ['OpenTelemetry.sln']
@ -107,13 +110,13 @@ jobs:
|| contains(needs.detect-changes.outputs.changes, 'otlp')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
version: [ net6.0, net7.0, net8.0 ]
version: [ net8.0, net9.0 ]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Run OTLP Exporter docker compose
run: docker compose --file=test/OpenTelemetry.Exporter.OpenTelemetryProtocol.Tests/IntegrationTest/docker-compose.yml --file=build/docker-compose.${{ matrix.version }}.yml --project-directory=. up --exit-code-from=tests --build
@ -125,13 +128,13 @@ jobs:
|| contains(needs.detect-changes.outputs.changes, 'instrumentation')
|| contains(needs.detect-changes.outputs.changes, 'build')
|| contains(needs.detect-changes.outputs.changes, 'shared')
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
version: [ net6.0, net7.0 ]
version: [ net8.0, net9.0 ]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Run W3C Trace Context docker compose
run: docker compose --file=test/OpenTelemetry.Instrumentation.W3cTraceContext.Tests/docker-compose.yml --file=build/docker-compose.${{ matrix.version }}.yml --project-directory=. up --exit-code-from=tests --build
@ -171,8 +174,8 @@ jobs:
build-test:
needs: [
lint-misspell-sanitycheck,
detect-changes,
lint-misspell-sanitycheck,
lint-md,
lint-dotnet-format,
build-test-solution,
@ -186,7 +189,8 @@ jobs:
verify-aot-compat,
concurrency-tests
]
if: always() && !cancelled() && !contains(needs.*.result, 'failure')
runs-on: windows-latest
if: always() && !cancelled()
runs-on: ubuntu-22.04
steps:
- run: echo 'build complete'
- run: |
if ( ${{ contains(needs.*.result, 'failure') }} == true ); then echo 'build failed'; exit 1; else echo 'build complete'; fi

View File

@ -1,46 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "CodeQL"
on:
push:
branches: [ 'main' ]
pull_request:
branches: [ 'main' ]
schedule:
- cron: '0 0 * * *' # once in a day at 00:00
workflow_dispatch:
permissions: {}
jobs:
analyze:
name: Analyze
permissions:
actions: read # for github/codeql-action/init to get workflow details
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/analyze to upload SARIF results
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
language: ['csharp']
language: ['actions', 'csharp']
steps:
- name: configure Pagefile
uses: al-cheb/configure-pagefile-action@v1.4
- name: Configure Pagefile
if: matrix.language == 'csharp'
uses: al-cheb/configure-pagefile-action@a3b6ebd6b634da88790d9c58d4b37a7f4a7b8708 # v1.4
with:
minimum-size: 8GB
maximum-size: 32GB
disk-root: "D:"
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
filter: 'tree:0'
persist-credentials: false
show-progress: false
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
uses: github/codeql-action/init@2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d # v3.30.0
with:
build-mode: none
languages: ${{ matrix.language }}
- name: Setup dotnet
uses: actions/setup-dotnet@v4
- name: dotnet pack
run: dotnet pack ./build/OpenTelemetry.proj --configuration Release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
uses: github/codeql-action/analyze@2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d # v3.30.0
with:
category: '/language:${{ matrix.language }}'
codeql:
if: ${{ !cancelled() }}
needs: [ analyze ]
runs-on: ubuntu-latest
steps:
- name: Report status
shell: bash
env:
SCAN_SUCCESS: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
run: |
if [ "${SCAN_SUCCESS}" == "true" ]
then
echo 'CodeQL analysis successful'
else
echo 'CodeQL analysis failed'
exit 1
fi

View File

@ -5,22 +5,25 @@ name: Concurrency Tests
on:
workflow_call:
permissions:
contents: read
jobs:
run-concurrency-tests:
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
os: [ windows-latest, ubuntu-latest ]
os: [ windows-latest, ubuntu-22.04 ]
version: [ net8.0 ]
project: [ OpenTelemetry.Tests, OpenTelemetry.Api.Tests ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup dotnet
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
- name: Run Coyote Tests
shell: pwsh
@ -28,7 +31,7 @@ jobs:
- name: Publish Artifacts
if: always() && !cancelled()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ matrix.os }}-${{ matrix.project }}-${{ matrix.version }}-coyoteoutput
path: '**/*_CoyoteOutput.*'

View File

@ -5,13 +5,19 @@ name: Build docfx
on:
workflow_call:
permissions:
contents: read
jobs:
run-docfx-build:
runs-on: windows-latest
steps:
- name: check out code
uses: actions/checkout@v4
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup dotnet
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
- name: install docfx
run: dotnet tool install -g docfx

View File

@ -5,16 +5,19 @@ name: Lint - dotnet format
on:
workflow_call:
permissions:
contents: read
jobs:
run-dotnet-format-stable:
runs-on: windows-latest
steps:
- name: check out code
uses: actions/checkout@v4
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup dotnet
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
- name: dotnet restore
run: dotnet restore OpenTelemetry.sln
@ -29,10 +32,10 @@ jobs:
steps:
- name: check out code
uses: actions/checkout@v4
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup dotnet
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
- name: dotnet restore
run: dotnet restore OpenTelemetry.sln

20
.github/workflows/fossa.yml vendored Normal file
View File

@ -0,0 +1,20 @@
name: FOSSA scanning
on:
push:
branches:
- main
permissions:
contents: read
jobs:
fossa:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- uses: fossas/fossa-action@3ebcea1862c6ffbd5cf1b4d0bd6b3fe7bd6f2cac # v1.7.0
with:
api-key: ${{secrets.FOSSA_API_KEY}}
team: OpenTelemetry

View File

@ -5,16 +5,19 @@ name: Lint - Markdown
on:
workflow_call:
permissions:
contents: read
jobs:
run-markdownlint:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: check out code
uses: actions/checkout@v4
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: run markdownlint
uses: DavidAnson/markdownlint-cli2-action@v16.0.0
uses: DavidAnson/markdownlint-cli2-action@992badcdf24e3b8eb7e87ff9287fe931bcb00c6e # v20.0.0
with:
globs: |
**/*.md

47
.github/workflows/ossf-scorecard.yml vendored Normal file
View File

@ -0,0 +1,47 @@
name: OSSF Scorecard
on:
push:
branches:
- main
schedule:
- cron: "24 5 * * 0" # once a week
workflow_dispatch:
permissions: read-all
jobs:
analysis:
runs-on: ubuntu-latest
permissions:
# Needed for Code scanning upload
security-events: write
# Needed for GitHub OIDC token if publish_results is true
id-token: write
steps:
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
- uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
with:
results_file: results.sarif
results_format: sarif
publish_results: true
# Upload the results as artifacts (optional). Commenting out will disable
# uploads of run results in SARIF format to the repository Actions tab.
# https://docs.github.com/en/actions/advanced-guides/storing-workflow-data-as-artifacts
- name: "Upload artifact"
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: SARIF file
path: results.sarif
retention-days: 5
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@2d92b76c45b91eb80fc44c74ce3fce0ee94e8f9d # v3.30.0
with:
sarif_file: results.sarif

View File

@ -5,12 +5,15 @@ name: Package Validation
on:
workflow_call:
permissions:
contents: read
jobs:
run-package-validation-stable:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
# Note: By default GitHub only fetches 1 commit. MinVer needs to find
# the version tag which is typically NOT on the first commit so we
@ -18,16 +21,23 @@ jobs:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
- name: dotnet pack
run: dotnet pack ./build/OpenTelemetry.proj --configuration Release /p:EnablePackageValidation=true /p:ExposeExperimentalFeatures=false /p:RunningDotNetPack=true
- name: Publish stable NuGet packages to Artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: packages-stable
path: ./artifacts/package/release
if-no-files-found: error
run-package-validation-experimental:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
# Note: By default GitHub only fetches 1 commit. MinVer needs to find
# the version tag which is typically NOT on the first commit so we
@ -35,7 +45,14 @@ jobs:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
- name: dotnet pack
run: dotnet pack ./build/OpenTelemetry.proj --configuration Release /p:EnablePackageValidation=true /p:ExposeExperimentalFeatures=true /p:RunningDotNetPack=true
- name: Publish experimental NuGet packages to Artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: packages-experimental
path: ./artifacts/package/release
if-no-files-found: error

View File

@ -16,13 +16,16 @@ on:
types:
- created
permissions:
contents: read
jobs:
automation:
uses: ./.github/workflows/automation.yml
secrets: inherit
push-packages-and-publish-release:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: automation
@ -41,7 +44,7 @@ jobs:
steps:
- name: check out code
uses: actions/checkout@v4
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
token: ${{ secrets[needs.automation.outputs.token-secret-name] }}
ref: ${{ github.event.repository.default_branch }}
@ -62,7 +65,7 @@ jobs:
-pushToNuget '${{ secrets.NUGET_TOKEN != '' }}'
post-release-published:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs:
- automation
@ -75,7 +78,7 @@ jobs:
GH_TOKEN: ${{ secrets[needs.automation.outputs.token-secret-name] }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
# Note: By default GitHub only fetches 1 commit. We need all the tags
# for this work.
@ -83,6 +86,9 @@ jobs:
ref: ${{ github.event.repository.default_branch }}
token: ${{ secrets[needs.automation.outputs.token-secret-name] }}
- name: Setup dotnet
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
- name: Create GitHub Pull Request to update stable build version in props
if: |
(github.ref_type == 'tag' && startsWith(github.ref_name, 'core-') && !contains(github.ref_name, '-alpha') && !contains(github.ref_name, '-beta') && !contains(github.ref_name, '-rc'))

View File

@ -23,13 +23,16 @@ on:
types:
- created
permissions:
contents: read
jobs:
automation:
uses: ./.github/workflows/automation.yml
secrets: inherit
prepare-release-pr:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: automation
@ -40,7 +43,7 @@ jobs:
steps:
- name: check out code
uses: actions/checkout@v4
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
token: ${{ secrets[needs.automation.outputs.token-secret-name] }}
@ -53,12 +56,13 @@ jobs:
-gitRepository '${{ github.repository }}' `
-minVerTagPrefix '${{ inputs.tag-prefix }}' `
-version '${{ inputs.version }}' `
-requestedByUserName '${{ github.event.sender.login }}' `
-targetBranch '${{ github.ref_name }}' `
-gitUserName '${{ needs.automation.outputs.username }}' `
-gitUserEmail '${{ needs.automation.outputs.email }}'
lock-pr-and-post-notice-to-create-release-tag:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: automation
@ -75,7 +79,7 @@ jobs:
steps:
- name: check out code
uses: actions/checkout@v4
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
token: ${{ secrets[needs.automation.outputs.token-secret-name] }}
@ -90,7 +94,7 @@ jobs:
-botUserName '${{ needs.automation.outputs.username }}'
create-release-tag-pr-post-notice:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: automation
@ -109,7 +113,7 @@ jobs:
steps:
- name: check out code
uses: actions/checkout@v4
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
# Note: By default GitHub only fetches 1 commit which fails the git tag operation below
fetch-depth: 0
@ -128,3 +132,83 @@ jobs:
-gitUserName '${{ needs.automation.outputs.username }}' `
-gitUserEmail '${{ needs.automation.outputs.email }}'
update-changelog-release-dates-on-prepare-pr-post-notice:
runs-on: ubuntu-22.04
needs: automation
if: |
github.event_name == 'issue_comment'
&& github.event.issue.pull_request
&& github.event.issue.state == 'open'
&& github.event.comment.user.login != needs.automation.outputs.username
&& contains(github.event.comment.body, '/UpdateReleaseDates')
&& startsWith(github.event.issue.title, '[release] Prepare release ')
&& github.event.issue.pull_request.merged_at == null
&& needs.automation.outputs.enabled
env:
GH_TOKEN: ${{ secrets[needs.automation.outputs.token-secret-name] }}
steps:
- name: check out code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
# Note: By default GitHub only fetches 1 commit which fails the git tag operation below
fetch-depth: 0
token: ${{ secrets[needs.automation.outputs.token-secret-name] }}
- name: Update release date
shell: pwsh
run: |
Import-Module .\build\scripts\prepare-release.psm1
UpdateChangelogReleaseDatesAndPostNoticeOnPullRequest `
-gitRepository '${{ github.repository }}' `
-pullRequestNumber '${{ github.event.issue.number }}' `
-botUserName '${{ needs.automation.outputs.username }}' `
-commentUserName '${{ github.event.comment.user.login }}' `
-gitUserName '${{ needs.automation.outputs.username }}' `
-gitUserEmail '${{ needs.automation.outputs.email }}'
update-releasenotes-on-prepare-pr-post-notice:
runs-on: ubuntu-22.04
needs: automation
if: |
github.event_name == 'issue_comment'
&& github.event.issue.pull_request
&& github.event.issue.state == 'open'
&& github.event.comment.user.login != needs.automation.outputs.username
&& contains(github.event.comment.body, '/UpdateReleaseNotes')
&& startsWith(github.event.issue.title, '[release] Prepare release ')
&& github.event.issue.pull_request.merged_at == null
&& needs.automation.outputs.enabled
env:
GH_TOKEN: ${{ secrets[needs.automation.outputs.token-secret-name] }}
steps:
- name: check out code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
# Note: By default GitHub only fetches 1 commit which fails the git tag operation below
fetch-depth: 0
token: ${{ secrets[needs.automation.outputs.token-secret-name] }}
- name: Update release notes
env:
COMMENT_BODY: ${{ github.event.comment.body }}
shell: pwsh
run: |
Import-Module .\build\scripts\prepare-release.psm1
UpdateReleaseNotesAndPostNoticeOnPullRequest `
-gitRepository '${{ github.repository }}' `
-pullRequestNumber '${{ github.event.issue.number }}' `
-botUserName '${{ needs.automation.outputs.username }}' `
-commentUserName '${{ github.event.comment.user.login }}' `
-commentBody $Env:COMMENT_BODY `
-gitUserName '${{ needs.automation.outputs.username }}' `
-gitUserEmail '${{ needs.automation.outputs.email }}'

View File

@ -16,6 +16,9 @@ on:
schedule:
- cron: '0 0 * * *' # once in a day at 00:00
permissions:
contents: read
jobs:
automation:
uses: ./.github/workflows/automation.yml
@ -23,13 +26,19 @@ jobs:
build-pack-publish:
runs-on: windows-latest
permissions:
contents: read
id-token: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COSIGN_YES: "yes"
outputs:
artifact-url: ${{ steps.upload-artifacts.outputs.artifact-url }}
artifact-id: ${{ steps.upload-artifacts.outputs.artifact-id }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
# Note: By default GitHub only fetches 1 commit. MinVer needs to find
# the version tag which is typically NOT on the first commit so we
@ -37,7 +46,12 @@ jobs:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
- name: Install Cosign
uses: sigstore/cosign-installer@d58896d6a1865668819e1d91763c7751a165e159 # v3.9.2
with:
cosign-release: v2.5.3
- name: dotnet restore
run: dotnet restore ./build/OpenTelemetry.proj -p:RunningDotNetPack=true
@ -45,15 +59,32 @@ jobs:
- name: dotnet build
run: dotnet build ./build/OpenTelemetry.proj --configuration Release --no-restore -p:Deterministic=true -p:BuildNumber=${{ github.run_number }} -p:RunningDotNetPack=true
- name: Sign DLLs with Cosign Keyless
shell: pwsh
run: |
$projectFiles = Get-ChildItem -Path src/*/*.csproj -File
foreach ($projectFile in $projectFiles) {
$projectName = [System.IO.Path]::GetFileNameWithoutExtension($projectFile)
Get-ChildItem -Path artifacts/bin/$projectName/release_*/$projectName.dll -File | ForEach-Object {
$fileFullPath = $_.FullName
Write-Host "Signing $fileFullPath"
cosign.exe sign-blob $fileFullPath --yes --output-signature $fileFullPath-keyless.sig --output-certificate $fileFullPath-keyless.pem
}
}
- name: dotnet pack
run: dotnet pack ./build/OpenTelemetry.proj --configuration Release --no-restore --no-build -p:PackTag=${{ github.ref_type == 'tag' && github.ref_name || '' }}
- name: Publish Artifacts
id: upload-artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: ${{ github.ref_name }}-packages
path: 'src/**/*.*nupkg'
path: ./artifacts/package/release
if-no-files-found: error
- name: Publish MyGet
env:
@ -61,10 +92,10 @@ jobs:
if: env.MYGET_TOKEN_EXISTS == 'true' # Skip MyGet publish if run on a fork without the secret
run: |
nuget setApiKey ${{ secrets.MYGET_TOKEN }} -Source https://www.myget.org/F/opentelemetry/api/v2/package
nuget push src/**/*.nupkg -Source https://www.myget.org/F/opentelemetry/api/v2/package
nuget push ./artifacts/package/release/*.nupkg -Source https://www.myget.org/F/opentelemetry/api/v2/package
post-build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs:
- automation
@ -77,7 +108,7 @@ jobs:
steps:
- name: check out code
uses: actions/checkout@v4
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
token: ${{ secrets[needs.automation.outputs.token-secret-name] }}

View File

@ -5,13 +5,16 @@ name: Lint - Spelling & Encoding
on:
workflow_call:
permissions:
contents: read
jobs:
run-misspell:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: check out code
uses: actions/checkout@v4
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: install misspell
run: |
@ -22,11 +25,11 @@ jobs:
run: ./bin/misspell -error .
run-sanitycheck:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: check out code
uses: actions/checkout@v4
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: detect non-ASCII encoding and trailing space
run: python3 ./build/scripts/sanitycheck.py

View File

@ -1,21 +1,32 @@
# Syntax: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
# Github Actions Stale: https://github.com/actions/stale
name: "Close stale pull requests"
name: "Manage stale issues and pull requests"
on:
schedule:
- cron: "12 3 * * *" # arbitrary time not to DDOS GitHub
permissions:
contents: read
jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write # for actions/stale to close stale issues
pull-requests: write # for actions/stale to close stale PRs
runs-on: ubuntu-22.04
steps:
- uses: actions/stale@v9
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
with:
stale-pr-message: 'This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or Pushing will instruct the bot to automatically remove the label. This bot runs once per day.'
stale-issue-message: 'This issue was marked stale due to lack of activity and will be closed in 7 days. Commenting will instruct the bot to automatically remove the label. This bot runs once per day.'
close-issue-message: 'Closed as inactive. Feel free to reopen if this issue is still a concern.'
stale-pr-message: 'This PR was marked stale due to lack of activity and will be closed in 7 days. Commenting or pushing will instruct the bot to automatically remove the label. This bot runs once per day.'
close-pr-message: 'Closed as inactive. Feel free to reopen if this PR is still being worked on.'
operations-per-run: 400
days-before-pr-stale: 7
days-before-issue-stale: -1
days-before-issue-stale: 300
days-before-pr-close: 7
days-before-issue-close: -1
days-before-issue-close: 7
exempt-all-issue-milestones: true
exempt-issue-labels: 'keep-open,needs-triage'
exempt-pr-labels: 'keep-open'

View File

@ -5,21 +5,24 @@ name: Publish & Verify AOT Compatibility
on:
workflow_call:
permissions:
contents: read
jobs:
run-verify-aot-compat:
strategy:
fail-fast: false # ensures the entire test matrix is run, even if one permutation fails
matrix:
os: [ ubuntu-latest, windows-latest ]
version: [ net8.0 ]
os: [ ubuntu-22.04, windows-latest ]
version: [ net8.0, net9.0 ]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
- name: Setup dotnet
uses: actions/setup-dotnet@v4
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
- name: publish AOT testApp, assert static analysis warning count, and run the app
shell: pwsh

4
.gitignore vendored
View File

@ -21,6 +21,7 @@
x64/
x86/
bld/
[Aa]rtifacts/
[Bb]in/
[Oo]bj/
[Ll]og/
@ -351,3 +352,6 @@ tempo-data/
# Coyote Rewrite Files
rewrite.coyote.json
# Test results
TestResults/

View File

@ -10,3 +10,6 @@ MD013:
MD033:
# Allowed elements
allowed_elements: [ 'details', 'summary' ]
# MD059/link-text-should-be-descriptive : Inline HTML : https://github.com/DavidAnson/markdownlint/blob/v0.38.0/doc/md059.md
MD059: false

View File

@ -10,16 +10,39 @@ for a summary description of past meetings. To request edit access, join the
meeting or get in touch on
[Slack](https://cloud-native.slack.com/archives/C01N3BC2W7Q).
Even though, anybody can contribute, there are benefits of being a member of our
community. See to the [community membership
Anyone may contribute but there are benefits of being a member of our community.
See the [community membership
document](https://github.com/open-telemetry/community/blob/main/community-membership.md)
on how to become a
[**Member**](https://github.com/open-telemetry/community/blob/main/community-membership.md#member),
[**Approver**](https://github.com/open-telemetry/community/blob/main/community-membership.md#approver)
[**Member**](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#member),
[**Triager**](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#triager),
[**Approver**](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#approver),
and
[**Maintainer**](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer).
[**Maintainer**](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#maintainer).
## Find a Buddy and Get Started Quickly
## Give feedback
We are always looking for your feedback.
You can do this by [submitting a GitHub issue](https://github.com/open-telemetry/opentelemetry-dotnet/issues/new).
You may also prefer writing on [#otel-dotnet Slack channel](https://cloud-native.slack.com/archives/C01N3BC2W7Q).
### Report a bug
Reporting bugs is an important contribution. Please make sure to include:
* Expected and actual behavior;
* OpenTelemetry, OS, and .NET versions you are using;
* Steps to reproduce;
* [Minimal, reproducible example](https://stackoverflow.com/help/minimal-reproducible-example).
### Request a feature
If you would like to work on something that is not listed as an issue
(e.g. a new feature or enhancement) please create an issue and describe your proposal.
## Find a buddy and get started quickly
If you are looking for someone to help you find a starting point and be a
resource for your first contribution, join our Slack channel and find a buddy!
@ -34,17 +57,24 @@ resource for your first contribution, join our Slack channel and find a buddy!
Your OpenTelemetry buddy is your resource to talk to directly on all aspects of
contributing to OpenTelemetry: providing context, reviewing PRs, and helping
those get merged. Buddies will not be available 24/7, but is committed to
responding during their normal contribution hours.
those get merged. Buddies will not be available 24/7, but are committed to
responding during their normal working hours.
## Development Environment
You can contribute to this project from a Windows, macOS or Linux machine.
You can contribute to this project from a Windows, macOS, or Linux machine.
On all platforms, the minimum requirements are:
* Git client and command line tools.
* .NET 8.0
* Git client and command line tools
* [.NET SDK (latest stable version)](https://dotnet.microsoft.com/download)
> [!NOTE]
> At times a pre-release version of the .NET SDK may be required to build code
in this repository. Check
[global.json](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/global.json)
to verify the current required version.
### Linux or MacOS
@ -59,42 +89,97 @@ of Windows.
* Visual Studio 2022+ or Visual Studio Code
* .NET Framework 4.6.2+
### Public API
## Public API validation
It is critical to keep public API surface small and clean. This repository is
using `Microsoft.CodeAnalysis.PublicApiAnalyzers` to validate the public APIs.
This analyzer will check if you changed a public property/method so the change
will be easily spotted in pull request. It will also ensure that OpenTelemetry
doesn't expose APIs outside of the library primary concerns like a generic
helper methods.
It is critical to **NOT** make breaking changes to public APIs which have been
released in stable builds. We also strive to keep a minimal public API surface.
This repository is using
[Microsoft.CodeAnalysis.PublicApiAnalyzers](https://github.com/dotnet/roslyn-analyzers/blob/main/src/PublicApiAnalyzers/PublicApiAnalyzers.Help.md)
and [Package
validation](https://learn.microsoft.com/dotnet/fundamentals/apicompat/package-validation/overview)
to validate public APIs.
#### How to enable and configure
* `Microsoft.CodeAnalysis.PublicApiAnalyzers` will validate public API
changes/additions against a set of "public API files" which capture the
shipped/unshipped public APIs. These files must be maintained manually (not
recommended) or by using tooling/code fixes built into the package (see below
for details).
* Create a folder in your project called `.publicApi` with the frameworks that
as folders you target.
* Create two files called `PublicAPI.Shipped.txt` and `PublicAPI.Unshipped.txt`
in each framework that you target.
* Add the following lines to your csproj:
Public API files are also used to perform public API reviews by repo
approvers/maintainers before releasing stable builds.
```xml
<ItemGroup>
<AdditionalFiles Include=".publicApi\$(TargetFramework)\PublicAPI.Shipped.txt" />
<AdditionalFiles Include=".publicApi\$(TargetFramework)\PublicAPI.Unshipped.txt" />
</ItemGroup>
```
* `Package validation` will validate public API changes/additions against
previously released NuGet packages.
* Use
[IntelliSense](https://docs.microsoft.com/visualstudio/ide/using-intellisense)
to update the publicApi files.
This is performed automatically by the build/CI
[package-validation](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/.github/workflows/package-validation.yml)
workflow.
By default package validation is **NOT** run for local builds. To enable
package validation in local builds set the `EnablePackageValidation` property
to `true` in
[Common.prod.props](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/build/Common.prod.props)
(please do not check in this change).
### Working with Microsoft.CodeAnalysis.PublicApiAnalyzers
#### Update public API files when writing code
[IntelliSense](https://docs.microsoft.com/visualstudio/ide/using-intellisense)
will [suggest
modifications](https://github.com/dotnet/roslyn-analyzers/issues/3322#issuecomment-591031429)
to the `PublicAPI.Unshipped.txt` file when you make changes. After reviewing
these changes, ensure they are reflected across all targeted frameworks. You can
do this by:
* Using the "Fix all occurrences in Project" feature in Visual Studio.
* Manually cycling through each framework using Visual Studio's target framework
dropdown (in the upper right corner) and applying the IntelliSense
suggestions.
> [!IMPORTANT]
> Do **NOT** modify `PublicAPI.Shipped.txt` files. New features and bug fixes
**SHOULD** only require changes to `PublicAPI.Unshipped.txt` files. If you
have to modify a "shipped" file it likely means you made a mistake and broke a
stable API. Typically only maintainers modify the `PublicAPI.Shipped.txt` file
while performing stable releases. If you need help reach out to an approver or
maintainer on Slack or open a draft PR.
#### Enable public API validation in new projects
1. If you are **NOT** using experimental APIs:
* If your API is the same across all target frameworks:
* You only need two files: `.publicApi/PublicAPI.Shipped.txt` and
`.publicApi/PublicAPI.Unshipped.txt`.
* If your APIs differ between target frameworks:
* Place the shared APIs in `.publicApi/PublicAPI.Shipped.txt` and
`.publicApi/PublicAPI.Unshipped.txt`.
* Create framework-specific files for API differences (e.g.,
`.publicApi/net462/PublicAPI.Shipped.txt` and
`.publicApi/net462/PublicAPI.Unshipped.txt`).
2. If you are using experimental APIs:
* Follow the rules above, but create an additional layer in your folder
structure:
* For stable APIs: `.publicApi/Stable/*`.
* For experimental APIs: `.publicApi/Experimental/*`.
* The `Experimental` folder should contain APIs that are public only in
pre-release builds. Typically the `Experimental` folder only contains
`PublicAPI.Unshipped.txt` files as experimental APIs are never shipped
stable.
Example folder structure can be found
[here](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/src/OpenTelemetry.Api/.publicApi).
## Pull Requests
### How to Send Pull Requests
### How to create pull requests
Everyone is welcome to contribute code to `opentelemetry-dotnet` via GitHub pull
requests (PRs).
To create a new PR, fork the project in GitHub and clone the upstream repo:
To create a new PR, fork the project on GitHub and clone the upstream repo:
```sh
git clone https://github.com/open-telemetry/opentelemetry-dotnet.git
@ -125,7 +210,7 @@ If you made changes to the Markdown documents (`*.md` files), install the latest
markdownlint .
```
Check out a new branch, make modifications and push the branch to your fork:
Check out a new branch, make modifications, and push the branch to your fork:
```sh
$ git checkout -b feature
@ -136,20 +221,26 @@ $ git push fork feature
Open a pull request against the main `opentelemetry-dotnet` repo.
### How to Receive Comments
#### Tips and best practices for pull requests
* If the PR is not ready for review, please mark it as
[`draft`](https://github.blog/2019-02-14-introducing-draft-pull-requests/).
* Make sure CLA is signed and all required CI checks are clear.
* Submit small, focused PRs addressing a single
concern/issue.
* Submit small, focused PRs addressing a single concern/issue.
* Make sure the PR title reflects the contribution.
* Write a summary that helps understand the change.
* Include usage examples in the summary, where applicable.
* Include benchmarks (before/after) in the summary, for contributions that are
performance enhancements.
* We are open to bot generated PRs or AI/LLM assisted PRs. Actually, we are
using
[dependabot](https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates)
to automate the security updates. However, if you use bots to generate spam
PRs (e.g. incorrect, noisy, non-improvements, unintelligible, trying to sell
your product, etc.), we might close the PR right away with a warning, and if
you keep doing so, we might block your user account.
### How to Get PRs Merged
### How to get pull requests merged
A PR is considered to be **ready to merge** when:
@ -157,18 +248,21 @@ A PR is considered to be **ready to merge** when:
[Approvers](https://github.com/open-telemetry/community/blob/main/community-membership.md#approver).
/
[Maintainers](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer).
* Major feedbacks are resolved.
* Major feedback/comments are resolved.
* It has been open for review for at least one working day. This gives people
reasonable time to review.
* Trivial change (typo, cosmetic, doc, etc.) doesn't have to wait for one day.
* Urgent fix can take exception as long as it has been actively communicated.
* Trivial change (typo, cosmetic, doc, etc.) doesn't have to wait for one day.
* Urgent fix can take exception as long as it has been actively communicated.
Any Maintainer can merge the PR once it is **ready to merge**. Note, that some
PRs may not be merged immediately if the repo is in the process of a release and
the maintainers decided to defer the PR to the next release train.
Any maintainer can merge PRs once they are **ready to merge** however
maintainers might decide to wait on merging changes until there are more
approvals and/or dicussion, or based on other factors such as release timing and
risk to users. For example if a stable release is planned and a new change is
introduced adding public API(s) or behavioral changes it might be held until the
next alpha/beta release.
If a PR has been stuck (e.g. there are lots of debates and people couldn't agree
on each other), the owner should try to get people aligned by:
If a PR has become stuck (e.g. there is a lot of debate and people couldn't
agree on the direction), the owner should try to get people aligned by:
* Consolidating the perspectives and putting a summary in the PR. It is
recommended to add a link into the PR description, which points to a comment
@ -183,7 +277,7 @@ on each other), the owner should try to get people aligned by:
the owner should bring it to the OpenTelemetry .NET SIG
[meeting](README.md#contributing).
## Design Choices
## Design choices
As with other OpenTelemetry clients, opentelemetry-dotnet follows the
[opentelemetry-specification](https://github.com/open-telemetry/opentelemetry-specification).
@ -191,7 +285,7 @@ As with other OpenTelemetry clients, opentelemetry-dotnet follows the
It's especially valuable to read through the [library
guidelines](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/library-guidelines.md).
### Focus on Capabilities, Not Structure Compliance
### Focus on capabilities not structural compliance
OpenTelemetry is an evolving specification, one where the desires and use cases
are clear, but the method to satisfy those uses cases are not.
@ -205,10 +299,10 @@ than conform to specific API names or argument patterns in the spec.
For a deeper discussion, see [this spec
issue](https://github.com/open-telemetry/opentelemetry-specification/issues/165).
## Style Guide
## Style guide
This project includes a [`.editorconfig`](./.editorconfig) file which is
supported by all the IDEs/editor mentioned above. It works with the IDE/editor
supported by all the IDEs/editors mentioned above. It works with the IDE/editor
only and does not affect the actual build of the project.
This repository also includes StyleCop ruleset files under the `./build` folder.
@ -229,31 +323,11 @@ types](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-type
* Pass [static
analysis](https://learn.microsoft.com/dotnet/fundamentals/code-analysis/overview).
New projects MUST enable static analysis by specifying
`<AnalysisLevel>latest-all</AnalysisLevel>` in the project file (`.csproj`).
> [!NOTE]
> There are other project-level features enabled automatically via
[Common.props](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/build/Common.props)
new projects must NOT manually override these settings.
## New code
New code files MUST enable [nullable reference
types](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/nullable-reference-types)
manually in projects where it is not automatically enabled project-wide. This is
done by specifying `#nullable enable` towards the top of the file (usually after
the copyright header). We are currently working towards enabling nullable
context in every project by updating code as it is worked on, this requirement
is to make sure the surface area of code needing updates is shrinking and not
expanding.
> [!NOTE]
> The first time a project is updated to use nullable context in public APIs
some housekeeping needs to be done in public API definitions (`.publicApi`
folder). This can be done automatically via a code fix offered by the public API
analyzer.
## License requirements
OpenTelemetry .NET is licensed under the [Apache License, Version

6
Directory.Build.props Normal file
View File

@ -0,0 +1,6 @@
<Project>
<PropertyGroup>
<ArtifactsPath>$([System.IO.Path]::Combine('$(MSBuildThisFileDirectory)', 'artifacts'))</ArtifactsPath>
<UseArtifactsOutput>true</UseArtifactsOutput>
</PropertyGroup>
</Project>

View File

@ -1,7 +1,19 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<OTelLatestStableVer>1.8.1</OTelLatestStableVer>
<OTelLatestStableVer>1.12.0</OTelLatestStableVer>
<!--
This is typically the latest annual release of .NET. Use this wherever
possible and only deviate (use a specific version) when a package has a
more specific patch which must be reference directly.
-->
<LatestRuntimeOutOfBandVer>9.0.0</LatestRuntimeOutOfBandVer>
<!-- Mitigate https://msrc.microsoft.com/update-guide/vulnerability/CVE-2024-43485. -->
<SystemTextEncodingsWebOutOfBandMinimumCoreAppVer>8.0.0</SystemTextEncodingsWebOutOfBandMinimumCoreAppVer>
<SystemTextJsonOutOfBandMinimumCoreAppVer>8.0.5</SystemTextJsonOutOfBandMinimumCoreAppVer>
</PropertyGroup>
<!--
@ -10,12 +22,6 @@
vulnerability in the NuGet packages that are published from this repository.
-->
<ItemGroup>
<PackageVersion Include="Google.Protobuf" Version="[3.22.5,4.0)" />
<PackageVersion Include="Grpc" Version="[2.44.0,3.0)" />
<PackageVersion Include="Grpc.Net.Client" Version="[2.52.0,3.0)" />
<PackageVersion Include="Microsoft.AspNetCore.Http.Abstractions" Version="[2.1.1,6.0)" />
<PackageVersion Include="Microsoft.AspNetCore.Http.Features" Version="[2.1.1,6.0)" />
<!--
Typically, for the Microsoft.Extensions.* packages relating to DI Abstractions, Hosting Abstractions, and Logging,
the latest stable version should be used because:
@ -25,85 +31,98 @@
3) Since version 3.1.0, the .NET runtime team is holding a high bar for backward compatibility on
these packages even during major version bumps, so compatibility is not a concern here.
-->
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="$(LatestRuntimeOutOfBandVer)" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.Abstractions" Version="$(LatestRuntimeOutOfBandVer)" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="$(LatestRuntimeOutOfBandVer)" />
<PackageVersion Include="Microsoft.Extensions.Logging.Configuration" Version="$(LatestRuntimeOutOfBandVer)" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Binder" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Options" Version="8.0.0" />
<PackageVersion Include="OpenTelemetry" Version="$(OTelLatestStableVer)" />
<PackageVersion Include="OpenTelemetry.Api" Version="$(OTelLatestStableVer)" />
<PackageVersion Include="OpenTelemetry.Api.ProviderBuilderExtensions" Version="$(OTelLatestStableVer)" />
<PackageVersion Include="OpenTelemetry.Exporter.InMemory" Version="$(OTelLatestStableVer)" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="$(OTelLatestStableVer)" />
<PackageVersion Include="OpenTelemetry.Extensions.Propagators" Version="$(OTelLatestStableVer)" />
<!--
OTel packages always point to latest stable release.
-->
<PackageVersion Include="OpenTelemetry" Version="[$(OTelLatestStableVer),2.0)" />
<PackageVersion Include="OpenTelemetry.Api" Version="[$(OTelLatestStableVer),2.0)" />
<PackageVersion Include="OpenTelemetry.Api.ProviderBuilderExtensions" Version="[$(OTelLatestStableVer),2.0)" />
<PackageVersion Include="OpenTelemetry.Exporter.InMemory" Version="[$(OTelLatestStableVer),2.0)" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="[$(OTelLatestStableVer),2.0)" />
<PackageVersion Include="OpenTelemetry.Extensions.Propagators" Version="[$(OTelLatestStableVer),2.0)" />
<PackageVersion Include="OpenTracing" Version="[0.12.1,0.13)" />
<!--
Typically, the latest stable version of System.Diagnostics.DiagnosticSource should be used here because:
1) Each major version bump will have some new OpenTelemetry API capabilities (e.g. .NET 6 introduced Meter
API, .NET 7 added UpDownCounter, .NET 8 is adding Meter/Instrument level attributes support, .NET 9 might
add Advice/Hint API) that the OpenTelemetry components rely on.
1) Each major version bump will likely have some new OpenTelemetry capabilities (e.g. .NET 6 introduced Meter
API, .NET 7 added UpDownCounter, .NET 8 added Meter/Instrument level attributes support, .NET 9 added
Advice/Hint API, etc.).
2) Each minor version bump is normally security hotfixes or critical bug fixes.
3) The .NET runtime team provides extra backward compatibility guarantee to System.Diagnostics.DiagnosticSource
even during major version bumps, so compatibility is not a concern here.
-->
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="8.0.0" />
<PackageVersion Include="System.Diagnostics.DiagnosticSource" Version="$(LatestRuntimeOutOfBandVer)" />
</ItemGroup>
<!-- A conservative version of System.Text.Encodings.Web must be used here since there is no backward compatibility guarantee during major version bumps. -->
<ItemGroup>
<!--
Note: See TargetFrameworksRequiringSystemTextJsonDirectReference for the
list of targets where System.Text.Json direct reference is applied.
-->
<!--
We use conservative versions of these packages for older runtimes where
an upgrade might introduce breaking changes. For example see:
https://devblogs.microsoft.com/dotnet/system-text-json-in-dotnet-7/#breaking-changes.
-->
<PackageVersion Include="System.Text.Encodings.Web" Version="4.7.2" />
<!-- A conservative version of System.Text.Json must be used here since there is no backward compatibility guarantee during major version bumps. -->
<PackageVersion Include="System.Text.Json" Version="4.7.2" />
<!-- A conservative version of System.Threading.Tasks.Extensions must be used here since there is no backward compatibility guarantee during major version bumps. -->
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.5.4" />
<!-- Newer NETCoreApp runtimes need to be redirected to safe versions. -->
<PackageVersion Update="System.Text.Encodings.Web" Version="$(SystemTextEncodingsWebOutOfBandMinimumCoreAppVer)" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" />
<PackageVersion Update="System.Text.Json" Version="$(SystemTextJsonOutOfBandMinimumCoreAppVer)" Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" />
</ItemGroup>
<!--
This section covers packages that are **not** directly referenced by the NuGet packages published from this repository.
For example, these packages are used in the tests, examples or referenced as "PrivateAssets", but not in the NuGet packages themselves.
These packages are referenced as "PrivateAssets" or used in tests/examples.
-->
<!-- 'net8.0' is the default `TargetFramework`. Use `VersionOverride` in the project to override the package versions from a different `TargetFramework` -->
<ItemGroup>
<PackageVersion Include="BenchmarkDotNet" Version="[0.13.12,0.14)" />
<PackageVersion Include="BenchmarkDotNet" Version="0.15.2" />
<PackageVersion Include="CommandLineParser" Version="[2.9.1,3.0)" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageVersion Include="Grpc.AspNetCore" Version="[2.59.0,3.0)" />
<PackageVersion Include="Grpc.AspNetCore.Server" Version="[2.59.0, 3.0)" />
<PackageVersion Include="Grpc.Tools" Version="[2.59.0,3.0)" />
<PackageVersion Include="Google.Protobuf" Version="[3.22.5,4.0)" />
<PackageVersion Include="Grpc" Version="[2.44.0,3.0)" />
<PackageVersion Include="Grpc.Net.Client" Version="[2.52.0,3.0)" />
<PackageVersion Include="JunitXml.TestLogger" Version="6.1.0" />
<PackageVersion Include="Microsoft.CSharp" Version="[4.7.0]" />
<PackageVersion Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" Version="[3.11.0-beta1.23525.2]" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="[8.0.0,)" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="[8.0.0,)" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="[8.0.0,)" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="[8.0.0,)" />
<PackageVersion Include="Microsoft.Extensions.Telemetry.Abstractions" Version="[8.6.0,)" />
<PackageVersion Include="Microsoft.Coyote" Version="1.7.11" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="$(LatestRuntimeOutOfBandVer)" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="$(LatestRuntimeOutOfBandVer)" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="$(LatestRuntimeOutOfBandVer)" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="$(LatestRuntimeOutOfBandVer)" />
<PackageVersion Include="Microsoft.Extensions.Telemetry.Abstractions" Version="[9.0.0,)" />
<PackageVersion Include="Microsoft.NETFramework.ReferenceAssemblies" Version="[1.0.3,2.0)" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="[17.10.0,18.0.0)" />
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="[1.1.1,2.0)" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="[17.13.0,18.0.0)" />
<PackageVersion Include="MinVer" Version="[5.0.0,6.0)" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="[1.8.1,2.0)" />
<PackageVersion Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="[1.8.0-beta.1,2.0)" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="[1.8.1,2.0)" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="[1.8.1,2.0)" />
<PackageVersion Include="NuGet.Versioning" Version="6.11.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="[1.9.0,2.0)" />
<PackageVersion Include="OpenTelemetry.Instrumentation.GrpcNetClient" Version="[1.9.0-beta.1,2.0)" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="[1.9.0,2.0)" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="[1.9.0,2.0)" />
<PackageVersion Include="RabbitMQ.Client" Version="[6.8.1,7.0)" />
<PackageVersion Include="StyleCop.Analyzers" Version="[1.2.0-beta.556,2.0)" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="[6.6.2,)" />
<PackageVersion Include="xunit" Version="[2.8.1,3.0)" />
<PackageVersion Include="xunit.runner.visualstudio" Version="[2.8.1,3.0)" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="[6.7.3,)" />
<PackageVersion Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
<PackageVersion Include="xunit" Version="[2.9.3,3.0)" />
<PackageVersion Include="xunit.runner.visualstudio" Version="[2.8.2,3.0)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="6.0.31" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="7.0.20" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="8.0.6" />
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="8.0.8" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
<PackageVersion Include="Microsoft.AspNetCore.TestHost" Version="9.0.0" />
</ItemGroup>
</Project>

View File

@ -3,19 +3,14 @@
<packageSources>
<clear />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
<add key="dotnet8" value="https://dnceng.pkgs.visualstudio.com/public/_packaging/dotnet8/nuget/v3/index.json" />
</packageSources>
<!-- Define mappings by adding package patterns beneath the target source. -->
<!-- *.Tools packages will be restored from ".Net Core Tools", everything else from nuget.org. -->
<packageSourceMapping>
<!-- key value for <packageSource> should match key values from <packageSources> element -->
<packageSource key="NuGet">
<package pattern="*" />
</packageSource>
<packageSource key="dotnet8">
<package pattern="Microsoft.CodeAnalysis.PublicApiAnalyzers" />
</packageSource>
</packageSourceMapping>
<disabledPackageSources />

View File

@ -12,12 +12,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.dockerignore = .dockerignore
.editorconfig = .editorconfig
.gitignore = .gitignore
.github\workflows\ci-concurrency.yml = .github\workflows\ci-concurrency.yml
CONTRIBUTING.md = CONTRIBUTING.md
global.json = global.json
LICENSE.TXT = LICENSE.TXT
NuGet.config = NuGet.config
README.md = README.md
RELEASENOTES.md = RELEASENOTES.md
THIRD-PARTY-NOTICES.TXT = THIRD-PARTY-NOTICES.TXT
VERSIONING.md = VERSIONING.md
EndProjectSection
@ -27,12 +27,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7CB2F02E
build\Common.nonprod.props = build\Common.nonprod.props
build\Common.prod.props = build\Common.prod.props
build\Common.props = build\Common.props
build\Common.targets = build\Common.targets
build\debug.snk = build\debug.snk
Directory.Packages.props = Directory.Packages.props
build\docfx.cmd = build\docfx.cmd
build\docker-compose.net6.0.yml = build\docker-compose.net6.0.yml
build\docker-compose.net7.0.yml = build\docker-compose.net7.0.yml
build\docker-compose.net8.0.yml = build\docker-compose.net8.0.yml
build\docker-compose.net9.0.yml = build\docker-compose.net9.0.yml
build\GlobalAttrExclusions.txt = build\GlobalAttrExclusions.txt
build\opentelemetry-icon-color.png = build\opentelemetry-icon-color.png
build\OpenTelemetry.prod.loose.ruleset = build\OpenTelemetry.prod.loose.ruleset
@ -73,6 +73,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{F1D0
ProjectSection(SolutionItems) = preProject
.github\codecov.yml = .github\codecov.yml
.github\CODEOWNERS = .github\CODEOWNERS
.github\dependabot.yml = .github\dependabot.yml
.github\PULL_REQUEST_TEMPLATE.md = .github\PULL_REQUEST_TEMPLATE.md
EndProjectSection
EndProject
@ -80,7 +81,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ISSUE_TEMPLATE", "ISSUE_TEM
ProjectSection(SolutionItems) = preProject
.github\ISSUE_TEMPLATE\bug_report.yml = .github\ISSUE_TEMPLATE\bug_report.yml
.github\ISSUE_TEMPLATE\feature_request.yml = .github\ISSUE_TEMPLATE\feature_request.yml
.github\ISSUE_TEMPLATE\question.yml = .github\ISSUE_TEMPLATE\question.yml
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{E69578EB-B456-4062-A645-877CD964528B}"
@ -113,7 +113,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{D2E73927-5
ProjectSection(SolutionItems) = preProject
test\Directory.Build.props = test\Directory.Build.props
test\Directory.Build.targets = test\Directory.Build.targets
test\Directory.Packages.props = test\Directory.Packages.props
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples.Console", "examples\Console\Examples.Console.csproj", "{FF3E6E08-E8E4-4523-B526-847CD989279F}"
@ -123,14 +122,20 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmarks", "test\Benchmarks\Benchmarks.csproj", "{DE9130A4-F30A-49D7-8834-41DE3021218B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{7C87CAF9-79D7-4C26-9FFB-F3F1FB6911F1}"
ProjectSection(SolutionItems) = preProject
docs\README.md = docs\README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "examples", "examples", "{2C7DD1DA-C229-4D9E-9AF0-BCD5CD3E4948}"
ProjectSection(SolutionItems) = preProject
examples\Directory.Build.props = examples\Directory.Build.props
examples\Directory.Packages.props = examples\Directory.Packages.props
examples\Directory.Build.targets = examples\Directory.Build.targets
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "trace", "trace", "{5B7FB835-3FFF-4BC2-99C5-A5B5FAE3C818}"
ProjectSection(SolutionItems) = preProject
docs\trace\README.md = docs\trace\README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "metrics", "metrics", "{3277B1C0-BDFE-4460-9B0D-D9A661FB48DB}"
ProjectSection(SolutionItems) = preProject
@ -249,7 +254,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{A49299
src\Shared\ExceptionExtensions.cs = src\Shared\ExceptionExtensions.cs
src\Shared\Guard.cs = src\Shared\Guard.cs
src\Shared\MathHelper.cs = src\Shared\MathHelper.cs
src\Shared\PeerServiceResolver.cs = src\Shared\PeerServiceResolver.cs
src\Shared\PeriodicExportingMetricReaderHelper.cs = src\Shared\PeriodicExportingMetricReaderHelper.cs
src\Shared\PooledList.cs = src\Shared\PooledList.cs
src\Shared\ResourceSemanticConventions.cs = src\Shared\ResourceSemanticConventions.cs
@ -276,6 +280,7 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shims", "Shims", "{A0CB9A10-F22D-4E66-A449-74B3D0361A9C}"
ProjectSection(SolutionItems) = preProject
src\Shared\Shims\IsExternalInit.cs = src\Shared\Shims\IsExternalInit.cs
src\Shared\Shims\Lock.cs = src\Shared\Shims\Lock.cs
src\Shared\Shims\NullableAttributes.cs = src\Shared\Shims\NullableAttributes.cs
EndProjectSection
EndProject
@ -299,7 +304,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "experimental-apis", "experi
ProjectSection(SolutionItems) = preProject
docs\diagnostics\experimental-apis\OTEL1000.md = docs\diagnostics\experimental-apis\OTEL1000.md
docs\diagnostics\experimental-apis\OTEL1001.md = docs\diagnostics\experimental-apis\OTEL1001.md
docs\diagnostics\experimental-apis\OTEL1003.md = docs\diagnostics\experimental-apis\OTEL1003.md
docs\diagnostics\experimental-apis\OTEL1004.md = docs\diagnostics\experimental-apis\OTEL1004.md
docs\diagnostics\experimental-apis\README.md = docs\diagnostics\experimental-apis\README.md
EndProjectSection
@ -340,6 +344,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "scripts", "scripts", "{4498
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "exemplars", "docs\metrics\exemplars\exemplars.csproj", "{79C12C80-B27B-41FB-AE79-A3BB74CFA782}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Proto", "Proto", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
ProjectSection(SolutionItems) = preProject
src\Shared\Proto\README.md = src\Shared\Proto\README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -656,6 +665,7 @@ Global
{993E65E5-E71B-40FD-871C-60A9EBD59724} = {A49299FB-C5CD-4E0E-B7E1-B7867BBD67CC}
{44982E0D-C8C6-42DC-9F8F-714981F27CE6} = {7CB2F02E-03FA-4FFF-89A5-C51F107623FD}
{79C12C80-B27B-41FB-AE79-A3BB74CFA782} = {3277B1C0-BDFE-4460-9B0D-D9A661FB48DB}
{02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {A49299FB-C5CD-4E0E-B7E1-B7867BBD67CC}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {55639B5C-0770-4A22-AB56-859604650521}

263
README.md
View File

@ -6,9 +6,32 @@
[![NuGet](https://img.shields.io/nuget/dt/OpenTelemetry.svg)](https://www.nuget.org/profiles/OpenTelemetry)
[![Build](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/ci.yml)
The .NET [OpenTelemetry](https://opentelemetry.io/) client.
[![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/open-telemetry/opentelemetry-dotnet/badge)](https://scorecard.dev/viewer/?uri=github.com/open-telemetry/opentelemetry-dotnet)
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/10017/badge)](https://www.bestpractices.dev/projects/10017)
[![FOSSA License Status](https://app.fossa.com/api/projects/custom%2B162%2Fgithub.com%2Fopen-telemetry%2Fopentelemetry-dotnet.svg?type=shield&issueType=license)](https://app.fossa.com/projects/custom%2B162%2Fgithub.com%2Fopen-telemetry%2Fopentelemetry-dotnet?ref=badge_shield&issueType=license)
[![FOSSA Security Status](https://app.fossa.com/api/projects/custom%2B162%2Fgithub.com%2Fopen-telemetry%2Fopentelemetry-dotnet.svg?type=shield&issueType=security)](https://app.fossa.com/projects/custom%2B162%2Fgithub.com%2Fopen-telemetry%2Fopentelemetry-dotnet?ref=badge_shield&issueType=security)
## Supported .NET Versions
The .NET [OpenTelemetry](https://opentelemetry.io/) implementation.
<details>
<summary>Table of Contents</summary>
* [Supported .NET versions](#supported-net-versions)
* [Project status](#project-status)
* [Getting started](#getting-started)
* [Getting started with Logging](#getting-started-with-logging)
* [Getting started with Metrics](#getting-started-with-metrics)
* [Getting started with Tracing](#getting-started-with-tracing)
* [Repository structure](#repository-structure)
* [Troubleshooting](#troubleshooting)
* [Extensibility](#extensibility)
* [Releases](#releases)
* [Contributing](#contributing)
* [References](#references)
</details>
## Supported .NET versions
Packages shipped from this repository generally support all the officially
supported versions of [.NET](https://dotnet.microsoft.com/download/dotnet) and
@ -17,36 +40,88 @@ older Windows-based .NET implementation), except `.NET Framework 3.5`.
Any exceptions to this are noted in the individual `README.md`
files.
## Project Status
## Project status
**Stable** across all 3 signals i.e. `Logs`, `Metrics`, and `Traces`.
**Stable** across all 3 signals (`Logs`, `Metrics`, and `Traces`).
See [Spec Compliance
Matrix](https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix.md)
to understand which portions of the specification has been implemented in this
repo.
> [!CAUTION]
> Certain components, marked as
[pre-release](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/VERSIONING.md#pre-releases),
are still work in progress and can undergo breaking changes before stable
release. Check the individual `README.md` file for each component to understand its
current state.
## Getting Started
To understand which portions of the [OpenTelemetry
Specification](https://github.com/open-telemetry/opentelemetry-specification)
have been implemented in OpenTelemetry .NET see: [Spec Compliance
Matrix](https://github.com/open-telemetry/opentelemetry-specification/blob/main/spec-compliance-matrix.md).
## Getting started
If you are new here, please read the getting started docs:
* [Logs](./docs/logs/README.md)
* [Metrics](./docs/metrics/README.md)
* [Traces](./docs/trace/README.md)
### Getting started with Logging
This repository includes multiple installable components, available on
[NuGet](https://www.nuget.org/profiles/OpenTelemetry). Each component has its
individual `README.md` file, which covers the instruction on how to install and
how to get started. To find all the available components, please take a look at
the `src` folder.
If you are new to
[logging](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/README.md),
it is recommended to first follow the [getting started in 5 minutes - ASP.NET
Core Application](./docs/logs/getting-started-aspnetcore/README.md) guide or
the [getting started in 5 minutes - Console
Application](./docs/logs/getting-started-console/README.md) guide to get up
and running.
For general information and best practices see: [OpenTelemetry .NET
Logs](./docs/logs/README.md). For a more detailed explanation of SDK logging
features see: [Customizing OpenTelemetry .NET SDK for
Logs](./docs/logs/customizing-the-sdk/README.md).
### Getting started with Metrics
If you are new to
[metrics](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/README.md),
it is recommended to first follow the [getting started in 5 minutes - ASP.NET
Core Application](./docs/metrics/getting-started-aspnetcore/README.md) guide
or the [getting started in 5 minutes - Console
Application](./docs/metrics/getting-started-console/README.md) guide to get
up and running.
For general information and best practices see: [OpenTelemetry .NET
Metrics](./docs/metrics/README.md). For a more detailed explanation of SDK
metric features see: [Customizing OpenTelemetry .NET SDK for
Metrics](./docs/metrics/customizing-the-sdk/README.md).
### Getting started with Tracing
If you are new to
[traces](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/README.md),
it is recommended to first follow the [getting started in 5 minutes - ASP.NET
Core Application](./docs/trace/getting-started-aspnetcore/README.md) guide
or the [getting started in 5 minutes - Console
Application](./docs/trace/getting-started-console/README.md) guide to get up
and running.
For general information and best practices see: [OpenTelemetry .NET
Traces](./docs/trace/README.md). For a more detailed explanation of SDK tracing
features see: [Customizing OpenTelemetry .NET SDK for
Tracing](./docs/trace/customizing-the-sdk/README.md).
## Repository structure
This repository includes only what is defined in the [OpenTelemetry
Specification](https://github.com/open-telemetry/opentelemetry-specification)
and is shipped as separate packages through
[NuGet](https://www.nuget.org/profiles/OpenTelemetry). Each component has an
individual `README.md` and `CHANGELOG.md` file which covers the instructions on
how to install and get started, and details about the individual changes made
(respectively). To find all the available components, please take a look at the
`src` folder.
Here are the most commonly used components:
* [OpenTelemetry .NET API](./src/OpenTelemetry.Api/README.md)
* [OpenTelemetry .NET SDK](./src/OpenTelemetry/README.md)
[Instrumentation libraries](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/glossary.md#instrumentation-library)
can be found in [contrib repository](https://github.com/open-telemetry/opentelemetry-dotnet-contrib).
* [OpenTelemetry API](./src/OpenTelemetry.Api/README.md)
* [OpenTelemetry SDK](./src/OpenTelemetry/README.md)
* [OpenTelemetry Hosting
Extensions](./src/OpenTelemetry.Extensions.Hosting/README.md)
Here are the [exporter
libraries](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/glossary.md#exporter-library):
@ -59,16 +134,19 @@ libraries](https://github.com/open-telemetry/opentelemetry-specification/blob/ma
* [Prometheus HttpListener](./src/OpenTelemetry.Exporter.Prometheus.HttpListener/README.md)
* [Zipkin](./src/OpenTelemetry.Exporter.Zipkin/README.md)
See the [OpenTelemetry
registry](https://opentelemetry.io/ecosystem/registry/?language=dotnet) and
[OpenTelemetry .NET Contrib
repo](https://github.com/open-telemetry/opentelemetry-dotnet-contrib) for more
components.
Additional packages including [instrumentation
libraries](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/glossary.md#instrumentation-library),
exporters, resource detectors, and extensions can be found in the
[opentelemetry-dotnet-contrib
repository](https://github.com/open-telemetry/opentelemetry-dotnet-contrib)
and/or the [OpenTelemetry
registry](https://opentelemetry.io/ecosystem/registry/?language=dotnet).
## Troubleshooting
See [Troubleshooting](./src/OpenTelemetry/README.md#troubleshooting).
Additionally check readme file for the individual components for any additional
For general instructions see:
[Troubleshooting](./src/OpenTelemetry/README.md#troubleshooting). Additionally
`README.md` files for individual components may contain more detailed
troubleshooting information.
## Extensibility
@ -80,7 +158,7 @@ extension scenarios:
library](./docs/trace/extending-the-sdk/README.md#instrumentation-library).
* Building a custom exporter for
[logs](./docs/logs/extending-the-sdk/README.md#exporter),
[metrics](./docs/metrics/extending-the-sdk/README.md#exporter) and
[metrics](./docs/metrics/extending-the-sdk/README.md#exporter), and
[traces](./docs/trace/extending-the-sdk/README.md#exporter).
* Building a custom processor for
[logs](./docs/logs/extending-the-sdk/README.md#processor) and
@ -88,9 +166,59 @@ extension scenarios:
* Building a custom sampler for
[traces](./docs/trace/extending-the-sdk/README.md#sampler).
## Releases
For details about upcoming planned releases see:
[Milestones](https://github.com/open-telemetry/opentelemetry-dotnet/milestones).
The dates and features described in issues and milestones are estimates and
subject to change.
For highlights and annoucements for stable releases see: [Release
Notes](./RELEASENOTES.md).
To access packages, source code, and/or view a list of changes for all
components in a release see:
[Releases](https://github.com/open-telemetry/opentelemetry-dotnet/releases).
Nightly builds from this repo are published to [MyGet](https://www.myget.org),
and can be installed using the
`https://www.myget.org/F/opentelemetry/api/v3/index.json` source.
### Digital signing
Starting with the `1.10.0` release the DLLs included in the packages pushed to
NuGet are digitally signed using [Sigstore](https://www.sigstore.dev/). Within
each NuGet package the digital signature and its corresponding certificate file
are placed alongside the shipped DLL(s) in the `/lib` folder. When a project
targets multiple frameworks each target outputs a dedicated DLL and signing
artifacts into a sub folder based on the
[TFM](https://learn.microsoft.com/dotnet/standard/frameworks).
The digitial signature and certificate files share the same name prefix as the
DLL to ensure easy identification and association.
To verify the integrity of a DLL inside a NuGet package use the
[cosign](https://github.com/sigstore/cosign) tool from Sigstore:
```bash
cosign verify-blob \
--signature OpenTelemetry.dll-keyless.sig \
--certificate OpenTelemetry.dll-keyless.pem.cer \
--certificate-identity "https://github.com/open-telemetry/opentelemetry-dotnet/.github/workflows/publish-packages-1.0.yml@refs/tags/core-1.10.0-rc.1" \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
OpenTelemetry.dll
```
> [!NOTE]
> A successful verification outputs `Verify OK`.
For more verification options please refer to the [cosign
documentation](https://github.com/sigstore/cosign/blob/main/doc/cosign_verify-blob.md).
## Contributing
See [CONTRIBUTING.md](CONTRIBUTING.md)
For information about contributing to the project see:
[CONTRIBUTING.md](CONTRIBUTING.md).
We meet weekly on Tuesdays, and the time of the meeting alternates between 9AM
PT and 4PM PT. The meeting is subject to change depending on contributors'
@ -108,59 +236,60 @@ regardless of your experience level. Whether you're a seasoned OpenTelemetry
developer, just starting your journey, or simply curious about the work we do,
you're more than welcome to participate!
[Maintainers](https://github.com/open-telemetry/community/blob/main/community-membership.md#maintainer)
([@open-telemetry/dotnet-maintainers](https://github.com/orgs/open-telemetry/teams/dotnet-maintainers)):
### Maintainers
* [Alan West](https://github.com/alanwest), New Relic
* [Mikel Blanchard](https://github.com/CodeBlanch), Microsoft
* [Rajkumar Rangaraj](https://github.com/rajkumar-rangaraj), Microsoft
[Approvers](https://github.com/open-telemetry/community/blob/main/community-membership.md#approver)
([@open-telemetry/dotnet-approvers](https://github.com/orgs/open-telemetry/teams/dotnet-approvers)):
For more information about the maintainer role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#maintainer).
### Approvers
* [Cijo Thomas](https://github.com/cijothomas), Microsoft
* [Reiley Yang](https://github.com/reyang), Microsoft
* [Utkarsh Umesan Pillai](https://github.com/utpilla), Microsoft
* [Vishwesh Bankwar](https://github.com/vishweshbankwar), Microsoft
[Triagers](https://github.com/open-telemetry/community/blob/main/community-membership.md#triager)
([@open-telemetry/dotnet-triagers](https://github.com/orgs/open-telemetry/teams/dotnet-triagers)):
* [Martin Thwaites](https://github.com/martinjt), Honeycomb
* [Martin Costello](https://github.com/martincostello), Grafana Labs
* [Mikel Blanchard](https://github.com/CodeBlanch), Microsoft
* [Piotr Kie&#x142;kowicz](https://github.com/Kielek), Splunk
[Emeritus
Maintainer/Approver/Triager](https://github.com/open-telemetry/community/blob/main/community-membership.md#emeritus-maintainerapprovertriager):
For more information about the approver role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#approver).
### Triagers
* [Martin Thwaites](https://github.com/martinjt), Honeycomb
* [Timothy "Mothra" Lee](https://github.com/TimothyMothra)
For more information about the triager role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#triager).
### Emeritus Maintainers
* [Mike Goldsmith](https://github.com/MikeGoldsmith)
* [Sergey Kanzhelev](https://github.com/SergeyKanzhelev)
* [Utkarsh Umesan Pillai](https://github.com/utpilla)
For more information about the emeritus role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#emeritus-maintainerapprovertriager).
### Emeritus Approvers
* [Bruno Garcia](https://github.com/bruno-garcia)
* [Eddy Nakamura](https://github.com/eddynaka)
* [Liudmila Molkova](https://github.com/lmolkova)
* [Mike Goldsmith](https://github.com/MikeGoldsmith)
* [Paulo Janotti](https://github.com/pjanotti)
* [Reiley Yang](https://github.com/reyang)
* [Robert Paj&#x105;k](https://github.com/pellared)
* [Sergey Kanzhelev](https://github.com/SergeyKanzhelev)
* [Vishwesh Bankwar](https://github.com/vishweshbankwar)
For more information about the emeritus role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#emeritus-maintainerapprovertriager).
### Emeritus Triagers
* [Victor Lu](https://github.com/victlu)
For more information about the emeritus role, see the [community repository](https://github.com/open-telemetry/community/blob/main/guides/contributor/membership.md#emeritus-maintainerapprovertriager).
### Thanks to all the people who have contributed
[![contributors](https://contributors-img.web.app/image?repo=open-telemetry/opentelemetry-dotnet)](https://github.com/open-telemetry/opentelemetry-dotnet/graphs/contributors)
## Release Schedule
## References
See the [project
milestones](https://github.com/open-telemetry/opentelemetry-dotnet/milestones)
for details on upcoming releases. The dates and features described in issues and
milestones are estimates, and subject to change.
See the [release
notes](https://github.com/open-telemetry/opentelemetry-dotnet/releases) for
existing releases.
> [!CAUTION]
> Certain components, marked as
[pre-release](https://github.com/open-telemetry/opentelemetry-dotnet/blob/main/VERSIONING.md#pre-releases),
are still work in progress and can undergo breaking changes before stable
release. Check the individual `README.md` file for each component to understand its
current state.
Daily builds from this repo are published to MyGet, and can be installed from
[this source](https://www.myget.org/F/opentelemetry/api/v3/index.json).
* [OpenTelemetry Project](https://opentelemetry.io/)
* [OpenTelemetry Specification](https://github.com/open-telemetry/opentelemetry-specification)

133
RELEASENOTES.md Normal file
View File

@ -0,0 +1,133 @@
# Release Notes
This file contains highlights and announcements covering all components.
For more details see `CHANGELOG.md` files maintained in the root source
directory of each individual package.
## 1.12.0
Release details: [1.12.0](https://github.com/open-telemetry/opentelemetry-dotnet/releases/tag/core-1.12.0)
* **Breaking Change**: `OpenTelemetry.Exporter.OpenTelemetryProtocol` now
defaults to using OTLP/HTTP instead of OTLP/gRPC when targeting .NET Framework
and .NET Standard. This change may cause telemetry export to fail unless
appropriate adjustments are made. Explicitly setting OTLP/gRPC may result in a
`NotSupportedException` unless further configuration is applied. See
[#6209](https://github.com/open-telemetry/opentelemetry-dotnet/issues/6209) for
full details and mitigation guidance. [#6229](https://github.com/open-telemetry/opentelemetry-dotnet/pull/6229)
## 1.11.1
Release details: [1.11.1](https://github.com/open-telemetry/opentelemetry-dotnet/releases/tag/core-1.11.1)
* Fixed a bug preventing `OpenTelemetry.Exporter.OpenTelemetryProtocol` from
exporting telemetry on .NET Framework.
## 1.11.0
Release details: [1.11.0](https://github.com/open-telemetry/opentelemetry-dotnet/releases/tag/core-1.11.0)
* `OpenTelemetry.Exporter.OpenTelemetryProtocol` no longer depends on the
`Google.Protobuf`, `Grpc`, or `Grpc.Net.Client` packages. Serialization and
transmission of outgoing data is now performed manually to improve the overall
performance.
## 1.10.0
Release details: [1.10.0](https://github.com/open-telemetry/opentelemetry-dotnet/releases/tag/core-1.10.0)
* Bumped the package versions of `System.Diagnostic.DiagnosticSource` and other
Microsoft.Extensions.* packages to `9.0.0`.
* Added support for new APIs introduced in `System.Diagnostics.DiagnosticSource`
`9.0.0`:
* [InstrumentAdvice&lt;T&gt;](https://learn.microsoft.com/dotnet/api/system.diagnostics.metrics.instrumentadvice-1)
For details see: [Explicit bucket histogram
aggregation](./docs/metrics/customizing-the-sdk/README.md#explicit-bucket-histogram-aggregation).
* [Gauge&lt;T&gt;](https://learn.microsoft.com/dotnet/api/system.diagnostics.metrics.gauge-1)
* [ActivitySource.Tags](https://learn.microsoft.com/dotnet/api/system.diagnostics.activitysource.tags)
(supported in OtlpExporter & ConsoleExporter)
* Experimental features promoted to stable:
* `CardinalityLimit` can now be managed for individual metrics via the View
API. For details see: [Changing cardinality limit for a
Metric](./docs/metrics/customizing-the-sdk/README.md#changing-the-cardinality-limit-for-a-metric).
* The [overflow
attribute](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#overflow-attribute)
(`otel.metric.overflow`) behavior is now enabled by default. The
`OTEL_DOTNET_EXPERIMENTAL_METRICS_EMIT_OVERFLOW_ATTRIBUTE` environment
variable is no longer required. For details see: [Cardinality
Limits](./docs/metrics/README.md#cardinality-limits).
* The MetricPoint reclaim behavior is now enabled by default when Delta
aggregation temporality is used. The
`OTEL_DOTNET_EXPERIMENTAL_METRICS_RECLAIM_UNUSED_METRIC_POINTS` environment
variable is no longer required. For details see: [Cardinality
Limits](./docs/metrics/README.md#cardinality-limits).
* Added `OpenTelemetrySdk.Create` API for configuring OpenTelemetry .NET signals
(logging, tracing, and metrics) via a single builder. This new API simplifies
bootstrap and teardown, and supports cross-cutting extensions targeting
`IOpenTelemetryBuilder`.
* Removed out of support `net6.0` target and added `net9.0` target.
## 1.9.0
Release details: [1.9.0](https://github.com/open-telemetry/opentelemetry-dotnet/releases/tag/core-1.9.0)
* `Exemplars` are now part of the stable API! For details see: [customizing
exemplars
collection](https://github.com/open-telemetry/opentelemetry-dotnet/tree/main/docs/metrics/customizing-the-sdk#exemplars).
* `WithLogging` is now part of the stable API! Logging, Metrics, and Tracing can
now all be configured using the `With` style and the builders finally have
parity in their APIs.
## 1.8.0
Release details: [1.8.0](https://github.com/open-telemetry/opentelemetry-dotnet/releases/tag/core-1.8.0)
* `TracerProvider` sampler can now be configured via the `OTEL_TRACES_SAMPLER` &
`OTEL_TRACES_SAMPLER_ARG` envvars.
* A new `UseOtlpExporter` cross-cutting extension has been added to register the
`OtlpExporter` and enable all signals in a single call.
* `exception.type`, `exception.message`, `exception.stacktrace` will now
automatically be included by the `OtlpLogExporter` when logging exceptions.
Previously an experimental environment variable had to be set.
## 1.7.0
Release details: [1.7.0](https://github.com/open-telemetry/opentelemetry-dotnet/releases/tag/core-1.7.0)
* Bumped the package versions of System.Diagnostic.DiagnosticSource and other
Microsoft.Extensions.* packages to `8.0.0`.
* Added `net8.0` targets to all the components.
* OTLP Exporter
* Updated to use `ILogger` `CategoryName` as the instrumentation scope for
logs.
* Added named options support for OTLP Log Exporter.
* Added support for instrumentation scope attributes in metrics.
* Added support under an experimental flag to emit log exception attributes.
* Added support under an experimental flag to emit log eventId and eventName.
attributes.
* Added support for the
[IMetricsBuilder](https://learn.microsoft.com/dotnet/api/microsoft.extensions.diagnostics.metrics.imetricsbuilder)
API.
* Added an experimental opt-in metrics feature to reclaim unused MetricPoints
which enables a higher number of unique dimension combinations to be emitted.
See [reclaim unused metric
points](https://github.com/open-telemetry/opentelemetry-dotnet/blob/32c64d04defb5c92d056fd8817638151168b10da/docs/metrics/README.md#cardinality-limits)
for more details.

View File

@ -29,3 +29,20 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
License notice for gRPC for .NET (https://github.com/grpc/grpc-dotnet)
----------------------------------------------------------------------------------------------
Copyright 2019 The gRPC Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@ -2,13 +2,13 @@
<Import Project=".\Common.props" />
<PropertyGroup>
<NoWarn>$(NoWarn),1574,1591</NoWarn>
<NoWarn>$(NoWarn),CS1574,CS1591</NoWarn>
<IsPackable>false</IsPackable>
<CodeAnalysisRuleSet>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenTelemetry.sln'))\build\OpenTelemetry.test.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup>
<DefaultTargetFrameworkForExampleApps>net8.0</DefaultTargetFrameworkForExampleApps>
<DefaultTargetFrameworkForExampleApps>net9.0</DefaultTargetFrameworkForExampleApps>
</PropertyGroup>
<PropertyGroup Condition="$(MSBuildProjectName.EndsWith('.Tests'))">
@ -21,6 +21,18 @@
</Content>
</ItemGroup>
<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<PackageReference Include="GitHubActionsTestLogger" />
<PackageReference Include="JunitXml.TestLogger" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="All" />
</ItemGroup>
<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<Compile Include="$(RepoRoot)\test\Shared\StrongNameTests.cs" Link="StrongNameTests.cs" />
</ItemGroup>
<PropertyGroup>
<!-- Running unit tests from VSCode does not work with .NET SDK 6.0.200 without ProduceReferenceAssemblyInOutDir -->
<!-- Related breaking change: https://docs.microsoft.com/en-us/dotnet/core/compatibility/sdk/6.0/write-reference-assemblies-to-obj -->

View File

@ -3,6 +3,9 @@
<PropertyGroup>
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)/OpenTelemetry.prod.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Label="BuildFlags">
<ExposeExperimentalFeatures Condition="'$(ExposeExperimentalFeatures)' == ''">true</ExposeExperimentalFeatures>
<EnablePackageValidation Condition="'$(EnablePackageValidation)' == ''">false</EnablePackageValidation>
</PropertyGroup>
@ -15,13 +18,15 @@
<PackageProjectUrl>https://opentelemetry.io</PackageProjectUrl>
<Authors>OpenTelemetry Authors</Authors>
<Copyright>Copyright The OpenTelemetry Authors</Copyright>
<PackageOutputPath Condition="$(Build_ArtifactStagingDirectory) != ''">$(Build_ArtifactStagingDirectory)</PackageOutputPath>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackagePrimaryLicenseFile>$(RepoRoot)\LICENSE.TXT</PackagePrimaryLicenseFile>
<PackageThirdPartyNoticesFile>$(RepoRoot)\THIRD-PARTY-NOTICES.TXT</PackageThirdPartyNoticesFile>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageChangelogFile>CHANGELOG.md</PackageChangelogFile>
<PackageReleaseNotesFile>$(RepoRoot)\RELEASENOTES.md</PackageReleaseNotesFile>
</PropertyGroup>
<PropertyGroup Label="SourceLinkProperties">
@ -32,7 +37,6 @@
<ItemGroup>
<PackageReference Include="MinVer" PrivateAssets="All" Condition="'$(IntegrationBuild)' != 'true'" />
<PackageReference Include="Microsoft.SourceLink.GitHub" PrivateAssets="All" Condition="'$(IntegrationBuild)' != 'true'" />
<PackageReference Include="Microsoft.CodeAnalysis.PublicApiAnalyzers" PrivateAssets="All" />
</ItemGroup>
@ -47,7 +51,20 @@
<None Include=".publicApi\**\PublicAPI.*.txt" />
</ItemGroup>
<Target Name="AssemblyVersionTarget" AfterTargets="MinVer" Condition="'$(MinVerVersion)'!='' AND '$(BuildNumber)' != ''">
<Target Name="IncludeSigningSignaturesInPackages" BeforeTargets="_GetTargetFrameworksOutput">
<!-- Note: This target adds any signatures found to nuget packages -->
<ItemGroup>
<SignatureFiles Include="$(RepoRoot)\src\$(MSBuildProjectName)\bin\$(Configuration)\*\$(MSBuildProjectName).dll-keyless.sig" />
<Content Include="@(SignatureFiles)" Link="%(RecursiveDir)%(Filename)%(Extension)" PackagePath="lib" />
<CertificateFiles Include="$(RepoRoot)\src\$(MSBuildProjectName)\bin\$(Configuration)\*\$(MSBuildProjectName).dll-keyless.pem" />
<Content Include="@(CertificateFiles)" Link="%(RecursiveDir)%(Filename)%(Extension)" PackagePath="lib" />
</ItemGroup>
<Message Importance="high" Text="**IncludeSignaturesInPackagesDebug** SignatureFiles: @(SignatureFiles)" />
<Message Importance="high" Text="**IncludeCertificatesInPackagesDebug** SignatureFiles: @(CertificateFiles)" />
</Target>
<Target Name="AssemblyVersionTarget" AfterTargets="MinVer" Condition="'$(MinVerVersion)' != '' AND '$(BuildNumber)' != ''">
<!-- Note: $(BuildNumber) is typically only set for builds initiated by the
publish workflow. The goal here is to set the assembly FileVersion and
resolve ExposeExperimentalFeatures based on the version MinVer resolved from
@ -77,6 +94,66 @@
<Error Text="Cannot perform package validation without a baseline package version." />
</Target>
<Target Name="IncludeReadmeAndReleaseNotesInPackages" BeforeTargets="_GetTargetFrameworksOutput">
<!-- Note: This target runs during pack to convert relative links in
markdowns into github permalinks which will work when rendered on Nuget. -->
<Exec
Command="git rev-parse HEAD"
ConsoleToMsBuild="True"
IgnoreExitCode="True"
StandardOutputImportance="low">
<Output PropertyName="GitCommitConsoleOutput" TaskParameter="ConsoleOutput"/>
<Output PropertyName="GitCommitExitCode" TaskParameter="ExitCode"/>
</Exec>
<Exec
Command="git remote get-url origin"
ConsoleToMsBuild="True"
IgnoreExitCode="True"
StandardOutputImportance="low">
<Output PropertyName="GitOriginConsoleOutput" TaskParameter="ConsoleOutput"/>
<Output PropertyName="GitOriginExitCode" TaskParameter="ExitCode"/>
</Exec>
<PropertyGroup>
<MarkdownCommentRegex>\[([^]]+?)\]\(\.(.+?)\)</MarkdownCommentRegex>
<GitHubRepoUrl>$(GitOriginConsoleOutput.Replace('.git',''))</GitHubRepoUrl>
<GitHubPermalinkUrl Condition="'$(PackTag)' != ''">$(GitHubRepoUrl)/blob/$(PackTag)</GitHubPermalinkUrl>
<GitHubPermalinkUrl Condition="'$(PackTag)' == ''">$(GitHubRepoUrl)/blob/$(GitCommitConsoleOutput)</GitHubPermalinkUrl>
</PropertyGroup>
<Message Importance="high" Text="**GitInformationDebug** GitCommitConsoleOutput: $(GitCommitConsoleOutput), GitCommitExitCode: $(GitCommitExitCode), GitOriginConsoleOutput: $(GitOriginConsoleOutput), GitOriginExitCode: $(GitOriginExitCode), GitHubPermalinkUrl: $(GitHubPermalinkUrl)" />
<ItemGroup>
<PackageMarkdownFiles Include="README.md" />
</ItemGroup>
<ItemGroup>
<PackageMarkdownFiles Update="@(PackageMarkdownFiles)" Path="$([MSBuild]::ValueOrDefault('%(FullPath)','').Replace('$(RepoRoot)', '').Replace('%(FileName)%(Extension)', ''))" />
</ItemGroup>
<WriteLinesToFile
File="$(IntermediateOutputPath)%(PackageMarkdownFiles.Filename)%(PackageMarkdownFiles.Extension)"
Lines="$([System.Text.RegularExpressions.Regex]::Replace($([System.IO.File]::ReadAllText(%(PackageMarkdownFiles.FullPath))), '$(MarkdownCommentRegex)', '[$1]($(GitHubPermalinkUrl)%(PackageMarkdownFiles.Path).$2)').Replace('\', '/'))"
Overwrite="true"
Encoding="UTF-8"/>
<PropertyGroup>
<_PackageReleaseNotesFilePath>$([System.IO.Path]::GetFullPath('$(PackageReleaseNotesFile)').Replace('$(RepoRoot)', '').Replace('\', '/'))</_PackageReleaseNotesFilePath>
<_PackageChangelogFilePath>$([System.IO.Path]::GetFullPath('$(PackageChangelogFile)').Replace('$(RepoRoot)', '').Replace('\', '/'))</_PackageChangelogFilePath>
<PackageReleaseNotes>
For highlights and announcements see: $(GitHubPermalinkUrl)$(_PackageReleaseNotesFilePath).
For detailed changes see: $(GitHubPermalinkUrl)$(_PackageChangelogFilePath).
</PackageReleaseNotes>
</PropertyGroup>
<ItemGroup>
<Content Include="$(IntermediateOutputPath)*.md" PackagePath="/" />
</ItemGroup>
</Target>
<Target Name="ResolveExposeExperimentalFeatures" BeforeTargets="CoreCompile" DependsOnTargets="AssemblyVersionTarget">
<!-- Note: This runs for all builds. The goal here is to set the
EXPOSE_EXPERIMENTAL_FEATURES compiler constant if

View File

@ -4,15 +4,24 @@
<SignAssembly>true</SignAssembly>
<RepoRoot>$([System.IO.Directory]::GetParent($(MSBuildThisFileDirectory)).Parent.FullName)</RepoRoot>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)debug.snk</AssemblyOriginatorKeyFile>
<DefineConstants>$(DefineConstants);SIGNED</DefineConstants>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<NuGetAudit>true</NuGetAudit>
<NuGetAuditMode>all</NuGetAuditMode>
<NuGetAuditLevel>low</NuGetAuditLevel>
<!-- Suppress warnings for repo code using experimental features -->
<NoWarn>$(NoWarn);OTEL1000;OTEL1001;OTEL1002;OTEL1003;OTEL1004</NoWarn>
<!--temporarily disable. See 3958-->
<!--<AnalysisLevel>latest-All</AnalysisLevel>-->
<NoWarn>$(NoWarn);OTEL1000;OTEL1001;OTEL1002;OTEL1004</NoWarn>
<AnalysisLevel>latest-All</AnalysisLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(SignAssembly)' == 'true' ">
<StrongNamePublicKey>002400000480000094000000060200000024000052534131000400000100010051C1562A090FB0C9F391012A32198B5E5D9A60E9B80FA2D7B434C9E5CCB7259BD606E66F9660676AFC6692B8CDC6793D190904551D2103B7B22FA636DCBB8208839785BA402EA08FC00C8F1500CCEF28BBF599AA64FFB1E1D5DC1BF3420A3777BADFE697856E9D52070A50C3EA5821C80BEF17CA3ACFFA28F89DD413F096F898</StrongNamePublicKey>
</PropertyGroup>
<PropertyGroup Label="BuildFlags">
<RunningDotNetPack Condition="'$(RunningDotNetPack)' == ''">false</RunningDotNetPack>
</PropertyGroup>
<!-- OmniSharp/VS Code requires TargetFrameworks to be in descending order for IntelliSense and analysis. -->
@ -21,18 +30,19 @@
<NetFrameworkSupportedVersions>net481;net48;net472;net471;net47;net462</NetFrameworkSupportedVersions>
<!-- production TFMs -->
<TargetFrameworksForLibraries>net8.0;net6.0;netstandard2.0;$(NetFrameworkMinimumSupportedVersion)</TargetFrameworksForLibraries>
<TargetFrameworksForLibrariesExtended>net8.0;net6.0;netstandard2.1;netstandard2.0;$(NetFrameworkMinimumSupportedVersion)</TargetFrameworksForLibrariesExtended>
<TargetFrameworksForPrometheusAspNetCore>net8.0;net6.0</TargetFrameworksForPrometheusAspNetCore>
<TargetFrameworksForLibraries>net9.0;net8.0;netstandard2.0;$(NetFrameworkMinimumSupportedVersion)</TargetFrameworksForLibraries>
<TargetFrameworksForLibrariesExtended>net9.0;net8.0;netstandard2.1;netstandard2.0;$(NetFrameworkMinimumSupportedVersion)</TargetFrameworksForLibrariesExtended>
<TargetFrameworksForPrometheusAspNetCore>net9.0;net8.0</TargetFrameworksForPrometheusAspNetCore>
<TargetFrameworksRequiringSystemTextJsonDirectReference>net8.0;netstandard2.1;netstandard2.0;$(NetFrameworkMinimumSupportedVersion)</TargetFrameworksRequiringSystemTextJsonDirectReference>
<!-- non-production TFMs -->
<TargetFrameworksForAspNetCoreTests>net8.0;net7.0;net6.0</TargetFrameworksForAspNetCoreTests>
<TargetFrameworksForAotCompatibilityTests>net8.0</TargetFrameworksForAotCompatibilityTests>
<TargetFrameworksForDocs>net8.0;net7.0;net6.0</TargetFrameworksForDocs>
<TargetFrameworksForAspNetCoreTests>net9.0;net8.0</TargetFrameworksForAspNetCoreTests>
<TargetFrameworksForAotCompatibilityTests>net9.0;net8.0</TargetFrameworksForAotCompatibilityTests>
<TargetFrameworksForDocs>net9.0;net8.0</TargetFrameworksForDocs>
<TargetFrameworksForDocs Condition="$(OS) == 'Windows_NT' And '$(UsingMicrosoftNETSdkWeb)' != 'True'">
$(TargetFrameworksForDocs);$(NetFrameworkSupportedVersions)
</TargetFrameworksForDocs>
<TargetFrameworksForTests>net8.0;net7.0;net6.0</TargetFrameworksForTests>
<TargetFrameworksForTests>net9.0;net8.0</TargetFrameworksForTests>
<TargetFrameworksForTests Condition="$(OS) == 'Windows_NT'">
$(TargetFrameworksForTests);$(NetFrameworkMinimumSupportedVersion)
</TargetFrameworksForTests>

12
build/Common.targets Normal file
View File

@ -0,0 +1,12 @@
<Project>
<ItemGroup Condition="'$(ReferenceSystemTextJsonPackages)' == 'true' AND $(TargetFrameworksRequiringSystemTextJsonDirectReference.Contains('$(TargetFramework)'))">
<!-- Note: System.Text.Encodings.Web is referenced on NET Framework & NET
Standard targets because System.Text.Json v4.7.2 uses
System.Text.Encodings.Web >= v4.7.1 but System.Text.Encodings.Web needs to
be at v4.7.2 to be safe. -->
<PackageReference Include="System.Text.Encodings.Web" Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'" />
<PackageReference Include="System.Text.Json" />
</ItemGroup>
</Project>

View File

@ -80,11 +80,21 @@ Maintainers (admins) are needed to merge PRs and for the push to NuGet.**
for the projects being released.
</details
3. :stop_sign: The PR opened by [Prepare for a
3. For stable releases, use the `/UpdateReleaseNotes` command on the PR opened
by [Prepare for a
release](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/prepare-release.yml)
workflow in step 2 to update [Release Notes](../RELEASENOTES.md) with any
big or interesting new features.
* The `/UpdateReleaseDates` command may also be used to update dates in
`CHANGELOG.md` files. This is useful when the PR is opened a few days
before the planned release date to review public API changes.
4. :stop_sign: The PR opened by [Prepare for a
release](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/prepare-release.yml)
workflow in step 2 has to be merged.
4. Once the PR opened by [Prepare for a
5. Once the PR opened by [Prepare for a
release](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/prepare-release.yml)
workflow in step 2 has been merged a trigger will automatically add a
comment and lock the PR. Post a comment with "/CreateReleaseTag" in the
@ -123,7 +133,7 @@ Maintainers (admins) are needed to merge PRs and for the push to NuGet.**
workflow.
</details>
5. :stop_sign: Wait for the [Build, pack, and publish to
6. :stop_sign: Wait for the [Build, pack, and publish to
MyGet](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/publish-packages-1.0.yml)
workflow to complete. When complete a trigger will automatically add a
comment on the PR opened by [Prepare for a
@ -187,14 +197,14 @@ Maintainers (admins) are needed to merge PRs and for the push to NuGet.**
draft Release and click `Publish release`.
</details>
6. If a new stable version of the core packages was released, a PR should have
7. If a new stable version of the core packages was released, a PR should have
been automatically created by the [Complete
release](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/post-release.yml)
workflow to update the `OTelLatestStableVer` property in
`Directory.Packages.props` to the just released stable version. Merge that
PR once the build passes (this requires the packages be available on NuGet).
7. The [Complete
8. The [Complete
release](https://github.com/open-telemetry/opentelemetry-dotnet/actions/workflows/post-release.yml)
workflow should have invoked the [Core version
update](https://github.com/open-telemetry/opentelemetry-dotnet-contrib/actions/workflows/core-version-update.yml)
@ -203,6 +213,6 @@ Maintainers (admins) are needed to merge PRs and for the push to NuGet.**
repository which opens a PR to update dependencies. Verify this PR was
opened successfully.
8. Post an announcement in the [Slack
channel](https://cloud-native.slack.com/archives/C01N3BC2W7Q). Note any big
or interesting new features as part of the announcement.
9. For stable releases post an announcement in the [Slack
channel](https://cloud-native.slack.com/archives/C01N3BC2W7Q) announcing the
release and link to the release notes.

View File

@ -1,9 +0,0 @@
version: '3.7'
services:
tests:
build:
args:
PUBLISH_FRAMEWORK: net6.0
TEST_SDK_VERSION: "6.0"
BUILD_SDK_VERSION: "8.0"

View File

@ -1,9 +0,0 @@
version: '3.7'
services:
tests:
build:
args:
PUBLISH_FRAMEWORK: net7.0
TEST_SDK_VERSION: "7.0"
BUILD_SDK_VERSION: "8.0"

View File

@ -1,9 +1,7 @@
version: '3.7'
services:
tests:
build:
args:
PUBLISH_FRAMEWORK: net8.0
TEST_SDK_VERSION: "8.0"
BUILD_SDK_VERSION: "8.0"
BUILD_SDK_VERSION: "9.0"

View File

@ -0,0 +1,7 @@
services:
tests:
build:
args:
PUBLISH_FRAMEWORK: net9.0
TEST_SDK_VERSION: "9.0"
BUILD_SDK_VERSION: "9.0"

View File

@ -38,7 +38,7 @@ function AddLabelsOnPullRequestsBasedOnFilesChanged {
# it automatically in order to also allow manual inclusion after reviewing files
$managedLabels = 'infra', 'documentation', 'dependencies'
$rootInfraFiles = 'global.json', 'NuGet.config', 'codeowners'
$documentationFiles = 'readme.md', 'contributing.md', 'releasing.md', 'versioning.md'
$documentationFiles = 'readme.md', 'contributing.md', 'releasing.md', 'versioning.md', 'releasenotes.md'
foreach ($fileChanged in $filesChangedOnPullRequest)
{
@ -99,12 +99,12 @@ function AddLabelsOnPullRequestsBasedOnFilesChanged {
$rootInfraFiles.Contains($fullFileName) -or
$fileExtension -eq ".props" -or
$fileExtension -eq ".targets" -or
$fileChanged.StartsWith('test\openTelemetry.aotcompatibility'))
$fileChanged.StartsWith('test/openTelemetry.aotcompatibility'))
{
$added = $labelsToAdd.Add("infra")
}
if ($fileChanged.StartsWith('test\benchmarks'))
if ($fileChanged.StartsWith('test/benchmarks'))
{
$added = $labelsToAdd.Add("perf")
}

View File

@ -13,6 +13,7 @@ function CreateDraftRelease {
$tagPrefix = $match.Groups[1].Value
$version = $match.Groups[2].Value
$isPrerelease = $version -match '-alpha' -or $version -match '-beta' -or $version -match '-rc'
$projects = @(Get-ChildItem -Path src/**/*.csproj | Select-String "<MinVerTagPrefix>$tagPrefix</MinVerTagPrefix>" -List | Select Path)
@ -22,6 +23,7 @@ function CreateDraftRelease {
}
$notes = ''
$previousVersion = ''
foreach ($project in $projects)
{
@ -44,6 +46,11 @@ function CreateDraftRelease {
}
elseif ($line -like "## *" -and $started -eq $true)
{
$match = [regex]::Match($line, '^##\s*(.*)$')
if ($match.Success -eq $true)
{
$previousVersion = $match.Groups[1].Value
}
break
}
else
@ -57,7 +64,7 @@ function CreateDraftRelease {
if ([string]::IsNullOrWhitespace($content) -eq $true)
{
$content = " No notable changes."
$content = " No notable changes."
}
$content = $content.trimend()
@ -70,11 +77,19 @@ $content
See [CHANGELOG](https://github.com/$gitRepository/blob/$tag/src/$projectName/CHANGELOG.md) for details.
"@
}
if ($version -match '-alpha' -or $version -match '-beta' -or $version -match '-rc')
if ($isPrerelease -eq $true)
{
$notes =
@"
The following changes are from the previous release [$previousVersion](https://github.com/$gitRepository/releases/tag/$tagPrefix$previousVersion).
"@ + $notes
gh release create $tag $releaseFiles `
--title $tag `
--verify-tag `
@ -84,6 +99,15 @@ $content
}
else
{
$notes =
@"
For highlights and announcements pertaining to this release see: [Release Notes > $version](https://github.com/$gitRepository/blob/main/RELEASENOTES.md#$($version.Replace('.',''))).
The following changes are from the previous release [$previousVersion](https://github.com/$gitRepository/releases/tag/$tagPrefix$previousVersion).
"@ + $notes
gh release create $tag $releaseFiles `
--title $tag `
--verify-tag `
@ -239,6 +263,7 @@ function CreateStableVersionUpdatePullRequest {
[Parameter(Mandatory=$true)][string]$gitRepository,
[Parameter(Mandatory=$true)][string]$tag,
[Parameter()][string]$targetBranch="main",
[Parameter()][string]$lineEnding="`n",
[Parameter()][string]$gitUserName,
[Parameter()][string]$gitUserEmail
)
@ -249,7 +274,7 @@ function CreateStableVersionUpdatePullRequest {
throw 'Could not parse version from tag'
}
$packageVersion = $match.Groups[1].Value
$version = $match.Groups[1].Value
$branch="release/post-stable-${tag}-update"
@ -268,17 +293,38 @@ function CreateStableVersionUpdatePullRequest {
throw 'git switch failure'
}
$projectsAndDependenciesBefore = GetCoreDependenciesForProjects
(Get-Content Directory.Packages.props) `
-replace '<OTelLatestStableVer>.*<\/OTelLatestStableVer>', "<OTelLatestStableVer>$packageVersion</OTelLatestStableVer>" |
-replace '<OTelLatestStableVer>.*<\/OTelLatestStableVer>', "<OTelLatestStableVer>$version</OTelLatestStableVer>" |
Set-Content Directory.Packages.props
$projectsAndDependenciesAfter = GetCoreDependenciesForProjects
$changedProjects = @{}
$projectsAndDependenciesBefore.GetEnumerator() | ForEach-Object {
$projectDir = $_.Key
$projectDependenciesBefore = $_.Value
$projectDependenciesAfter = $projectsAndDependenciesAfter[$projectDir]
$projectDependenciesBefore.GetEnumerator() | ForEach-Object {
$packageName = $_.Key
$packageVersionBefore = $_.Value
if ($projectDependenciesAfter[$packageName] -ne $packageVersionBefore)
{
$changedProjects[$projectDir] = $true
}
}
}
git add Directory.Packages.props 2>&1 | % ToString
if ($LASTEXITCODE -gt 0)
{
throw 'git add failure'
}
git commit -m "Update OTelLatestStableVer in Directory.Packages.props to $packageVersion." 2>&1 | % ToString
git commit -m "Update OTelLatestStableVer in Directory.Packages.props to $version." 2>&1 | % ToString
if ($LASTEXITCODE -gt 0)
{
throw 'git commit failure'
@ -298,19 +344,177 @@ Merge once packages are available on NuGet and the build passes.
## Changes
* Sets ``OTelLatestStableVer`` in ``Directory.Packages.props`` to ``$packageVersion``.
* Sets ``OTelLatestStableVer`` in ``Directory.Packages.props`` to ``$version``.
"@
gh pr create `
--title "[release] Core stable release $packageVersion updates" `
$createPullRequestResponse = gh pr create `
--title "[release] Core stable release $version updates" `
--body $body `
--base $targetBranch `
--head $branch `
--label release
Write-Host $createPullRequestResponse
$match = [regex]::Match($createPullRequestResponse, "\/pull\/(.*)$")
if ($match.Success -eq $false)
{
throw 'Could not parse pull request number from gh pr create response'
}
$pullRequestNumber = $match.Groups[1].Value
if ($changedProjects.Count -eq 0)
{
Return
}
$entry = @"
* Updated OpenTelemetry core component version(s) to ``$version``.
([#$pullRequestNumber](https://github.com/$gitRepository/pull/$pullRequestNumber))
"@
$lastLineBlank = $true
$changelogFilesUpdated = 0
foreach ($projectDir in $changedProjects.Keys)
{
$path = Join-Path -Path $projectDir -ChildPath "CHANGELOG.md"
if ([System.IO.File]::Exists($path) -eq $false)
{
Write-Host "No CHANGELOG found in $projectDir"
continue
}
$changelogContent = Get-Content -Path $path
$started = $false
$isRemoving = $false
$content = ""
foreach ($line in $changelogContent)
{
if ($line -like "## Unreleased" -and $started -ne $true)
{
$started = $true
}
elseif ($line -like "## *" -and $started -eq $true)
{
if ($lastLineBlank -eq $false)
{
$content += $lineEnding
}
$content += $entry
$started = $false
$isRemoving = $false
}
elseif ($started -eq $true -and ($line -like '*Update* OpenTelemetry SDK version to*' -or $line -like '*Updated OpenTelemetry core component version(s) to*'))
{
$isRemoving = $true
continue
}
if ($line.StartsWith('* '))
{
if ($isRemoving -eq $true)
{
$isRemoving = $false
}
if ($lastLineBlank -eq $false)
{
$content += $lineEnding
}
}
if ($isRemoving -eq $true)
{
continue
}
$content += $line + $lineEnding
$lastLineBlank = [string]::IsNullOrWhitespace($line)
}
if ($started -eq $true)
{
# Note: If we never wrote the entry it means the file ended in the unreleased section
if ($lastLineBlank -eq $false)
{
$content += $lineEnding
}
$content += $entry
}
Set-Content -Path $path -Value $content.TrimEnd()
git add $path 2>&1 | % ToString
if ($LASTEXITCODE -gt 0)
{
throw 'git add failure'
}
$changelogFilesUpdated++
}
if ($changelogFilesUpdated -gt 0)
{
git commit -m "Update CHANGELOGs for projects using OTelLatestStableVer." 2>&1 | % ToString
if ($LASTEXITCODE -gt 0)
{
throw 'git commit failure'
}
git push -u origin $branch 2>&1 | % ToString
if ($LASTEXITCODE -gt 0)
{
throw 'git push failure'
}
}
}
Export-ModuleMember -Function CreateStableVersionUpdatePullRequest
function GetCoreDependenciesForProjects {
$projects = @(Get-ChildItem -Path 'src/*/*.csproj')
$projectsAndDependencies = @{}
foreach ($project in $projects)
{
# Note: dotnet restore may fail if the core packages aren't available yet but that is fine, we just want to generate project.assets.json for these projects.
$output = dotnet restore $project -p:RunningDotNetPack=true
$projectDir = $project | Split-Path -Parent
$content = (Get-Content "$projectDir/obj/project.assets.json" -Raw)
$projectDependencies = @{}
$matches = [regex]::Matches($content, '"(OpenTelemetry(?:.*))?": {[\S\s]*?"target": "Package",[\S\s]*?"version": "(.*)"[\S\s]*?}')
foreach ($match in $matches)
{
$packageName = $match.Groups[1].Value
$packageVersion = $match.Groups[2].Value
if ($packageName -eq 'OpenTelemetry' -or
$packageName -eq 'OpenTelemetry.Api' -or
$packageName -eq 'OpenTelemetry.Api.ProviderBuilderExtensions' -or
$packageName -eq 'OpenTelemetry.Extensions.Hosting' -or
$packageName -eq 'OpenTelemetry.Extensions.Propagators')
{
$projectDependencies[$packageName.ToString()] = $packageVersion.ToString()
}
}
$projectsAndDependencies[$projectDir.ToString()] = $projectDependencies
}
return $projectsAndDependencies
}
function InvokeCoreVersionUpdateWorkflowInRemoteRepository {
param(
[Parameter(Mandatory=$true)][string]$remoteGitRepository,

View File

@ -3,11 +3,19 @@ function CreatePullRequestToUpdateChangelogsAndPublicApis {
[Parameter(Mandatory=$true)][string]$gitRepository,
[Parameter(Mandatory=$true)][string]$minVerTagPrefix,
[Parameter(Mandatory=$true)][string]$version,
[Parameter(Mandatory=$true)][string]$requestedByUserName,
[Parameter()][string]$targetBranch="main",
[Parameter()][string]$gitUserName,
[Parameter()][string]$gitUserEmail
)
$match = [regex]::Match($version, '^(\d+\.\d+\.\d+)(?:-((?:alpha)|(?:beta)|(?:rc))\.(\d+))?$')
if ($match.Success -eq $false)
{
throw 'Input version did not match expected format'
}
$isPrerelease = $version -match '-alpha' -or $version -match '-beta' -or $version -match '-rc'
$tag="${minVerTagPrefix}${version}"
$branch="release/prepare-${tag}-release"
@ -30,6 +38,8 @@ function CreatePullRequestToUpdateChangelogsAndPublicApis {
@"
Note: This PR was opened automatically by the [prepare release workflow](https://github.com/$gitRepository/actions/workflows/prepare-release.yml).
Requested by: @$requestedByUserName
## Changes
* CHANGELOG files updated for projects being released.
@ -39,13 +49,37 @@ Note: This PR was opened automatically by the [prepare release workflow](https:/
& ./build/scripts/update-changelogs.ps1 -minVerTagPrefix $minVerTagPrefix -version $version
# Update publicApi files for stable releases
if ($version -notlike "*-alpha*" -and $version -notlike "*-beta*" -and $version -notlike "*-rc*")
if ($isPrerelease -ne $true)
{
& ./build/scripts/finalize-publicapi.ps1 -minVerTagPrefix $minVerTagPrefix
$body += "`r`n* Public API files updated for projects being released (only performed for stable releases)."
}
$body +=
@"
## Commands
``/UpdateReleaseDates``: Use to update release dates in CHANGELOGs before merging [``approvers``, ``maintainers``]
"@
if ($minVerTagPrefix -eq 'core-' -and $isPrerelease -ne $true)
{
$body +=
@"
``/UpdateReleaseNotes``: Use to update ``RELEASENOTES.md`` before merging [``approvers``, ``maintainers``]
"@
}
$body +=
@"
``/CreateReleaseTag``: Use after merging to push the release tag and trigger the job to create packages [``approvers``, ``maintainers``]
``/PushPackages``: Use after the created packages have been validated to push to NuGet [``maintainers``]
"@
git commit -a -m "Prepare repo to release $tag." 2>&1 | % ToString
if ($LASTEXITCODE -gt 0)
{
@ -58,12 +92,42 @@ Note: This PR was opened automatically by the [prepare release workflow](https:/
throw 'git push failure'
}
gh pr create `
$createPullRequestResponse = gh pr create `
--title "[release] Prepare release $tag" `
--body $body `
--base $targetBranch `
--head $branch `
--label release
Write-Host $createPullRequestResponse
$match = [regex]::Match($createPullRequestResponse, "\/pull\/(.*)$")
if ($match.Success -eq $false)
{
throw 'Could not parse pull request number from gh pr create response'
}
$pullRequestNumber = $match.Groups[1].Value
if ($minVerTagPrefix -eq 'core-' -and $isPrerelease -ne $true)
{
$found = Select-String -Path "RELEASENOTES.md" -Pattern "## $version" -Quiet
if ($found -eq $false)
{
$body =
@"
I noticed this PR is releasing a stable version of core packages but there isn't any content in ``RELEASENOTES.md`` for the version being released.
It is important to update ``RELEASENOTES.md`` before creating the release tag because a permalink will become part of the package(s).
Post a comment with "/UpdateReleaseNotes" in the body if you would like me to update release notes.
Note: In the comment everything below "/UpdateReleaseNotes" will be added to ``RELEASENOTES.md`` for the version being released. If something is already there it will be replaced.
"@
gh pr comment $pullRequestNumber --body $body
}
}
}
Export-ModuleMember -Function CreatePullRequestToUpdateChangelogsAndPublicApis
@ -172,3 +236,228 @@ The [package workflow](https://github.com/$gitRepository/actions/workflows/publi
}
Export-ModuleMember -Function CreateReleaseTagAndPostNoticeOnPullRequest
function UpdateChangelogReleaseDatesAndPostNoticeOnPullRequest {
param(
[Parameter(Mandatory=$true)][string]$gitRepository,
[Parameter(Mandatory=$true)][string]$pullRequestNumber,
[Parameter(Mandatory=$true)][string]$botUserName,
[Parameter(Mandatory=$true)][string]$commentUserName,
[Parameter()][string]$gitUserName,
[Parameter()][string]$gitUserEmail
)
$prViewResponse = gh pr view $pullRequestNumber --json headRefName,author,title | ConvertFrom-Json
if ($prViewResponse.author.login -ne $botUserName)
{
throw 'PR author was unexpected'
}
$match = [regex]::Match($prViewResponse.title, '^\[release\] Prepare release (.*)$')
if ($match.Success -eq $false)
{
throw 'Could not parse tag from PR title'
}
$tag = $match.Groups[1].Value
$match = [regex]::Match($tag, '^(.*?-)(.*)$')
if ($match.Success -eq $false)
{
throw 'Could not parse prefix or version from tag'
}
$tagPrefix = $match.Groups[1].Value
$version = $match.Groups[2].Value
$commentUserPermission = gh api "repos/$gitRepository/collaborators/$commentUserName/permission" | ConvertFrom-Json
if ($commentUserPermission.permission -ne 'admin' -and $commentUserPermission.permission -ne 'write')
{
gh pr comment $pullRequestNumber `
--body "I'm sorry @$commentUserName but you don't have permission to update this PR. Only maintainers and approvers can update this PR."
return
}
if ([string]::IsNullOrEmpty($gitUserName) -eq $false)
{
git config user.name $gitUserName
}
if ([string]::IsNullOrEmpty($gitUserEmail) -eq $false)
{
git config user.email $gitUserEmail
}
git switch $prViewResponse.headRefName 2>&1 | % ToString
if ($LASTEXITCODE -gt 0)
{
throw 'git switch failure'
}
$updatedFiles = 0
$newHeader =
@"
## $version
Released $(Get-Date -UFormat '%Y-%b-%d')
"@
$projectDirs = Get-ChildItem -Path src/**/*.csproj | Select-String "<MinVerTagPrefix>$tagPrefix</MinVerTagPrefix>" -List | Select Path | Split-Path -Parent
foreach ($projectDir in $projectDirs)
{
$content = (Get-Content "$projectDir/CHANGELOG.md" -Raw)
$newContent = $content -replace "## $version\s*Released .*", $newHeader
if ($content -ne $newContent)
{
$updatedFiles++
Set-Content -Path "$projectDir/CHANGELOG.md" $newContent.Trim()
}
}
if ($updatedFiles -eq 0)
{
gh pr comment $pullRequestNumber --body "All of the CHANGELOG files have valid release dates."
return
}
git commit -a -m "Update CHANGELOG release dates for $tag." 2>&1 | % ToString
if ($LASTEXITCODE -gt 0)
{
throw 'git commit failure'
}
git push -u origin $prViewResponse.headRefName 2>&1 | % ToString
if ($LASTEXITCODE -gt 0)
{
throw 'git push failure'
}
gh pr comment $pullRequestNumber --body "I updated the CHANGELOG release dates."
}
Export-ModuleMember -Function UpdateChangelogReleaseDatesAndPostNoticeOnPullRequest
function UpdateReleaseNotesAndPostNoticeOnPullRequest {
param(
[Parameter(Mandatory=$true)][string]$gitRepository,
[Parameter(Mandatory=$true)][string]$pullRequestNumber,
[Parameter(Mandatory=$true)][string]$botUserName,
[Parameter(Mandatory=$true)][string]$commentUserName,
[Parameter(Mandatory=$true)][string]$commentBody,
[Parameter()][string]$gitUserName,
[Parameter()][string]$gitUserEmail
)
$prViewResponse = gh pr view $pullRequestNumber --json headRefName,author,title | ConvertFrom-Json
if ($prViewResponse.author.login -ne $botUserName)
{
throw 'PR author was unexpected'
}
$match = [regex]::Match($prViewResponse.title, '^\[release\] Prepare release (.*)$')
if ($match.Success -eq $false)
{
throw 'Could not parse tag from PR title'
}
$tag = $match.Groups[1].Value
$match = [regex]::Match($tag, '^(.*?-)(.*)$')
if ($match.Success -eq $false)
{
throw 'Could not parse prefix or version from tag'
}
$tagPrefix = $match.Groups[1].Value
$version = $match.Groups[2].Value
$isPrerelease = $version -match '-alpha' -or $version -match '-beta' -or $version -match '-rc'
$commentUserPermission = gh api "repos/$gitRepository/collaborators/$commentUserName/permission" | ConvertFrom-Json
if ($commentUserPermission.permission -ne 'admin' -and $commentUserPermission.permission -ne 'write')
{
gh pr comment $pullRequestNumber `
--body "I'm sorry @$commentUserName but you don't have permission to update this PR. Only maintainers and approvers can update this PR."
return
}
if ($tagPrefix -ne 'core-' -or $isPrerelease -eq $true)
{
gh pr comment $pullRequestNumber `
--body "I'm sorry @$commentUserName but we don't typically add release notes for prereleases or unstable packages."
return
}
if ([string]::IsNullOrEmpty($gitUserName) -eq $false)
{
git config user.name $gitUserName
}
if ([string]::IsNullOrEmpty($gitUserEmail) -eq $false)
{
git config user.email $gitUserEmail
}
git switch $prViewResponse.headRefName 2>&1 | % ToString
if ($LASTEXITCODE -gt 0)
{
throw 'git switch failure'
}
$releaseNotesContent = (Get-Content -Path "RELEASENOTES.md" -Raw)
$match = [regex]::Match($commentBody, '[\w\W\s]*\/UpdateReleaseNotes.*$([\w\W\s]*)', [Text.RegularExpressions.RegexOptions]::Multiline)
if ($match.Success -eq $false)
{
throw 'Could not find release notes content'
}
$content = $match.Groups[1].Value.Trim() -replace "`r`n", "`n"
$body =
@"
## $version
Release details: [$version](https://github.com/$gitRepository/releases/tag/$tagPrefix$version)
$content
##
"@
$match = [regex]::Match($releaseNotesContent, "(## $version[\w\W\s]*?)##", [Text.RegularExpressions.RegexOptions]::Multiline)
if ($match.Success -eq $true)
{
$content = [regex]::Replace($releaseNotesContent, "(## $version[\w\W\s]*?)##", $body, [Text.RegularExpressions.RegexOptions]::Multiline)
Set-Content -Path "RELEASENOTES.md" -Value $content.TrimEnd()
}
else {
$match = [regex]::Match($releaseNotesContent, '(# Release Notes[\w\W\s]*?)##', [Text.RegularExpressions.RegexOptions]::Multiline)
if ($match.Success -eq $false)
{
throw 'Could not find release notes header'
}
$body = $match.Groups[1].Value + $body
$content = [regex]::Replace($releaseNotesContent, '(# Release Notes[\w\W\s]*?)##', $body, [Text.RegularExpressions.RegexOptions]::Multiline)
Set-Content -Path "RELEASENOTES.md" -Value $content.TrimEnd()
}
git commit -a -m "Update RELEASENOTES for $tag." 2>&1 | % ToString
if ($LASTEXITCODE -gt 0)
{
throw 'git commit failure'
}
git push -u origin $prViewResponse.headRefName 2>&1 | % ToString
if ($LASTEXITCODE -gt 0)
{
throw 'git push failure'
}
gh pr comment $pullRequestNumber --body "I updated ``RELEASENOTES.md``."
}
Export-ModuleMember -Function UpdateReleaseNotesAndPostNoticeOnPullRequest

View File

@ -24,10 +24,9 @@ if ($LastExitCode -ne 0)
Write-Host $publishOutput
}
$runtime = $IsWindows ? "win-x64" : ($IsMacOS ? "macos-x64" : "linux-x64")
$app = $IsWindows ? "./OpenTelemetry.AotCompatibility.TestApp.exe" : "./OpenTelemetry.AotCompatibility.TestApp"
Push-Location $rootDirectory/test/OpenTelemetry.AotCompatibility.TestApp/bin/Release/$targetNetFramework/$runtime
Push-Location $rootDirectory/artifacts/publish/OpenTelemetry.AotCompatibility.TestApp/release_$targetNetFramework
Write-Host "Executing test App..."
$app

View File

@ -1,22 +1,32 @@
param(
[Parameter()][string]$coyoteVersion="1.7.10",
[Parameter()][string]$coyoteVersion="1.7.11",
[Parameter(Mandatory=$true)][string]$testProjectName,
[Parameter(Mandatory=$true)][string]$targetFramework,
[Parameter()][string]$categoryName="CoyoteConcurrencyTests",
[Parameter()][string]$configuration="Release"
)
$ErrorActionPreference = "Stop"
$env:OTEL_RUN_COYOTE_TESTS = 'true'
$rootDirectory = Get-Location
Write-Host "Install Coyote CLI."
dotnet tool install --global Microsoft.Coyote.CLI
dotnet tool install --global Microsoft.Coyote.CLI --version $coyoteVersion
if ($LASTEXITCODE -ne 0) {
throw "Microsoft.Coyote.CLI installation failed with exit code $LASTEXITCODE"
}
Write-Host "Build $testProjectName project."
dotnet build "$rootDirectory/test/$testProjectName/$testProjectName.csproj" --configuration $configuration
$artifactsPath = Join-Path $rootDirectory "test/$testProjectName/bin/$configuration/$targetFramework"
if ($LASTEXITCODE -ne 0) {
throw "dotnet build failed with exit code $LASTEXITCODE"
}
$artifactsPath = Join-Path $rootDirectory "artifacts/bin/$testProjectName/$($configuration.ToLowerInvariant())_$targetFramework"
Write-Host "Generate Coyote rewriting options JSON file."
$assemblies = Get-ChildItem $artifactsPath -Filter OpenTelemetry*.dll | ForEach-Object {$_.Name}
@ -29,6 +39,13 @@ $RewriteOptionsJson | ConvertTo-Json -Compress | Set-Content -Path "$rootDirecto
Write-Host "Run Coyote rewrite."
coyote rewrite "$rootDirectory/test/$testProjectName/rewrite.coyote.json"
if ($LASTEXITCODE -ne 0) {
throw "coyote rewrite failed with exit code $LASTEXITCODE"
}
Write-Host "Execute re-written binary."
dotnet test "$artifactsPath/$testProjectName.dll" --framework $targetFramework --filter CategoryName=$categoryName
if ($LASTEXITCODE -ne 0) {
throw "dotnet test failed with exit code $LASTEXITCODE"
}

View File

@ -1,8 +1,11 @@
<Project>
<Import Project="$([System.IO.Path]::Combine($(MSBuildThisFileDirectory), '..', 'Directory.Build.props'))" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'OpenTelemetry.sln'))\build\Common.nonprod.props" />
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>$(TargetFrameworksForDocs)</TargetFrameworks>
<!-- Opt-out of Artifacts Output for docs as there are duplicated project names -->
<UseArtifactsOutput>false</UseArtifactsOutput>
</PropertyGroup>
</Project>

134
docs/README.md Normal file
View File

@ -0,0 +1,134 @@
# OpenTelemetry .NET SDK
## Initialize the SDK
There are two different common initialization styles supported by OpenTelemetry.
### Initialize the SDK using a host
Users building applications based on
[Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting)
should utilize the
[OpenTelemetry.Extensions.Hosting](../src/OpenTelemetry.Extensions.Hosting/README.md)
package to initialize OpenTelemetry. This style provides a deep integration
between the host infrastructure (`IServiceCollection`, `IServiceProvider`,
`IConfiguration`, etc.) and OpenTelemetry.
[AspNetCore](https://learn.microsoft.com/aspnet/core/fundamentals/host/web-host)
applications are the most common to use the hosting model but there is also a
[Generic Host](https://learn.microsoft.com/dotnet/core/extensions/generic-host)
which may be used in console, service, and worker applications.
> [!NOTE]
> When using `OpenTelemetry.Extensions.Hosting` only a single pipeline will be
> created for each configured signal (logging, metrics, and/or tracing). Users
> who need more granular control can create additional pipelines using the
> manual style below.
First install the
[OpenTelemetry.Extensions.Hosting](../src/OpenTelemetry.Extensions.Hosting/README.md)
package.
Second call the `AddOpenTelemetry` extension using the host
`IServiceCollection`:
```csharp
var builder = WebApplication.CreateBuilder(args);
// Clear the default logging providers added by the host
builder.Logging.ClearProviders();
// Initialize OpenTelemetry
builder.Services.AddOpenTelemetry()
.ConfigureResource(resource => /* Resource configuration goes here */)
.WithLogging(logging => /* Logging configuration goes here */)
.WithMetrics(metrics => /* Metrics configuration goes here */)
.WithTracing(tracing => /* Tracing configuration goes here */));
```
> [!NOTE]
> Calling `WithLogging` automatically registers the OpenTelemetry
> `ILoggerProvider` and enables `ILogger` integration.
### Initialize the SDK manually
Users running on .NET Framework or running without a host may initialize
OpenTelemetry manually.
> [!IMPORTANT]
> When initializing OpenTelemetry manually make sure to ALWAYS dispose the SDK
> and/or providers when the application is shutting down. Disposing
> OpenTelemetry gives the SDK a chance to flush any telemetry held in memory.
> Skipping this step may result in data loss.
First install the [OpenTelemetry SDK](../src/OpenTelemetry/README.md) package or
an exporter package such as
[OpenTelemetry.Exporter.OpenTelemetryProtocol](../src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md).
Exporter packages typically reference the SDK and will make it available via
transitive reference.
Second use one of the following initialization APIs (depending on the SDK
version being used):
#### Using 1.10.0 or newer
The `OpenTelemetrySdk.Create` API can be used to initialize all signals off a
single root builder and supports cross-cutting extensions such as
`ConfigureResource` which configures a `Resource` to be used by all enabled
signals. An `OpenTelemetrySdk` instance is returned which may be used to access
providers for each signal. Calling `Dispose` on the returned instance will
gracefully shutdown the SDK and flush any telemetry held in memory.
> [!NOTE]
> When calling `OpenTelemetrySdk.Create` a dedicated `IServiceCollection` and
> `IServiceProvider` will be created for the SDK and shared by all signals. An
> `IConfiguration` is created automatically from environment variables.
```csharp
using OpenTelemetry;
var sdk = OpenTelemetrySdk.Create(builder => builder
.ConfigureResource(resource => /* Resource configuration goes here */)
.WithLogging(logging => /* Logging configuration goes here */)
.WithMetrics(metrics => /* Metrics configuration goes here */)
.WithTracing(tracing => /* Tracing configuration goes here */));
// During application shutdown
sdk.Dispose();
```
To obtain an `ILogger` instance for emitting logs when using the
`OpenTelemetrySdk.Create` API call the `GetLoggerFactory` extension method using
the returned `OpenTelemetrySdk` instance:
```csharp
var logger = sdk.GetLoggerFactory().CreateLogger<Program>();
logger.LogInformation("Application started");
```
#### Using 1.9.0 or older
The following shows how to create providers for each individual signal. Each
provider is independent and must be managed and disposed explicitly. There is no
mechanism using this style to perform cross-cutting actions across signals.
```csharp
using Microsoft.Extensions.Logging;
using OpenTelemetry;
var tracerProvider = Sdk.CreateTracerProviderBuilder()
/* Tracing configuration goes here */
.Build();
var meterProvider = Sdk.CreateMeterProviderBuilder()
/* Metrics configuration goes here */
.Build();
var loggerFactory = LoggerFactory.Create(builder => builder
.AddOpenTelemetry(options => /* Logging configuration goes here */));
// During application shutdown
tracerProvider.Dispose();
meterProvider.Dispose();
loggerFactory.Dispose();
```

View File

@ -1,47 +0,0 @@
# OpenTelemetry .NET Diagnostic: OTEL1003
## Overview
This is an Experimental API diagnostic covering the following API:
* `MetricStreamConfiguration.CardinalityLimit.get`
* `MetricStreamConfiguration.CardinalityLimit.set`
Experimental APIs may be changed or removed in the future.
## Details
From the specification:
> The cardinality limit for an aggregation is defined in one of three ways:
>
> 1. A view with criteria matching the instrument an aggregation is created for
> has an `aggregation_cardinality_limit` value defined for the stream, that
> value SHOULD be used.
> 2. If there is no matching view, but the `MetricReader` defines a default
> cardinality limit value based on the instrument an aggregation is created
> for, that value SHOULD be used.
> 3. If none of the previous values are defined, the default value of 2000
> SHOULD be used.
We are exposing these APIs experimentally until the specification declares them
stable.
### Setting cardinality limit for a specific Metric via the View API
The OpenTelemetry Specification defines the [cardinality
limit](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#cardinality-limits)
of a metric can be set by the matching view.
```csharp
using var meterProvider = Sdk.CreateMeterProviderBuilder()
.AddView(
instrumentName: "MyFruitCounter",
new MetricStreamConfiguration { CardinalityLimit = 10 })
.Build();
```
### Setting cardinality limit for a specific MetricReader
[This is not currently supported by OpenTelemetry
.NET.](https://github.com/open-telemetry/opentelemetry-dotnet/issues/5331)

View File

@ -27,12 +27,6 @@ Description: Logs Bridge API
Details: [OTEL1001](./OTEL1001.md)
### OTEL1003
Description: MetricStreamConfiguration CardinalityLimit Support
Details: [OTEL1003](./OTEL1003.md)
### OTEL1004
Description: ExemplarReservoir Support
@ -58,3 +52,11 @@ Description: Metrics Exemplar Support
Details: [OTEL1002](https://github.com/open-telemetry/opentelemetry-dotnet/blob/b8ea807bae1a5d9b0f3d6d23b1e1e10f5e096a25/docs/diagnostics/experimental-apis/OTEL1002.md)
Released stable: `1.9.0`
### OTEL1003
Description: MetricStreamConfiguration CardinalityLimit Support
Details: [OTEL1003](https://github.com/open-telemetry/opentelemetry-dotnet/blob/9f41eadf03f3dcc5e76c686b61fb39849f046312/docs/diagnostics/experimental-apis/OTEL1003.md)
Released stable: `1.10.0`

View File

@ -25,33 +25,17 @@ OpenTelemetry .NET:
* [Getting Started - Console Application](./getting-started-console/README.md)
* [Logging with Complex Objects](./complex-objects/README.md)
## Structured Logging
## Logging API
:heavy_check_mark: You should use structured logging.
### ILogger
* Structured logging is more efficient than unstructured logging.
* Filtering and redaction can happen on individual key-value pairs instead of
the entire log message.
* Storage and indexing are more efficient.
* Structured logging makes it easier to manage and consume logs.
.NET supports high performance, structured logging via the
[`Microsoft.Extensions.Logging.ILogger`](https://docs.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger)
interface (including
[`ILogger<TCategoryName>`](https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger-1))
to help monitor application behavior and diagnose issues.
:stop_sign: You should avoid string interpolation.
> [!WARNING]
> The following code has bad performance due to [string
interpolation](https://learn.microsoft.com/dotnet/csharp/tutorials/string-interpolation):
```csharp
var food = "tomato";
var price = 2.99;
logger.LogInformation($"Hello from {food} {price}.");
```
Refer to the [logging performance
benchmark](../../test/Benchmarks/Logs/LogBenchmarks.cs) for more details.
## Package Version
#### Package Version
:heavy_check_mark: You should always use the
[`ILogger`](https://docs.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger)
@ -69,16 +53,6 @@ package, regardless of the .NET runtime version being used:
backward compatibility on `Microsoft.Extensions.Logging` even during major
version bumps, so compatibility is not a concern here.
## Logging API
### ILogger
.NET supports high performance, structured logging via the
[`Microsoft.Extensions.Logging.ILogger`](https://docs.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger)
interface (including
[`ILogger<TCategoryName>`](https://learn.microsoft.com/dotnet/api/microsoft.extensions.logging.ilogger-1))
to help monitor application behavior and diagnose issues.
#### Get Logger
In order to use the `ILogger` interface, you need to first get a logger. How to
@ -125,7 +99,38 @@ are not super expensive, they still come with CPU and memory cost, and are meant
to be reused throughout the application. Refer to the [logging performance
benchmark](../../test/Benchmarks/Logs/LogBenchmarks.cs) for more details.
#### Use Logger
#### Write log messages
:heavy_check_mark: You should use structured logging.
* Structured logging is more efficient than unstructured logging.
* Filtering and redaction can happen on individual key-value pairs instead of
the entire log message.
* Storage and indexing are more efficient.
* Structured logging makes it easier to manage and consume logs.
```csharp
var food = "tomato";
var price = 2.99;
logger.LogInformation("Hello from {food} {price}.", food, price);
```
:stop_sign: You should avoid string interpolation.
> [!WARNING]
> The following code has bad performance due to [string
interpolation](https://learn.microsoft.com/dotnet/csharp/tutorials/string-interpolation):
```csharp
var food = "tomato";
var price = 2.99;
logger.LogInformation($"Hello from {food} {price}.");
```
Refer to the [logging performance
benchmark](../../test/Benchmarks/Logs/LogBenchmarks.cs) for more details.
:heavy_check_mark: You should use [compile-time logging source
generation](https://docs.microsoft.com/dotnet/core/extensions/logger-message-generator)
@ -222,6 +227,111 @@ code is now depending on which logger is being enabled, not to mention the
argument evaluation might have significant side effects that are now depending
on the logging configuration.
:heavy_check_mark: You should use a dedicated parameter to log exceptions when
using the compile-time source generator.
```csharp
var food = "tomato";
var price = 2.99;
try
{
// Execute some logic
logger.SayHello(food, price);
}
catch (Exception ex)
{
logger.SayHelloFailure(ex, food, price);
}
internal static partial class LoggerExtensions
{
[LoggerMessage(Level = LogLevel.Information, Message = "Hello from {food} {price}.")]
public static partial void SayHello(this ILogger logger, string food, double price);
[LoggerMessage(Level = LogLevel.Error, Message = "Could not say hello from {food} {price}.")]
public static partial void SayHelloFailure(this ILogger logger, Exception exception, string food, double price);
}
```
> [!NOTE]
> When using the compile-time source generator the first `Exception` parameter
> detected is automatically given special handling. It **SHOULD NOT** be part of
> the message template. For details see: [Log method
> anatomy](https://learn.microsoft.com/dotnet/core/extensions/logger-message-generator#log-method-anatomy).
:heavy_check_mark: You should use the dedicated overloads to log exceptions when
using the logging extensions methods.
```csharp
var food = "tomato";
var price = 2.99;
try
{
// Execute some logic
logger.LogInformation("Hello from {food} {price}.", food, price);
}
catch (Exception ex)
{
logger.LogError(ex, "Could not say hello from {food} {price}.", food, price);
}
```
:stop_sign: You should avoid adding exception details into the message template.
You want to use the correct `Exception` APIs because the OpenTelemetry
Specification [defines dedicated
attributes](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/exceptions/exceptions-logs.md)
for `Exception` details. The following examples show what **NOT** to do. In
these cases the details won't be lost, but the dedicated attributes also won't
be added.
```csharp
var food = "tomato";
var price = 2.99;
try
{
// Execute some logic
logger.SayHello(food, price);
}
catch (Exception ex)
{
logger.SayHelloFailure(food, price, ex.Message);
}
internal static partial class LoggerExtensions
{
[LoggerMessage(Level = LogLevel.Information, Message = "Hello from {food} {price}.")]
public static partial void SayHello(this ILogger logger, string food, double price);
// BAD - Exception should not be part of the message template. Use the dedicated parameter.
[LoggerMessage(Level = LogLevel.Error, Message = "Could not say hello from {food} {price} {message}.")]
public static partial void SayHelloFailure(this ILogger logger, string food, double price, string message);
}
```
```csharp
var food = "tomato";
var price = 2.99;
try
{
// Execute some logic
logger.LogInformation("Hello from {food} {price}.", food, price);
}
catch (Exception ex)
{
// BAD - Exception should not be part of the message template. Use the dedicated parameter.
logger.LogError("Could not say hello from {food} {price} {message}.", food, price, ex.Message);
}
```
## LoggerFactory
In many cases, you can use [ILogger](#ilogger) without having to interact with

View File

@ -1,7 +1,9 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
public struct FoodRecallNotice
namespace ComplexObjects;
internal struct FoodRecallNotice
{
public string? BrandName { get; set; }

View File

@ -1,6 +1,7 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
using ComplexObjects;
using Microsoft.Extensions.Logging;
using OpenTelemetry.Logs;

View File

@ -7,7 +7,9 @@ using OpenTelemetry;
using OpenTelemetry.Logs;
using OpenTelemetry.Trace;
public class Program
namespace Correlation;
internal sealed class Program
{
private static readonly ActivitySource MyActivitySource = new("MyCompany.MyProduct.MyLibrary");

View File

@ -6,7 +6,7 @@ using OpenTelemetry.Logs;
namespace DedicatedLogging;
public static class DedicatedLoggingServiceCollectionExtensions
internal static class DedicatedLoggingServiceCollectionExtensions
{
public static IServiceCollection AddDedicatedLogging(
this IServiceCollection services,

View File

@ -3,10 +3,10 @@
namespace DedicatedLogging;
public interface IDedicatedLogger : ILogger
internal interface IDedicatedLogger : ILogger
{
}
public interface IDedicatedLogger<out TCategoryName> : IDedicatedLogger
internal interface IDedicatedLogger<out TCategoryName> : IDedicatedLogger
{
}

View File

@ -1,4 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<NoWarn>$(NoWarn);CA1812;CA2213</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Console\OpenTelemetry.Exporter.Console.csproj" />
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Extensions.Hosting\OpenTelemetry.Extensions.Hosting.csproj" />

View File

@ -5,7 +5,7 @@ using System.Text;
using OpenTelemetry;
using OpenTelemetry.Logs;
internal class MyExporter : BaseExporter<LogRecord>
internal sealed class MyExporter : BaseExporter<LogRecord>
{
private readonly string name;
@ -59,6 +59,7 @@ internal class MyExporter : BaseExporter<LogRecord>
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
Console.WriteLine($"{this.name}.Dispose({disposing})");
}
}

View File

@ -4,7 +4,7 @@
using OpenTelemetry;
using OpenTelemetry.Logs;
internal class MyProcessor : BaseProcessor<LogRecord>
internal sealed class MyProcessor : BaseProcessor<LogRecord>
{
private readonly string name;
@ -32,6 +32,7 @@ internal class MyProcessor : BaseProcessor<LogRecord>
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
Console.WriteLine($"{this.name}.Dispose({disposing})");
}
}

View File

@ -6,7 +6,7 @@ using OpenTelemetry;
namespace ExtendingTheSdk;
public class Program
internal sealed class Program
{
public static void Main()
{
@ -29,16 +29,16 @@ public class Program
// logger.LogInformation($"Hello from potato {0.99}.");
// structured log with template
logger.LogInformation("Hello from {name} {price}.", "tomato", 2.99);
logger.LogInformation("Hello from {Name} {Price}.", "tomato", 2.99);
// structured log with strong type
logger.LogInformation("{food}", new Food { Name = "artichoke", Price = 3.99 });
logger.LogInformation("{Food}", new Food { Name = "artichoke", Price = 3.99 });
// structured log with anonymous type
logger.LogInformation("{food}", new { Name = "pumpkin", Price = 5.99 });
logger.LogInformation("{Food}", new { Name = "pumpkin", Price = 5.99 });
// structured log with general type
logger.LogInformation("{food}", new Dictionary<string, object>
logger.LogInformation("{Food}", new Dictionary<string, object>
{
["Name"] = "truffle",
["Price"] = 299.99,
@ -48,11 +48,11 @@ public class Program
using (logger.BeginScope("[operation]"))
using (logger.BeginScope("[hardware]"))
{
logger.LogError("{name} is broken.", "refrigerator");
logger.LogError("{Name} is broken.", "refrigerator");
}
// message will be redacted by MyRedactionProcessor
logger.LogInformation("OpenTelemetry {sensitiveString}.", "<secret>");
logger.LogInformation("OpenTelemetry {SensitiveString}.", "<secret>");
}
internal struct Food

View File

@ -1,4 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<NoWarn>$(NoWarn);CA2000;CA1848;CA1510;CA1305</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry\OpenTelemetry.csproj" />
</ItemGroup>

View File

@ -15,18 +15,18 @@ internal sealed class MyRedactionProcessor : BaseProcessor<LogRecord>
}
}
internal sealed class MyClassWithRedactionEnumerator : IReadOnlyList<KeyValuePair<string, object>>
internal sealed class MyClassWithRedactionEnumerator : IReadOnlyList<KeyValuePair<string, object?>>
{
private readonly IReadOnlyList<KeyValuePair<string, object>> state;
private readonly IReadOnlyList<KeyValuePair<string, object?>> state;
public MyClassWithRedactionEnumerator(IReadOnlyList<KeyValuePair<string, object>> state)
public MyClassWithRedactionEnumerator(IReadOnlyList<KeyValuePair<string, object?>> state)
{
this.state = state;
}
public int Count => this.state.Count;
public KeyValuePair<string, object> this[int index]
public KeyValuePair<string, object?> this[int index]
{
get
{
@ -34,14 +34,14 @@ internal sealed class MyRedactionProcessor : BaseProcessor<LogRecord>
var entryVal = item.Value?.ToString();
if (entryVal != null && entryVal.Contains("<secret>"))
{
return new KeyValuePair<string, object>(item.Key, "newRedactedValueHere");
return new KeyValuePair<string, object?>(item.Key, "newRedactedValueHere");
}
return item;
}
}
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
public IEnumerator<KeyValuePair<string, object?>> GetEnumerator()
{
for (var i = 0; i < this.Count; i++)
{

View File

@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- this is temporary. will remove in future PR. -->
<Nullable>disable</Nullable>
<NoWarn>$(NoWarn);CA2213;CA1812;CA1307</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Console\OpenTelemetry.Exporter.Console.csproj" />
</ItemGroup>

View File

@ -10,11 +10,13 @@
* [Instruments](#instruments)
* [MeterProvider Management](#meterprovider-management)
* [Memory Management](#memory-management)
* [Example](#example)
* [Pre-Aggregation](#pre-aggregation)
* [Cardinality Limits](#cardinality-limits)
* [Memory Preallocation](#memory-preallocation)
* [Metrics Correlation](#metrics-correlation)
* [Metrics Enrichment](#metrics-enrichment)
* [Common issues that lead to missing metrics](#common-issues-that-lead-to-missing-metrics)
</details>
@ -57,7 +59,7 @@ too frequently. `Meter` is fairly expensive and meant to be reused throughout
the application. For most applications, it can be modeled as static readonly
field (e.g. [Program.cs](./getting-started-console/Program.cs)) or singleton via
dependency injection (e.g.
[Instrumentation.cs](../../examples/AspNetCore/Instrumentation.cs)).
[InstrumentationSource.cs](../../examples/AspNetCore/InstrumentationSource.cs)).
:heavy_check_mark: You should use dot-separated
[UpperCamelCase](https://en.wikipedia.org/wiki/Camel_case) as the
@ -86,7 +88,7 @@ static readonly Meter MyMeter = new("MyCompany.MyProduct.MyLibrary", "1.0");
| [Asynchronous Gauge](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#asynchronous-gauge) | [`ObservableGauge<T>`](https://learn.microsoft.com/dotnet/api/system.diagnostics.metrics.observablegauge-1) |
| [Asynchronous UpDownCounter](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#asynchronous-updowncounter) | [`ObservableUpDownCounter<T>`](https://learn.microsoft.com/dotnet/api/system.diagnostics.metrics.observableupdowncounter-1) |
| [Counter](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#counter) | [`Counter<T>`](https://learn.microsoft.com/dotnet/api/system.diagnostics.metrics.counter-1) |
| [Gauge](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#gauge) (experimental) | N/A |
| [Gauge](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#gauge) | [`Gauge<T>`](https://learn.microsoft.com/dotnet/api/system.diagnostics.metrics.gauge-1) |
| [Histogram](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#histogram) | [`Histogram<T>`](https://learn.microsoft.com/dotnet/api/system.diagnostics.metrics.histogram-1) |
| [UpDownCounter](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/api.md#updowncounter) | [`UpDownCounter<T>`](https://learn.microsoft.com/dotnet/api/system.diagnostics.metrics.updowncounter-1) |
@ -95,7 +97,7 @@ frequently. Instruments are fairly expensive and meant to be reused throughout
the application. For most applications, instruments can be modeled as static
readonly fields (e.g. [Program.cs](./getting-started-console/Program.cs)) or
singleton via dependency injection (e.g.
[Instrumentation.cs](../../examples/AspNetCore/Instrumentation.cs)).
[InstrumentationSource.cs](../../examples/AspNetCore/InstrumentationSource.cs)).
:stop_sign: You should avoid invalid instrument names.
@ -127,7 +129,7 @@ There are two different ways of passing tags to an instrument API:
* Pass the tags directly to the instrument API:
```csharp
counter.Add(100, ("Key1", "Value1"), ("Key2", "Value2"));
counter.Add(100, new("Key1", "Value1"), new("Key2", "Value2"));
```
* Use
@ -386,37 +388,25 @@ and the `MetricStreamConfiguration.CardinalityLimit` setting. Refer to this
[doc](../../docs/metrics/customizing-the-sdk/README.md#changing-the-cardinality-limit-for-a-metric)
for more information.
Given a metric, once the cardinality limit is reached, any new measurement which
cannot be independently aggregated because of the limit will be dropped or
As of `1.10.0` once a metric has reached the cardinality limit, any new
measurement that could not be independently aggregated will be automatically
aggregated using the [overflow
attribute](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#overflow-attribute)
(if enabled). When NOT using the overflow attribute feature a warning is written
to the [self-diagnostic log](../../src/OpenTelemetry/README.md#self-diagnostics)
the first time an overflow is detected for a given metric.
attribute](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#overflow-attribute).
> [!NOTE]
> Overflow attribute was introduced in OpenTelemetry .NET
[1.6.0-rc.1](../../src/OpenTelemetry/CHANGELOG.md#160-rc1). It is currently an
experimental feature which can be turned on by setting the environment
variable `OTEL_DOTNET_EXPERIMENTAL_METRICS_EMIT_OVERFLOW_ATTRIBUTE=true`. Once
the [OpenTelemetry
Specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#overflow-attribute)
become stable, this feature will be turned on by default.
> In SDK versions `1.6.0` - `1.9.0` the overflow attribute was an experimental
feature that could be enabled by setting the environment variable
`OTEL_DOTNET_EXPERIMENTAL_METRICS_EMIT_OVERFLOW_ATTRIBUTE=true`.
When [Delta Aggregation
As of `1.10.0` when [Delta Aggregation
Temporality](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/data-model.md#temporality)
is used, it is possible to choose a smaller cardinality limit by allowing the
SDK to reclaim unused metric points.
is used, it is possible to choose a smaller cardinality limit because the SDK
will reclaim unused metric points.
> [!NOTE]
> Reclaim unused metric points feature was introduced in OpenTelemetry .NET
[1.7.0-alpha.1](../../src/OpenTelemetry/CHANGELOG.md#170-alpha1). It is
currently an experimental feature which can be turned on by setting the
environment variable
`OTEL_DOTNET_EXPERIMENTAL_METRICS_RECLAIM_UNUSED_METRIC_POINTS=true`. Once the
[OpenTelemetry
Specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#overflow-attribute)
become stable, this feature will be turned on by default.
> In SDK versions `1.7.0` - `1.9.0`, metric point reclaim was an experimental
feature that could be enabled by setting the environment variable
`OTEL_DOTNET_EXPERIMENTAL_METRICS_RECLAIM_UNUSED_METRIC_POINTS=true`.
### Memory Preallocation

View File

@ -8,7 +8,7 @@ using OpenTelemetry.Resources;
namespace CustomizingTheSdk;
public class Program
internal static class Program
{
private static readonly Meter Meter1 = new("CompanyA.ProductA.Library1", "1.0");
private static readonly Meter Meter2 = new("CompanyA.ProductB.Library2", "1.0");
@ -29,17 +29,23 @@ public class Program
.AddView(instrumentName: "MyCounter", name: "MyCounterRenamed")
// Change Histogram boundaries using the Explicit Bucket Histogram aggregation.
.AddView(instrumentName: "MyHistogram", new ExplicitBucketHistogramConfiguration() { Boundaries = new double[] { 10, 20 } })
.AddView(instrumentName: "MyHistogram", new ExplicitBucketHistogramConfiguration() { Boundaries = [10.0, 20.0] })
// Change Histogram to use the Base2 Exponential Bucket Histogram aggregation.
.AddView(instrumentName: "MyExponentialBucketHistogram", new Base2ExponentialBucketHistogramConfiguration())
// For the instrument "MyCounterCustomTags", aggregate with only the keys "tag1", "tag2".
.AddView(instrumentName: "MyCounterCustomTags", new MetricStreamConfiguration() { TagKeys = new string[] { "tag1", "tag2" } })
.AddView(instrumentName: "MyCounterCustomTags", new MetricStreamConfiguration() { TagKeys = ["tag1", "tag2"] })
// Drop the instrument "MyCounterDrop".
.AddView(instrumentName: "MyCounterDrop", MetricStreamConfiguration.Drop)
// Configure the Explicit Bucket Histogram aggregation with custom boundaries and new name.
.AddView(instrumentName: "histogramWithMultipleAggregations", new ExplicitBucketHistogramConfiguration() { Boundaries = [10.0, 20.0], Name = "MyHistogramWithExplicitHistogram" })
// Use Base2 Exponential Bucket Histogram aggregation and new name.
.AddView(instrumentName: "histogramWithMultipleAggregations", new Base2ExponentialBucketHistogramConfiguration() { Name = "MyHistogramWithBase2ExponentialBucketHistogram" })
// An instrument which does not match any views
// gets processed with default behavior. (SDK default)
// Uncommenting the following line will
@ -70,6 +76,12 @@ public class Program
exponentialBucketHistogram.Record(random.Next(1, 1000), new("tag1", "value1"), new("tag2", "value2"));
}
var histogramWithMultipleAggregations = Meter1.CreateHistogram<long>("histogramWithMultipleAggregations");
for (int i = 0; i < 20000; i++)
{
histogramWithMultipleAggregations.Record(random.Next(1, 1000), new("tag1", "value1"), new("tag2", "value2"));
}
var counterCustomTags = Meter1.CreateCounter<long>("MyCounterCustomTags");
for (int i = 0; i < 20000; i++)
{

View File

@ -200,29 +200,56 @@ used.
##### Explicit bucket histogram aggregation
By default, the boundaries used for a Histogram are [`{ 0, 5, 10, 25, 50, 75,
100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000}`](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.14.0/specification/metrics/sdk.md#explicit-bucket-histogram-aggregation).
Views can be used to provide custom boundaries for a Histogram. The measurements
are then aggregated using the custom boundaries provided instead of the the
default boundaries. This requires the use of
`ExplicitBucketHistogramConfiguration`.
By default, the [OpenTelemetry
Specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.14.0/specification/metrics/sdk.md#explicit-bucket-histogram-aggregation)
defines explicit buckets (aka boundaries) for Histograms as: `[ 0, 5, 10, 25,
50, 75, 100, 250, 500, 750, 1000, 2500, 5000, 7500, 10000 ]`.
```csharp
// Change Histogram boundaries to count measurements under the following buckets:
// (-inf, 10]
// (10, 20]
// (20, +inf)
.AddView(
instrumentName: "MyHistogram",
new ExplicitBucketHistogramConfiguration { Boundaries = new double[] { 10, 20 } })
###### Customizing explicit buckets when using histogram aggregation
// If you provide an empty `double` array as `Boundaries` to the `ExplicitBucketHistogramConfiguration`,
// the SDK will only export the sum, count, min and max for the measurements.
// There are no buckets exported in this case.
.AddView(
instrumentName: "MyHistogram",
new ExplicitBucketHistogramConfiguration { Boundaries = Array.Empty<double>() })
```
There are two mechanisms available to configure explicit buckets when using
histogram aggregation:
* View API - Part of the OpenTelemetry .NET SDK.
* Advice API - Part of the `System.Diagnostics.DiagnosticSource` package
starting with version `9.0.0`.
> [!IMPORTANT]
> When both the View API and Advice API are used, the View API takes precedence.
If explicit buckets are not provided by either the View API or the Advice API
then the SDK defaults apply.
* View API
Views can be used to provide custom explicit buckets for a Histogram. This
requires the use of `ExplicitBucketHistogramConfiguration`.
```csharp
// Change Histogram boundaries to count measurements under the following buckets:
// (-inf, 10]
// (10, 20]
// (20, +inf)
.AddView(
instrumentName: "MyHistogram",
new ExplicitBucketHistogramConfiguration { Boundaries = new double[] { 10, 20 } })
// If you provide an empty `double` array as `Boundaries` to the `ExplicitBucketHistogramConfiguration`,
// the SDK will only export the sum, count, min and max for the measurements.
// There are no buckets exported in this case.
.AddView(
instrumentName: "MyHistogram",
new ExplicitBucketHistogramConfiguration { Boundaries = Array.Empty<double>() })
```
* Advice API
Starting with the `1.10.0` SDK, explicit buckets for a Histogram may be provided
by instrumentation authors when the instrument is created. This is generally
recommended to be used by library authors when the SDK defaults don't match the
required granularity for the histogram being emitted.
See: [Using Advice to customize Histogram
instruments](https://learn.microsoft.com/dotnet/core/diagnostics/metrics-instrumentation#using-advice-to-customize-histogram-instruments).
##### Base2 exponential bucket histogram aggregation
@ -245,6 +272,90 @@ within the maximum number of buckets defined by `MaxSize`. The default
new Base2ExponentialBucketHistogramConfiguration { MaxSize = 40 })
```
#### Produce multiple metrics from single instrument
When an instrument matches multiple views, it can generate multiple metrics. For
instance, if an instrument is matched by two different view configurations, it
will result in two separate metrics being produced from that single instrument.
Below is an example demonstrating how to leverage this capability to create two
independent metrics from a single instrument. In this example, a histogram
instrument is used to report measurements, and views are configured to produce
two metrics : one aggregated using `ExplicitBucketHistogramConfiguration` and the
other using `Base2ExponentialBucketHistogramConfiguration`.
```csharp
var histogramWithMultipleAggregations = meter.CreateHistogram<long>("HistogramWithMultipleAggregations");
// Configure the Explicit Bucket Histogram aggregation with custom boundaries and new name.
.AddView(instrumentName: "HistogramWithMultipleAggregations", new ExplicitBucketHistogramConfiguration() { Boundaries = new double[] { 10, 20 }, Name = "MyHistogramWithExplicitHistogram" })
// Use Base2 Exponential Bucket Histogram aggregation and new name.
.AddView(instrumentName: "HistogramWithMultipleAggregations", new Base2ExponentialBucketHistogramConfiguration() { Name = "MyHistogramWithBase2ExponentialBucketHistogram" })
// Both views rename the metric to avoid name conflicts. However, in this case,
// renaming one would be sufficient.
// This measurement will be aggregated into two separate metrics.
histogramWithMultipleAggregations.Record(10, new("tag1", "value1"), new("tag2", "value2"));
```
When using views that produce multiple metrics from single instrument, it's
crucial to rename the metric to prevent conflicts. In the event of conflict,
OpenTelemetry will emit an internal warning but will still export both metrics.
The impact of this behavior depends on the backend or receiver being used. You
can refer to [OpenTelemetry's
specification](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/data-model.md#opentelemetry-protocol-data-model-consumer-recommendations)
for more details.
Below example is showing the *BAD* practice. DO NOT FOLLOW it.
```csharp
var histogram = meter.CreateHistogram<long>("MyHistogram");
// Configure a view to aggregate based only on the "location" tag.
.AddView(instrumentName: "MyHistogram", metricStreamConfiguration: new MetricStreamConfiguration
{
TagKeys = new string[] { "location" },
})
// Configure another view to aggregate based only on the "status" tag.
.AddView(instrumentName: "MyHistogram", metricStreamConfiguration: new MetricStreamConfiguration
{
TagKeys = new string[] { "status" },
})
// The measurement below will be aggregated into two metric streams, but both will have the same name.
// OpenTelemetry will issue a warning about this conflict and pass both streams to the exporter.
// However, this may cause issues depending on the backend.
histogram.Record(10, new("location", "seattle"), new("status", "OK"));
```
The modified version, avoiding name conflict is shown below:
```csharp
var histogram = meter.CreateHistogram<long>("MyHistogram");
// Configure a view to aggregate based only on the "location" tag,
// and rename the metric.
.AddView(instrumentName: "MyHistogram", metricStreamConfiguration: new MetricStreamConfiguration
{
Name = "MyHistogramWithLocation",
TagKeys = new string[] { "location" },
})
// Configure a view to aggregate based only on the "status" tag,
// and rename the metric.
.AddView(instrumentName: "MyHistogram", metricStreamConfiguration: new MetricStreamConfiguration
{
Name = "MyHistogramWithStatus",
TagKeys = new string[] { "status" },
})
// The measurement below will be aggregated into two separate metrics, "MyHistogramWithLocation"
// and "MyHistogramWithStatus".
histogram.Record(10, new("location", "seattle"), new("status", "OK"));
```
> [!NOTE]
> The SDK currently does not support any changes to `Aggregation` type
by using Views.
@ -319,9 +430,8 @@ metrics managed by a given `MeterProvider`, use the
> [!CAUTION]
> `MeterProviderBuilder.SetMaxMetricPointsPerMetricStream` is marked `Obsolete`
in pre-release builds and has been replaced by
`MetricStreamConfiguration.CardinalityLimit`. For details see:
[OTEL1003](../../diagnostics/experimental-apis/OTEL1003.md).
in stable builds since 1.10.0 and has been replaced by
`MetricStreamConfiguration.CardinalityLimit`.
```csharp
using var meterProvider = Sdk.CreateMeterProviderBuilder()
@ -337,11 +447,6 @@ To set the [cardinality limit](../README.md#cardinality-limits) for an
individual metric, use the `MetricStreamConfiguration.CardinalityLimit` property
on the View API:
> [!NOTE]
> `MetricStreamConfiguration.CardinalityLimit` is an experimental API only
available in pre-release builds. For details see:
[OTEL1003](../../diagnostics/experimental-apis/OTEL1003.md).
```csharp
var meterProvider = Sdk.CreateMeterProviderBuilder()
.AddMeter("MyCompany.MyProduct.MyLibrary")

View File

@ -1,4 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<NoWarn>$(NoWarn);CA5394</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Console\OpenTelemetry.Exporter.Console.csproj" />
</ItemGroup>

View File

@ -8,7 +8,9 @@ using OpenTelemetry.Exporter;
using OpenTelemetry.Metrics;
using OpenTelemetry.Trace;
public class Program
namespace Exemplars;
internal static class Program
{
private static readonly ActivitySource MyActivitySource = new("OpenTelemetry.Demo.Exemplar");
private static readonly Meter MyMeter = new("OpenTelemetry.Demo.Exemplar");

View File

@ -58,7 +58,7 @@ and
enabled:
```sh
./prometheus --enable-feature=exemplar-storage --enable-feature=otlp-write-receiver
./prometheus --enable-feature=exemplar-storage --web.enable-otlp-receiver
```
## Install and configure Grafana

View File

@ -1,4 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<NoWarn>$(NoWarn);CA5394</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.OpenTelemetryProtocol\OpenTelemetry.Exporter.OpenTelemetryProtocol.csproj" />
</ItemGroup>

View File

@ -5,7 +5,7 @@ using System.Text;
using OpenTelemetry;
using OpenTelemetry.Metrics;
internal class MyExporter : BaseExporter<Metric>
internal sealed class MyExporter : BaseExporter<Metric>
{
private readonly string name;
@ -28,7 +28,7 @@ internal class MyExporter : BaseExporter<Metric>
sb.Append(", ");
}
sb.Append($"{metric.Name}");
sb.Append(metric.Name);
foreach (ref readonly var metricPoint in metric.GetMetricPoints())
{
@ -52,6 +52,7 @@ internal class MyExporter : BaseExporter<Metric>
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
Console.WriteLine($"{this.name}.Dispose({disposing})");
}
}

View File

@ -8,7 +8,7 @@ using OpenTelemetry.Metrics;
namespace ExtendingTheSdk;
public class Program
internal static class Program
{
private static readonly Meter MyMeter = new("MyCompany.MyProduct.MyLibrary", "1.0");
private static readonly Counter<long> MyFruitCounter = MyMeter.CreateCounter<long>("MyFruitCounter");

View File

@ -1,4 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<NoWarn>$(NoWarn);CA2000;CA1510;CA1305</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry\OpenTelemetry.csproj" />
</ItemGroup>

View File

@ -5,7 +5,9 @@ using System.Diagnostics.Metrics;
using OpenTelemetry;
using OpenTelemetry.Metrics;
public class Program
namespace GettingStartedConsole;
internal static class Program
{
private static readonly Meter MyMeter = new("MyCompany.MyProduct.MyLibrary", "1.0");
private static readonly Counter<long> MyFruitCounter = MyMeter.CreateCounter<long>("MyFruitCounter");

View File

@ -6,7 +6,9 @@ using OpenTelemetry;
using OpenTelemetry.Exporter;
using OpenTelemetry.Metrics;
public class Program
namespace GettingStartedPrometheusGrafana;
internal static class Program
{
private static readonly Meter MyMeter = new("MyCompany.MyProduct.MyLibrary", "1.0");
private static readonly Counter<long> MyFruitCounter = MyMeter.CreateCounter<long>("MyFruitCounter");

View File

@ -88,7 +88,7 @@ access. Run the `prometheus(.exe)` server executable with feature flag
enabled:
```sh
./prometheus --enable-feature=otlp-write-receiver
./prometheus --web.enable-otlp-receiver
```
### View results in Prometheus

View File

@ -8,7 +8,7 @@ using OpenTelemetry.Metrics;
namespace LearningMoreInstruments;
public class Program
internal static class Program
{
private static readonly Meter MyMeter = new("MyCompany.MyProduct.MyLibrary", "1.0");
private static readonly Histogram<long> MyHistogram = MyMeter.CreateHistogram<long>("MyHistogram");

View File

@ -1,4 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<NoWarn>$(NoWarn);CA5394</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry\OpenTelemetry.csproj" />
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Console\OpenTelemetry.Exporter.Console.csproj" />

View File

@ -0,0 +1,12 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0
using Microsoft.Extensions.Logging;
namespace ExtendingTheSdk;
internal static partial class LoggerExtensions
{
[LoggerMessage(LogLevel.Information, "Hello from {Name} {Price}")]
public static partial void HelloFrom(this ILogger logger, string name, double price);
}

View File

@ -3,7 +3,7 @@
using OpenTelemetry.Resources;
internal class MyResourceDetector : IResourceDetector
internal sealed class MyResourceDetector : IResourceDetector
{
public Resource Detect()
{

View File

@ -11,7 +11,7 @@ using OpenTelemetry.Trace;
namespace ExtendingTheSdk;
public class Program
internal static class Program
{
private static readonly ActivitySource DemoSource = new("OTel.Demo");
private static readonly Meter MeterDemoSource = new("OTel.Demo");
@ -55,7 +55,6 @@ public class Program
}
var logger = loggerFactory.CreateLogger("OTel.Demo");
logger
.LogInformation("Hello from {Name} {Price}", "tomato", 2.99);
logger.HelloFrom("tomato", 2.99);
}
}

View File

@ -49,7 +49,7 @@ too frequently. `ActivitySource` is fairly expensive and meant to be reused
throughout the application. For most applications, it can be modeled as static
readonly field (e.g. [Program.cs](./getting-started-console/Program.cs)) or
singleton via dependency injection (e.g.
[Instrumentation.cs](../../examples/AspNetCore/Instrumentation.cs)).
[InstrumentationSource.cs](../../examples/AspNetCore/InstrumentationSource.cs)).
:heavy_check_mark: You should use dot-separated
[UpperCamelCase](https://en.wikipedia.org/wiki/Camel_case) as the

View File

@ -8,7 +8,7 @@ using OpenTelemetry.Trace;
namespace CustomizingTheSdk;
public class Program
internal static class Program
{
private static readonly ActivitySource MyLibraryActivitySource = new(
"MyCompany.MyProduct.MyLibrary");

View File

@ -477,8 +477,8 @@ When using the `AddOpenTelemetry` & `WithTracing` extension methods the
into an existing collection (typically the collection used is the one managed by
the application host). The `TracerProviderBuilder` will be able to access all
services registered into that collection. For lifecycle management, the
`AddOpenTelemetry` registers an [IHostedService
](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.ihostedservice)
`AddOpenTelemetry` registers an
[IHostedService](https://learn.microsoft.com/dotnet/api/microsoft.extensions.hosting.ihostedservice)
which is used to automatically start the `TracerProvider` when the host starts
and the host will automatically shutdown and dispose the `TracerProvider` when
it is shutdown.

View File

@ -1,8 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- this is temporary. will remove in future PR. -->
<Nullable>disable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry.Exporter.Console\OpenTelemetry.Exporter.Console.csproj" />
</ItemGroup>

View File

@ -4,7 +4,7 @@
using System.Diagnostics;
using OpenTelemetry;
internal class MyEnrichingProcessor : BaseProcessor<Activity>
internal sealed class MyEnrichingProcessor : BaseProcessor<Activity>
{
public override void OnEnd(Activity activity)
{

View File

@ -5,7 +5,7 @@ using System.Diagnostics;
using System.Text;
using OpenTelemetry;
internal class MyExporter : BaseExporter<Activity>
internal sealed class MyExporter : BaseExporter<Activity>
{
private readonly string name;
@ -43,6 +43,7 @@ internal class MyExporter : BaseExporter<Activity>
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
Console.WriteLine($"{this.name}.Dispose({disposing})");
}
}

View File

@ -4,7 +4,7 @@
using System.Diagnostics;
using OpenTelemetry;
internal class MyProcessor : BaseProcessor<Activity>
internal sealed class MyProcessor : BaseProcessor<Activity>
{
private readonly string name;
@ -37,6 +37,7 @@ internal class MyProcessor : BaseProcessor<Activity>
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
Console.WriteLine($"{this.name}.Dispose({disposing})");
}
}

View File

@ -3,7 +3,7 @@
using OpenTelemetry.Resources;
internal class MyResourceDetector : IResourceDetector
internal sealed class MyResourceDetector : IResourceDetector
{
public Resource Detect()
{

View File

@ -3,7 +3,7 @@
using OpenTelemetry.Trace;
internal class MySampler : Sampler
internal sealed class MySampler : Sampler
{
public override SamplingResult ShouldSample(in SamplingParameters param)
{

View File

@ -8,7 +8,7 @@ using OpenTelemetry.Trace;
namespace ExtendingTheSdk;
public class Program
internal static class Program
{
private static readonly ActivitySource DemoSource = new("OTel.Demo");

View File

@ -320,10 +320,10 @@ cases, it is recommended to use that option as it offers higher performance.
OpenTelemetry .NET SDK has provided the following built-in samplers:
* [AlwaysOffSampler](../../../src/OpenTelemetry/Trace/AlwaysOffSampler.cs)
* [AlwaysOnSampler](../../../src/OpenTelemetry/Trace/AlwaysOnSampler.cs)
* [ParentBasedSampler](../../../src/OpenTelemetry/Trace/ParentBasedSampler.cs)
* [TraceIdRatioBasedSampler](../../../src/OpenTelemetry/Trace/TraceIdRatioBasedSampler.cs)
* [AlwaysOffSampler](../../../src/OpenTelemetry/Trace/Sampler/AlwaysOffSampler.cs)
* [AlwaysOnSampler](../../../src/OpenTelemetry/Trace/Sampler/AlwaysOnSampler.cs)
* [ParentBasedSampler](../../../src/OpenTelemetry/Trace/Sampler/ParentBasedSampler.cs)
* [TraceIdRatioBasedSampler](../../../src/OpenTelemetry/Trace/Sampler/TraceIdRatioBasedSampler.cs)
Custom samplers can be implemented to cover more scenarios:
@ -338,7 +338,7 @@ class MySampler : Sampler
{
public override SamplingResult ShouldSample(in SamplingParameters samplingParameters)
{
return new SamplingResult(SamplingDecision.RecordAndSampled);
return new SamplingResult(SamplingDecision.RecordAndSample);
}
}
```

View File

@ -1,4 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<NoWarn>$(NoWarn);CA2000;CA1812;CA1510</NoWarn>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="$(RepoRoot)\src\OpenTelemetry\OpenTelemetry.csproj" />
</ItemGroup>

View File

@ -30,30 +30,30 @@ in the console for your application (ex `http://localhost:5154`). You should see
the trace output from the console.
```text
Activity.TraceId: c1572aa14ee9c0ac037dbdc3e91e5dd7
Activity.SpanId: 45406137f33cc279
Activity.TraceId: c28f7b480d5c7dfc30cfbd80ad29028d
Activity.SpanId: 27e478bbf9fdec10
Activity.TraceFlags: Recorded
Activity.ActivitySourceName: OpenTelemetry.Instrumentation.AspNetCore
Activity.DisplayName: /
Activity.ActivitySourceName: Microsoft.AspNetCore
Activity.DisplayName: GET /
Activity.Kind: Server
Activity.StartTime: 2023-01-13T19:38:11.5417593Z
Activity.Duration: 00:00:00.0167407
Activity.StartTime: 2024-07-04T13:03:37.3318740Z
Activity.Duration: 00:00:00.3693734
Activity.Tags:
net.host.name: localhost
net.host.port: 5154
http.method: GET
http.scheme: http
http.target: /
http.url: http://localhost:5154/
http.flavor: 1.1
http.user_agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36 Edg/108.0.1462.76
http.status_code: 200
server.address: localhost
server.port: 5154
http.request.method: GET
url.scheme: https
url.path: /
network.protocol.version: 2
user_agent.original: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36
http.route: /
http.response.status_code: 200
Resource associated with Activity:
service.name: getting-started-aspnetcore
service.instance.id: 32c9371c-ed9d-474c-a698-b169e87a5577
service.instance.id: a388466b-4969-4bb0-ad96-8f39527fa66b
telemetry.sdk.name: opentelemetry
telemetry.sdk.language: dotnet
telemetry.sdk.version: 1.5.1
telemetry.sdk.version: 1.9.0
```
Congratulations! You are now collecting traces using OpenTelemetry.

View File

@ -5,7 +5,9 @@ using System.Diagnostics;
using OpenTelemetry;
using OpenTelemetry.Trace;
public class Program
namespace GettingStartedConsole;
internal static class Program
{
private static readonly ActivitySource MyActivitySource = new("MyCompany.MyProduct.MyLibrary");
@ -18,9 +20,10 @@ public class Program
using (var activity = MyActivitySource.StartActivity("SayHello"))
{
int[] intArray = [1, 2, 3];
activity?.SetTag("foo", 1);
activity?.SetTag("bar", "Hello, World!");
activity?.SetTag("baz", new int[] { 1, 2, 3 });
activity?.SetTag("baz", intArray);
activity?.SetStatus(ActivityStatusCode.Ok);
}

View File

@ -11,7 +11,7 @@ using OpenTelemetry.Trace;
namespace GettingStartedJaeger;
public class Program
internal static class Program
{
private static readonly ActivitySource MyActivitySource = new("OpenTelemetry.Demo.Jaeger");
@ -33,13 +33,13 @@ public class Program
{
using (var slow = MyActivitySource.StartActivity("SomethingSlow"))
{
await client.GetStringAsync("https://httpstat.us/200?sleep=1000");
await client.GetStringAsync("https://httpstat.us/200?sleep=1000");
await client.GetStringAsync(new Uri("https://httpstat.us/200?sleep=1000")).ConfigureAwait(false);
await client.GetStringAsync(new Uri("https://httpstat.us/200?sleep=1000")).ConfigureAwait(false);
}
using (var fast = MyActivitySource.StartActivity("SomethingFast"))
{
await client.GetStringAsync("https://httpstat.us/301");
await client.GetStringAsync(new Uri("https://httpstat.us/301")).ConfigureAwait(false);
}
}
}

Some files were not shown because too many files have changed in this diff Show More