Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"globaltool",
"icerpc",
"Idempotency",
"jaegertracing",
"localizable",
"Memberwise",
"meteo",
Expand Down
2 changes: 1 addition & 1 deletion examples/protobuf/Telemetry/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="IceRpc.Protobuf.Tools" Version="$(IceRpcVersion)" PrivateAssets="All" />
<PackageReference Include="IceRpc.Protobuf" Version="$(IceRpcVersion)" />
<PackageReference Include="IceRpc.Telemetry" Version="$(IceRpcVersion)" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" Version="1.14.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.15.3" />
<PackageReference Include="StyleCop.Analyzers" Version="$(StyleCopAnalyzersVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
4 changes: 2 additions & 2 deletions examples/protobuf/Telemetry/Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
using var activitySource = new ActivitySource("IceRpc");

// Configure OpenTelemetry trace provider to subscribe to the activity source used by the IceRpc telemetry interceptor,
// and to export the traces to the Zipkin service.
// and to export the traces using the OpenTelemetry Protocol (OTLP).
using TracerProvider? tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddSource(activitySource.Name)
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("Greeter Client"))
.AddZipkinExporter()
.AddOtlpExporter()
.Build();

// Load the test root CA certificate in order to connect to the server that uses a test server certificate.
Expand Down
19 changes: 11 additions & 8 deletions examples/protobuf/Telemetry/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
# Telemetry

This application illustrates how to use the IceRPC telemetry interceptor and middleware, and how they can be integrated
with OpenTelemetry to export traces to Zipkin. The application also shows how the trace context is propagated from the
client to the server, by just configuring the IceRPC telemetry interceptor and middleware.
with OpenTelemetry to export traces over the OpenTelemetry Protocol (OTLP). The application also shows how the trace
context is propagated from the client to the server, by just configuring the IceRPC telemetry interceptor and
middleware.

You can build the client and server applications with:

``` shell
dotnet build
```

First start the Zipkin service as documented in the Zipkin quick start guide:
The example sends traces to an OTLP endpoint at `http://localhost:4317` (the default for `AddOtlpExporter`). Any
OTLP-compatible collector or backend works; the simplest option is the Jaeger v2 single-binary container, which
natively accepts OTLP and provides a web UI:

