{"id":18767802,"url":"https://github.com/lightstep/lightstep-tracer-csharp","last_synced_at":"2025-04-13T06:32:34.646Z","repository":{"id":44205961,"uuid":"145035130","full_name":"lightstep/lightstep-tracer-csharp","owner":"lightstep","description":"The Lightstep distributed tracing library for C#","archived":false,"fork":false,"pushed_at":"2023-09-15T21:09:12.000Z","size":253,"stargazers_count":15,"open_issues_count":3,"forks_count":5,"subscribers_count":71,"default_branch":"master","last_synced_at":"2025-03-26T23:21:56.791Z","etag":null,"topics":["opentracing"],"latest_commit_sha":null,"homepage":"https://lightstep.com","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lightstep.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-08-16T20:17:32.000Z","updated_at":"2022-11-03T03:21:04.000Z","dependencies_parsed_at":"2023-01-24T14:30:11.271Z","dependency_job_id":null,"html_url":"https://github.com/lightstep/lightstep-tracer-csharp","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Flightstep-tracer-csharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Flightstep-tracer-csharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Flightstep-tracer-csharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Flightstep-tracer-csharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lightstep","download_url":"https://codeload.github.com/lightstep/lightstep-tracer-csharp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248674678,"owners_count":21143760,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["opentracing"],"created_at":"2024-11-07T19:08:42.171Z","updated_at":"2025-04-13T06:32:29.592Z","avatar_url":"https://github.com/lightstep.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lightstep-tracer-csharp\n\n\u003e ❗ **This instrumentation is no longer recommended**. Please review [documentation on setting up and configuring the OpenTelemetry client for .NET](https://github.com/open-telemetry/opentelemetry-dotnet) for more information on migrating.\n\nThe LightStep distributed tracing library for C#\n\n[![NuGet](https://img.shields.io/nuget/v/LightStep.svg)](https://www.nuget.org/packages/LightStep) [![CircleCI](https://circleci.com/gh/lightstep/lightstep-tracer-csharp.svg?style=svg)](https://circleci.com/gh/lightstep/lightstep-tracer-csharp) [![codecov](https://codecov.io/gh/lightstep/lightstep-tracer-csharp/branch/master/graph/badge.svg)](https://codecov.io/gh/lightstep/lightstep-tracer-csharp)\n\n# Installation\nInstall the package via NuGet into your solution, or use `Install-Package LightStep` / `dotnet add package LightStep`.\n\n# Basic Usage\nIt's recommended to initialize the tracer once at the beginning of your application and assign it as the global tracer, as follows:\n```c#\nvar tracerOptions = new Options();\nvar tracer = new Tracer(tracerOptions);\nGlobalTracer.Register(tracer);\n```\n\nOnce you've initialized a tracer, you can begin to create and emit spans.\n\nPlease refer to the [OpenTracing C# documentation](https://github.com/opentracing/opentracing-csharp) for information on how to create spans.\n\nYou can also refer to the `examples` folder for sample code and projects. \n\n# Advanced Usage\n\nThere's several options that can be adjusted when instantiating a `LightStepTracer`.\n\n## `Options`\n| Method | Description |\n| -------- | ----------- |\n| WithTags(IDictionary\u003cstring, object\u003e)   | Default tags to apply to all spans created by the tracer.  |\n| WithReportPeriod(TimeSpan)  | How frequently the Tracer should batch and send Spans to LightStep (5s default) |\n| WithReportTimeout(TimeSpan)  | Timeout for sending spans to the Satellite (30s default)  |\n| WithToken(string) | The LightStep Project Access Token |\n| WithSatellite(SatelliteOptions) | A SatelliteOptions object that specifies the host, port, and if we should use HTTPS |\n| WithHttp2(bool) | If this is true, we use HTTP/2 to communicate with the Satellite. We reccomend you enable this option if you're on a modern version of .NET (4.6.1+ or .NET Core) |\n| WithAutomaticReporting(bool) | If false, disables the automatic flushing of buffered spans. |\n| WithMaxBufferedSpans(int) | The maximum amount of spans to record in a single buffer. |\n| WithTransport(enum) | Which transport to use when sending spans to the Satellite. |\n\n## `SatelliteOptions`\n| Property | Description |\n| -------- | ----------- |\n| SatelliteHost | The hostname of a Satelite (i.e., `collector.lightstep.com`)\n| SatellitePort | The port number where the Satellite is listening for HTTP traffic (defaults to 443)\n| UsePlaintext | Should we use HTTP or HTTPS traffic? (Defaults to HTTPS)\n\nThe C# Tracer will prefer TLS 1.2 when available on all .NET Runtime versions, but should fall back to TLS 1.1 or 1.0 in that order.\n\nThe following is an example of overriding the LightStep Component Name and adding a new custom tag for all spans -\n\n```csharp\nvar satelliteOptions = new SatelliteOptions(\"satellite.mydomain.com\");\nvar overrideTags = new Dictionary\u003cstring, object\u003e \n{\n    {LightStepConstants.ComponentNameKey, \"test_component\"},\n    {\"my_tag\", \"foobar\"}\n};\nvar tracerOptions = new Options(\"TEST_TOKEN\").WithSatellite(satelliteOptions).WithTags(overrideTags);\nvar tracer = new Tracer(tracerOptions);\n```\n\n## Logging\nThis tracer uses [LibLog](https://github.com/damianh/LibLog), a transparent logging abstraction that provides built-in support for NLog, Log4Net, Serilog, and Loupe.\nIf you use a logging provider that isn't identified by LibLog, see [this gist](https://gist.github.com/damianh/fa529b8346a83f7f49a9) on how to implement a custom logging provider.\n\n## Integration Notes\nYou may notice that there's a lot of overloads for creating a `Tracer`! You have the flexibility to override and re-implement much of this library. In 0.10.0+, the `ILightStepHttpClient` interface has\nbeen decoupled from report translation, allowing you control over the exact mechanism by which the tracer reports spans to Lightstep. You can reference [this issue](https://github.com/lightstep/lightstep-tracer-csharp/issues/92)\nfor more information and a discussion about why you might want to do this.\n\nFor most users, sticking with the defaults is fine. You should also look at the `Tracer(Options, IPropagator, ILightStepHttpClient)` ctor for custom integration - the span recorder and span translator overloads are not terribly interesting.\nCreating and managing propagators allows you to either select a built-in propagator (textmap, B3, etc.), create a propagator 'stack' (if you potentially have multiple input or output trace context formats), or write your own propagator.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightstep%2Flightstep-tracer-csharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flightstep%2Flightstep-tracer-csharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightstep%2Flightstep-tracer-csharp/lists"}