Skip to content

Commit 8b7c713

Browse files
[nightly] Update YARP + OpenTelemetry support (#6331)
Co-authored-by: Logan Bussell <loganbussell@microsoft.com>
1 parent 7f9ed79 commit 8b7c713

36 files changed

Lines changed: 2122 additions & 17 deletions

File tree

.portal-docs/docker-hub/README.yarp.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ The [.NET Docker samples](https://github.com/dotnet/dotnet-docker/blob/main/samp
1919

2020
You can run this image to launch a YARP instance.
2121

22+
## Configuration
23+
2224
YARP expects the config file to be in `/etc/yarp.config`, and listens by default on port 5000.
2325

2426
Example of configuration:
@@ -71,6 +73,18 @@ The [YARP GitHub repository](https://github.com/dotnet/yarp/tree/main/samples/)
7173

7274
For more details, see the [documentation](https://aka.ms/YarpDocumentation) for how to configure the image and documentation for the reverse proxy configuration.
7375

76+
## OpenTelemetry support
77+
78+
This image supports OpenTelemetry. It can be configured by passing environment variables to the container:
79+
80+
```bash
81+
docker run --rm -v $(pwd)/my-config.config:/etc/yarp.config -p 5000:5000 -e OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp-endpoint.internal:4317 mcr.microsoft.com/dotnet/yarp:latest
82+
```
83+
84+
See the [OTLP Exporter Configuration](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/) for all supported environment variables.
85+
86+
You can skip HTTPS validation for the OTLP endpoint only by passing the environment variable `YARP_UNSAFE_OLTP_CERT_ACCEPT_ANY_SERVER_CERTIFICATE`.
87+
7488
# Related Repositories
7589

7690
.NET:

.portal-docs/mar/README.yarp.portal.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ The [.NET Docker samples](https://github.com/dotnet/dotnet-docker/blob/main/samp
3737

3838
You can run this image to launch a YARP instance.
3939

40+
### Configuration
41+
4042
YARP expects the config file to be in `/etc/yarp.config`, and listens by default on port 5000.
4143

4244
Example of configuration:
@@ -89,6 +91,18 @@ The [YARP GitHub repository](https://github.com/dotnet/yarp/tree/main/samples/)
8991

9092
For more details, see the [documentation](https://aka.ms/YarpDocumentation) for how to configure the image and documentation for the reverse proxy configuration.
9193

94+
### OpenTelemetry support
95+
96+
This image supports OpenTelemetry. It can be configured by passing environment variables to the container:
97+
98+
```bash
99+
docker run --rm -v $(pwd)/my-config.config:/etc/yarp.config -p 5000:5000 -e OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp-endpoint.internal:4317 mcr.microsoft.com/dotnet/yarp:latest
100+
```
101+
102+
See the [OTLP Exporter Configuration](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/) for all supported environment variables.
103+
104+
You can skip HTTPS validation for the OTLP endpoint only by passing the environment variable `YARP_UNSAFE_OLTP_CERT_ACCEPT_ANY_SERVER_CERTIFICATE`.
105+
92106
## Support
93107

94108
### Lifecycle

README.yarp.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ The [.NET Docker samples](https://github.com/dotnet/dotnet-docker/blob/main/samp
2121

2222
You can run this image to launch a YARP instance.
2323

24+
### Configuration
25+
2426
YARP expects the config file to be in `/etc/yarp.config`, and listens by default on port 5000.
2527

2628
Example of configuration:
@@ -73,6 +75,18 @@ The [YARP GitHub repository](https://github.com/dotnet/yarp/tree/main/samples/)
7375

7476
For more details, see the [documentation](https://aka.ms/YarpDocumentation) for how to configure the image and documentation for the reverse proxy configuration.
7577

78+
### OpenTelemetry support
79+
80+
This image supports OpenTelemetry. It can be configured by passing environment variables to the container:
81+
82+
```bash
83+
docker run --rm -v $(pwd)/my-config.config:/etc/yarp.config -p 5000:5000 -e OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp-endpoint.internal:4317 mcr.microsoft.com/dotnet/yarp:latest
84+
```
85+
86+
See the [OTLP Exporter Configuration](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/) for all supported environment variables.
87+
88+
You can skip HTTPS validation for the OTLP endpoint only by passing the environment variable `YARP_UNSAFE_OLTP_CERT_ACCEPT_ANY_SERVER_CERTIFICATE`.
89+
7690
## Related Repositories
7791

7892
.NET:
@@ -97,13 +111,13 @@ For more details, see the [documentation](https://aka.ms/YarpDocumentation) for
97111

98112
Tags | Dockerfile | OS Version
99113
-----------| -------------| -------------
100-
2.3.0-preview.1, 2.3-preview, 2-preview, latest | [Dockerfile](src/yarp/2.3/azurelinux-distroless/amd64/Dockerfile) | Azure Linux 3.0
114+
2.3.0-preview.2, 2.3-preview, 2-preview, latest | [Dockerfile](src/yarp/2.3/azurelinux-distroless/amd64/Dockerfile) | Azure Linux 3.0
101115

102116
### Linux arm64 Tags
103117

104118
Tags | Dockerfile | OS Version
105119
-----------| -------------| -------------
106-
2.3.0-preview.1, 2.3-preview, 2-preview, latest | [Dockerfile](src/yarp/2.3/azurelinux-distroless/arm64v8/Dockerfile) | Azure Linux 3.0
120+
2.3.0-preview.2, 2.3-preview, 2-preview, latest | [Dockerfile](src/yarp/2.3/azurelinux-distroless/arm64v8/Dockerfile) | Azure Linux 3.0
107121
<!--End of generated tags-->
108122

109123
*Tags not listed in the table above are not supported. See the [Supported Tags Policy](https://github.com/dotnet/dotnet-docker/blob/main/documentation/supported-tags.md). See the [full list of tags](https://mcr.microsoft.com/v2/dotnet/nightly/yarp/tags/list) for all supported and unsupported tags.*

eng/readme-templates/Use.yarp.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
readme-host: Moniker of the site that will host the readme
55
}}You can run this image to launch a YARP instance.
66

7+
{{ARGS["top-header"]}}# Configuration
8+
79
YARP expects the config file to be in `/etc/yarp.config`, and listens by default on port 5000.
810

911
Example of configuration:
@@ -54,4 +56,16 @@ This example will proxy every requests from `http://localhost:5000/aspnetapp` to
5456

5557
The [YARP GitHub repository](https://github.com/dotnet/yarp/tree/main/samples/) contains more configuration samples.
5658

57-
For more details, see the [documentation](https://aka.ms/YarpDocumentation) for how to configure the image and documentation for the reverse proxy configuration.
59+
For more details, see the [documentation](https://aka.ms/YarpDocumentation) for how to configure the image and documentation for the reverse proxy configuration.
60+
61+
{{ARGS["top-header"]}}# OpenTelemetry support
62+
63+
This image supports OpenTelemetry. It can be configured by passing environment variables to the container:
64+
65+
```bash
66+
docker run --rm -v $(pwd)/my-config.config:/etc/yarp.config -p 5000:5000 -e OTEL_EXPORTER_OTLP_ENDPOINT=https://otlp-endpoint.internal:4317 mcr.microsoft.com/dotnet/yarp:latest
67+
```
68+
69+
See the [OTLP Exporter Configuration](https://opentelemetry.io/docs/languages/sdk-configuration/otlp-exporter/) for all supported environment variables.
70+
71+
You can skip HTTPS validation for the OTLP endpoint only by passing the environment variable `YARP_UNSAFE_OLTP_CERT_ACCEPT_ANY_SERVER_CERTIFICATE`.

manifest.versions.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,13 @@
215215
"powershell|10.0|Linux|x64|sha": "ac4eb5cb83e130aa7cc9c856245635d3f4e624b8d4e12933f5cd534f02545e2f4c61b7f63bc899d7ad797a70ec5c2d7bca33e57ea6eb7da0a410808d3ad2cf94",
216216
"powershell|10.0|Windows|x64|sha": "6f4518a04d9fd3ade4c7fa76574b29f6abb7e8a37793fd2c14a123700dfd8fa69ff4a200287ac909942bd687209ead999f53fbb2727ae96200d669564e1935eb",
217217

218-
"yarp|2.3|build-version": "2.3.0-preview.1.25060.1",
219-
"yarp|2.3|product-version": "2.3.0-preview.1",
218+
"yarp|2.3|build-version": "3.0.0-preview.1.25171.2",
219+
"yarp|2.3|product-version": "2.3.0-preview.2",
220220
"yarp|2.3|fixed-tag": "$(yarp|2.3|product-version)",
221221
"yarp|2.3|minor-tag": "2.3-preview",
222222
"yarp|2|major-tag": "2-preview",
223-
"yarp|2.3|linux|x64|sha": "24bc79fb64105f7a910e3deb176abdd55ffda05e4885d66309d62912159cd153c5d140b5bfb05d84141282fd13e7f6559402c8c3046b3c6c4f2039b52ee1aa7b",
224-
"yarp|2.3|linux|arm64|sha": "5ade6d5e05328328f50137d5c796e45ff7018ec60b783ddf03ae5ff0fa7577bfd9458201ce22eb01709d2ff98e35bbf522e3075487e4ec859844ae10880079a2",
223+
"yarp|2.3|linux|x64|sha": "b7bcf3f7bb2feea5db4c51296000fdcab2a811349ea7466a056cc8eb40a78d588d853cbf7bdd10435f643667f999f0ee4697f34df063a1db8c5e11cf4d8b77b1",
224+
"yarp|2.3|linux|arm64|sha": "70ace0ebbe550b4d059ddf7582fcda3959d1c9d607f4da6ec91c0ff1ed4f340601a194f558f3346c18a1678327ea4ad8ad5e4df3fed4f3fedad2fdcfb76115f0",
225225
"yarp|2.3|base-url|main": "$(base-url|public|preview|nightly)",
226226
"yarp|2.3|base-url|nightly": "$(base-url|public|preview|nightly)",
227227
"yarp|2.3|dotnet-version": "9.0",

src/yarp/2.3/azurelinux-distroless/amd64/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ RUN tdnf install -y \
99
&& tdnf clean all
1010

1111
# Retrieve YARP
12-
RUN yarp_version=2.3.0-preview.1.25060.1 \
12+
RUN yarp_version=3.0.0-preview.1.25171.2 \
1313
&& curl -fSL --output yarp.zip https://ci.dot.net/public/reverse-proxy/$yarp_version/reverse-proxy-linux-x64.zip \
14-
&& yarp_sha512='24bc79fb64105f7a910e3deb176abdd55ffda05e4885d66309d62912159cd153c5d140b5bfb05d84141282fd13e7f6559402c8c3046b3c6c4f2039b52ee1aa7b' \
14+
&& yarp_sha512='b7bcf3f7bb2feea5db4c51296000fdcab2a811349ea7466a056cc8eb40a78d588d853cbf7bdd10435f643667f999f0ee4697f34df063a1db8c5e11cf4d8b77b1' \
1515
&& echo "$yarp_sha512 yarp.zip" | sha512sum -c - \
1616
&& mkdir -p /app \
1717
&& unzip yarp.zip -d /app \

src/yarp/2.3/azurelinux-distroless/arm64v8/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ RUN tdnf install -y \
99
&& tdnf clean all
1010

1111
# Retrieve YARP
12-
RUN yarp_version=2.3.0-preview.1.25060.1 \
12+
RUN yarp_version=3.0.0-preview.1.25171.2 \
1313
&& curl -fSL --output yarp.zip https://ci.dot.net/public/reverse-proxy/$yarp_version/reverse-proxy-linux-arm64.zip \
14-
&& yarp_sha512='5ade6d5e05328328f50137d5c796e45ff7018ec60b783ddf03ae5ff0fa7577bfd9458201ce22eb01709d2ff98e35bbf522e3075487e4ec859844ae10880079a2' \
14+
&& yarp_sha512='70ace0ebbe550b4d059ddf7582fcda3959d1c9d607f4da6ec91c0ff1ed4f340601a194f558f3346c18a1678327ea4ad8ad5e4df3fed4f3fedad2fdcfb76115f0' \
1515
&& echo "$yarp_sha512 yarp.zip" | sha512sum -c - \
1616
&& mkdir -p /app \
1717
&& unzip yarp.zip -d /app \

tests/Microsoft.DotNet.Docker.Tests/Microsoft.DotNet.Docker.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
</ItemGroup>
2222

2323
<ItemGroup>
24-
<Content Include="TestAppArtifacts/*">
24+
<Content Include="TestAppArtifacts/**/*">
2525
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
2626
</Content>
2727
</ItemGroup>
2828

2929
<ItemGroup>
30-
<Compile Remove="TestAppArtifacts/*.cs" />
30+
<Compile Remove="TestAppArtifacts/**/*.cs" />
3131
</ItemGroup>
3232

3333
</Project>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# directories
2+
**/bin/
3+
**/obj/
4+
**/out/
5+
6+
# files
7+
Dockerfile*
8+
**/*.md
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Learn about building .NET container images:
2+
# https://github.com/dotnet/dotnet-docker/blob/main/samples/README.md
3+
FROM mcr.microsoft.com/dotnet/sdk:9.0-azurelinux3.0 AS build
4+
WORKDIR /source
5+
6+
# Copy project file and restore as distinct layers
7+
COPY --link OtlpTestListener/*.csproj ./OtlpTestListener/
8+
RUN dotnet restore OtlpTestListener/*.csproj
9+
10+
# Copy source code and publish app
11+
COPY --link OtlpTestListener/. ./OtlpTestListener/
12+
WORKDIR /source/OtlpTestListener
13+
RUN dotnet publish -c release --no-restore -o /app
14+
15+
16+
# Runtime stage
17+
FROM mcr.microsoft.com/dotnet/aspnet:9.0-azurelinux3.0-distroless
18+
EXPOSE 8080
19+
EXPOSE 4317
20+
WORKDIR /app
21+
COPY --link --from=build /app .
22+
USER $APP_UID
23+
ENTRYPOINT ["./OtlpTestListener"]

0 commit comments

Comments
 (0)