- [Zipkin quick-start](https://zipkin.io/pages/quickstart.html)
```shell
docker run --rm --name jaeger -p 4317:4317 -p 16686:16686 jaegertracing/jaeger:2.17.0
```

In a separate terminal start the Greeter Server program:

Expand All @@ -28,8 +33,6 @@ cd Client
dotnet run
```

The trace information should now be available in the Zipkin local service:

- <http://localhost:9411/zipkin>
The trace information should now be available in the Jaeger UI:

![Zipkin](./zipkin.png)
- <http://localhost:16686>
4 changes: 2 additions & 2 deletions examples/protobuf/Telemetry/Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
using var activitySource = new ActivitySource("IceRpc");

// Configure OpenTelemetry trace provider to subscribe to the activity source used by the IceRPC telemetry middleware,
// and to export the traces to the Zipkin service.
// and to export the traces using the OpenTelemetry Protocol (OTLP).
using TracerProvider? tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddSource(activitySource.Name)
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("Greeter Server"))
.AddZipkinExporter()
.AddOtlpExporter()
.Build();

// The default transport (QUIC) requires a server certificate. We use a test certificate here.
Expand Down
2 changes: 1 addition & 1 deletion examples/protobuf/Telemetry/Server/Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageReference Include="IceRpc.Protobuf.Tools" Version="$(IceRpcVersion)" PrivateAssets="All" />
<PackageReference Include="IceRpc.Protobuf" Version="$(IceRpcVersion)" />
<PackageReference Include="IceRpc.Telemetry" Version="$(IceRpcVersion)" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" Version="1.14.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.15.3" />
<PackageReference Include="StyleCop.Analyzers" Version="$(StyleCopAnalyzersVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Binary file removed examples/protobuf/Telemetry/zipkin.png
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/slice/Telemetry/Client/Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="IceRpc.Slice.Tools" Version="$(IceRpcVersion)" PrivateAssets="All" />
<PackageReference Include="IceRpc.Slice" Version="$(IceRpcVersion)" />
<PackageReference Include="IceRpc.Telemetry" Version="$(IceRpcVersion)" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" Version="1.14.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.15.3" />
<PackageReference Include="StyleCop.Analyzers" Version="$(StyleCopAnalyzersVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
4 changes: 2 additions & 2 deletions examples/slice/Telemetry/Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
using var activitySource = new ActivitySource("IceRpc");

// Configure OpenTelemetry trace provider to subscribe to the activity source used by the IceRpc telemetry interceptor,
// and to export the traces to the Zipkin service.
// and to export the traces using the OpenTelemetry Protocol (OTLP).
using TracerProvider? tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddSource(activitySource.Name)
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("Greeter Client"))
.AddZipkinExporter()
.AddOtlpExporter()
.Build();

// Load the test root CA certificate in order to connect to the server that uses a test server certificate.
Expand Down
19 changes: 11 additions & 8 deletions examples/slice/Telemetry/README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
# Telemetry

This application illustrates how to use the IceRPC telemetry interceptor and middleware, and how they can be integrated
with OpenTelemetry to export traces to Zipkin. The application also shows how the trace context is propagated from the
client to the server, by just configuring the IceRPC telemetry interceptor and middleware.
with OpenTelemetry to export traces over the OpenTelemetry Protocol (OTLP). The application also shows how the trace
context is propagated from the client to the server, by just configuring the IceRPC telemetry interceptor and
middleware.

You can build the client and server applications with:

``` shell
dotnet build
```

First start the Zipkin service as documented in the Zipkin quick start guide:
The example sends traces to an OTLP endpoint at `http://localhost:4317` (the default for `AddOtlpExporter`). Any
OTLP-compatible collector or backend works; the simplest option is the Jaeger v2 single-binary container, which
natively accepts OTLP and provides a web UI:

- [Zipkin quick-start](https://zipkin.io/pages/quickstart.html)
```shell
docker run --rm --name jaeger -p 4317:4317 -p 16686:16686 jaegertracing/jaeger:2.17.0
```

In a separate terminal start the Greeter Server program:

Expand All @@ -28,8 +33,6 @@ cd Client
dotnet run
```

The trace information should now be available in the Zipkin local service:

- <http://localhost:9411/zipkin>
The trace information should now be available in the Jaeger UI:

![Zipkin](./zipkin.png)
- <http://localhost:16686>
4 changes: 2 additions & 2 deletions examples/slice/Telemetry/Server/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
using var activitySource = new ActivitySource("IceRpc");

// Configure OpenTelemetry trace provider to subscribe to the activity source used by the IceRPC telemetry middleware,
// and to export the traces to the Zipkin service.
// and to export the traces using the OpenTelemetry Protocol (OTLP).
using TracerProvider? tracerProvider = Sdk.CreateTracerProviderBuilder()
.AddSource(activitySource.Name)
.SetResourceBuilder(ResourceBuilder.CreateDefault().AddService("Greeter Server"))
.AddZipkinExporter()
.AddOtlpExporter()
.Build();

// The default transport (QUIC) requires a server certificate. We use a test certificate here.
Expand Down
2 changes: 1 addition & 1 deletion examples/slice/Telemetry/Server/Server.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PackageReference Include="IceRpc.Slice.Tools" Version="$(IceRpcVersion)" PrivateAssets="All" />
<PackageReference Include="IceRpc.Slice" Version="$(IceRpcVersion)" />
<PackageReference Include="IceRpc.Telemetry" Version="$(IceRpcVersion)" />
<PackageReference Include="OpenTelemetry.Exporter.Zipkin" Version="1.14.0" />
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.15.3" />
<PackageReference Include="StyleCop.Analyzers" Version="$(StyleCopAnalyzersVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
Binary file removed examples/slice/Telemetry/zipkin.png
Binary file not shown.
Loading