Skip to content

Commit

Permalink
Small doc fixes (#1800)
Browse files Browse the repository at this point in the history
* Small doc fixes

* line

* mardownlint fix

* review comments
  • Loading branch information
cijothomas authored Feb 5, 2021
1 parent 904b7dd commit 6c742e9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 5 deletions.
4 changes: 4 additions & 0 deletions docs/trace/extending-the-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ not covered by the built-in exporters:
does not implement any retry logic.
* Exporters should avoid generating telemetry and causing live-loop, this can be
done via `OpenTelemetry.SuppressInstrumentationScope`.
* Exporters should use `Activity.TagObjects` collection instead of
`Activity.Tags` to obtain the full set of attributes (tags).
* Exporters should use `ParentProvider.GetResource()` to get the `Resource`
associated with the provider.

```csharp
class MyExporter : BaseExporter<Activity>
Expand Down
19 changes: 14 additions & 5 deletions src/OpenTelemetry.Api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,8 @@ child-operations.

### Logging API

OpenTelemetry does not introduce its own API for logging. Instead it recommends
to integrate with existing well-known logging libraries for each language. For
.NET, the logging API is simply the [Microsoft.Extensions.Logging
OpenTelemetry .NET does not introduce its own API for logging. Instead it
provides an integration with the well known [Microsoft.Extensions.Logging
API](https://docs.microsoft.com/dotnet/core/extensions/logging).

### Metrics API
Expand Down Expand Up @@ -114,6 +113,7 @@ required only for the following scenarios:
users. Refer to the [comparison of Activity API and OpenTelemetry Tracing
API](https://github.com/open-telemetry/opentelemetry-dotnet/issues/947) if
you want to compare the differences.

2. Your library performs communication with other libraries/components, and want
to access
[Propagators](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/context/api-propagators.md),
Expand All @@ -126,6 +126,10 @@ required only for the following scenarios:
is not built on top of these, and want to leverage propagators, follow the
[Context propagation](#context-propagation) section.

3. You want to leverage
[Baggage](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/baggage/api.md)
API.

## Instrumenting a library/application with .NET Activity API

### Basic usage
Expand All @@ -136,13 +140,13 @@ documented fully in the TBD(dotnet activity user guide link), but is described
here as well.

1. Install the `System.Diagnostics.DiagnosticSource` package version
`5.0.0` or above to your application or library.
`5.0.1` or above to your application or library.

```xml
<ItemGroup>
<PackageReference
Include="System.Diagnostics.DiagnosticSource"
Version="5.0.0"
Version="5.0.1"
/>
</ItemGroup>
```
Expand Down Expand Up @@ -190,6 +194,11 @@ here as well.
}
```

The recommended way to [set span
attributes](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-attributes)
in `Activity` class is by using `SetTag()`. OpenTelemetry users should
not use other methods like `AddTag`, `SetCustomProperty` on `Activity`.

5. Perform application/library logic.

6. Stop the activity when done.
Expand Down
16 changes: 16 additions & 0 deletions src/OpenTelemetry.Exporter.OpenTelemetryProtocol/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,22 @@ See the
[`TestOtlpExporter.cs`](../../examples/Console/TestOtlpExporter.cs)
for an example of how to use the exporter.

## Special case when using insecure channel

If your application is
[.NET Standard 2.1](https://docs.microsoft.com/dotnet/standard/net-standard) or
above, and you are using an insecure (http) endpoint, the following switch must
be set before adding `OtlpExporter`.

```csharp
AppContext.SetSwitch("System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport",
true);
```

See
[this](https://docs.microsoft.com/aspnet/core/grpc/troubleshoot#call-insecure-grpc-services-with-net-core-client)
for more information.

## References

* [OpenTelemetry
Expand Down

0 comments on commit 6c742e9

Please sign in to comment.