{"id":13430458,"url":"https://github.com/opentracing/opentracing-csharp","last_synced_at":"2026-01-14T05:47:08.368Z","repository":{"id":40775614,"uuid":"60211703","full_name":"opentracing/opentracing-csharp","owner":"opentracing","description":"OpenTracing API for C# (.NET). 🛑 This library is DEPRECATED! https://github.com/opentracing/specification/issues/163","archived":true,"fork":false,"pushed_at":"2019-11-21T11:34:54.000Z","size":747,"stargazers_count":515,"open_issues_count":17,"forks_count":73,"subscribers_count":40,"default_branch":"master","last_synced_at":"2025-11-27T14:29:00.339Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://opentracing.io","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opentracing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-01T21:22:52.000Z","updated_at":"2025-11-25T09:10:23.000Z","dependencies_parsed_at":"2022-09-09T15:01:08.702Z","dependency_job_id":null,"html_url":"https://github.com/opentracing/opentracing-csharp","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/opentracing/opentracing-csharp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentracing%2Fopentracing-csharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentracing%2Fopentracing-csharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentracing%2Fopentracing-csharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentracing%2Fopentracing-csharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opentracing","download_url":"https://codeload.github.com/opentracing/opentracing-csharp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opentracing%2Fopentracing-csharp/sbom","scorecard":{"id":710648,"data":{"date":"2025-08-11","repo":{"name":"github.com/opentracing/opentracing-csharp","commit":"461c6edd7b4209fe353eea7b927dd7046986e2b8"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":6,"reason":"Found 18/30 approved changesets -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact 0.12.1 not signed: https://api.github.com/repos/opentracing/opentracing-csharp/releases/20248443","Warn: release artifact 0.12.0 not signed: https://api.github.com/repos/opentracing/opentracing-csharp/releases/11159811","Warn: release artifact 0.12.0-rc1 not signed: https://api.github.com/repos/opentracing/opentracing-csharp/releases/11082246","Warn: release artifact 0.10.0 not signed: https://api.github.com/repos/opentracing/opentracing-csharp/releases/7233876","Warn: release artifact 0.12.1 does not have provenance: https://api.github.com/repos/opentracing/opentracing-csharp/releases/20248443","Warn: release artifact 0.12.0 does not have provenance: https://api.github.com/repos/opentracing/opentracing-csharp/releases/11159811","Warn: release artifact 0.12.0-rc1 does not have provenance: https://api.github.com/repos/opentracing/opentracing-csharp/releases/11082246","Warn: release artifact 0.10.0 does not have provenance: https://api.github.com/repos/opentracing/opentracing-csharp/releases/7233876"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 24 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T08:07:51.824Z","repository_id":40775614,"created_at":"2025-08-22T08:07:51.824Z","updated_at":"2025-08-22T08:07:51.824Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28411402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T02:00:53.942Z","updated_at":"2026-01-14T05:47:08.354Z","avatar_url":"https://github.com/opentracing.png","language":"C#","funding_links":[],"categories":["Frameworks, Libraries and Tools","C#","C\\#","框架, 库和工具","Distributed Computing"],"sub_categories":["Distributed Computing","分布式计算"],"readme":"[![Gitter chat][gitter-img]][gitter] [![Build Status][travis-img]][travis] [![Build status][appveyor-img]][appveyor] [![NuGet][nuget-img]][nuget]\n\n# OpenTracing API for .NET\n\nThis solution includes the .NET platform API for OpenTracing.\n\n## Required Reading\n\nIn order to understand the .NET platform API, one must first be familiar with the\n[OpenTracing project](http://opentracing.io) and\n[terminology](http://opentracing.io/documentation/pages/spec) more specifically.\n\n## Installation\n\nInstall the [NuGet package](https://www.nuget.org/packages/OpenTracing/):\n\n    Install-Package OpenTracing\n\n## Usage\n\n### Initialization\n\nInitialization is OpenTracing-implementation-specific. Generally speaking, the pattern is to initialize a `ITracer` once for the entire process and to use that `ITracer` for the remainder of the process lifetime. It is a best practice to _set_ the [GlobalTracer](https://github.com/opentracing/opentracing-csharp/blob/master/src/OpenTracing/Util/GlobalTracer.cs), even if also making use of cleaner, more modern dependency injection. (See the next section below for rationale)\n\n### Accessing the `ITracer`\n\nWhere possible, use some form of dependency injection (of which there are many) to access the `ITracer` instance. For vanilla application code, this is often reasonable and cleaner for all of the usual DI reasons.\n\nThat said, instrumentation for packages that are themselves statically configured (e.g., ODBC drivers) may be unable to make use of said DI mechanisms for `ITracer` access, and as such they should fall back on [GlobalTracer](https://github.com/opentracing/opentracing-csharp/blob/master/src/OpenTracing/Util/GlobalTracer.cs). By and large, OpenTracing instrumentation should always allow the programmer to specify a `ITracer` instance to use for instrumentation, though the [GlobalTracer](https://github.com/opentracing/opentracing-csharp/blob/master/src/OpenTracing/Util/GlobalTracer.cs) is a reasonable fallback or default value.\n\n### Scopes and within-process propagation\n\nFor any thread, at most one `ISpan` may be \"active\". Of course, there may be many other spans involved with the thread which are (a) started, (b) not finished, and yet (c) not \"active\": perhaps they are waiting for I/O, blocked on a child span, or otherwise off of the critical path.\n\nIt's inconvenient to pass an active `ISpan` from function to function manually, so OpenTracing requires that every `ITracer` contains a `IScopeManager` that grants access to the active `ISpan` through a `IScope`. Any `ISpan` may be transferred to another callback or thread, but not `IScope`; more on this below.\n\n#### Accessing the active Span through `IScope`\n\nAccess to the active span is straightforward:\n\n```cs\nOpenTracing.ITracer tracer = ...;\n...\nIScope scope = tracer.ScopeManager.Active;\nif (scope != null) {\n    scope.Span.Log(\"...\");\n}\n```\n\n### Starting a new Span\n\nThe common case starts a `IScope` that's automatically registered for intra-process propagation via `IScopeManager`.\n\nNote that `StartActive(finishSpanOnDispose: true)` finishes the span on `IScope.Dispose()`.\n\n```cs\nOpenTracing.ITracer tracer = ...;\n...\nusing (IScope scope = tracer.BuildSpan(\"someWork\").StartActive(finishSpanOnDispose: true))\n{\n    try\n    {\n        // Do things.\n    }\n    catch (Exception ex)\n    {\n        Tags.Error.Set(scope.Span, true);\n    }\n\n    // No need to call scope.Span.Finish() as we've set finishSpanOnDispose:true in StartActive.\n}\n```\n\n**If there is a `IScope`, it will act as the parent to any newly started `ISpan`** unless\nthe programmer invokes `IgnoreActiveSpan()` at `BuildSpan()` time or specified parent context explicitly:\n\n```cs\nOpenTracing.ITracer tracer = ...;\n...\nIScope scope = tracer.BuildSpan(\"someWork\").IgnoreActiveSpan().StartActive(finishSpanOnDispose: true);\n```\n\n### Using scopes with `async/await`\n\nOpenTracing contains an `IScopeManager` implementation that uses `AsyncLocal` to flow spans with the execution. It is therefore possible to use scopes and spans with `async/await`:\n\n```cs\nOpenTracing.ITracer tracer = ...;\n...\nusing (IScope parentScope = tracer.BuildSpan(\"Parent\").StartActive(finishSpanOnDispose: true))\n{\n    await SomeAsynchronousWork();\n\n    // It's still possible to access the current span\n    parentScope.Span.Log(...);\n\n    // The child scope will automatically use parentScope as its parent.\n    using (IScope childScope = tracer.BuildSpan(\"Child\").StartActive(finishSpanOnDispose: true))\n    {\n        childScope.Span.Log(...);\n\n        await SomeMoreAsynchronousWork();\n\n        childScope.Span.Log(...);\n    }\n}\n\npublic async Task SomeAsynchronousWork()\n{\n    // use ITracer.ActiveSpan to access the current span - which will be \"parentScope.Span\".\n    tracer.ActiveSpan.Log(...);\n\n    await SomeExternalCall();\n}\n\npublic async Task SomeMoreAsynchronousWork()\n{\n    // The active span in this case will be \"childScope.Span\".\n    tracer.ActiveSpan.Log(...);\n\n    await SomeExternalCall();\n}\n```\n\n## Contributing\n\nIf you would like to contribute code you can do so through GitHub by forking the repository and sending a pull request.\n\nBy contributing your code, you agree to license your contribution under the terms of the APLv2: https://github.com/opentracing/opentracing-csharp/blob/master/LICENSE\n\n## License\n\nAll files are released with the Apache 2.0 license.\n\n  [gitter-img]: http://img.shields.io/badge/gitter-join%20chat%20%E2%86%92-brightgreen.svg\n  [gitter]: https://gitter.im/opentracing/public\n  [travis-img]: https://travis-ci.org/opentracing/opentracing-csharp.svg?branch=master\n  [travis]: https://travis-ci.org/opentracing/opentracing-csharp\n  [appveyor-img]: https://ci.appveyor.com/api/projects/status/1ku5e2er93oa7vji/branch/master?svg=true\n  [appveyor]: https://ci.appveyor.com/project/opentracing/opentracing-csharp\n  [nuget-img]: https://img.shields.io/nuget/v/OpenTracing.svg\n  [nuget]: https://www.nuget.org/packages/OpenTracing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentracing%2Fopentracing-csharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopentracing%2Fopentracing-csharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopentracing%2Fopentracing-csharp/lists"}