OpenTelemetry Agent - .NET Framework Windows Docker Container Installation



Installation Wizard

To help with the installation process, vFunction offers an Installation Wizard. This Wizard provides additional information about the Prerequisites as well as steps for deploying the OpenTelemetry Agent to your environment.

Please contact support@vfunction.com or your vFunction Contact(s) for the password to start using this Wizard.


Installation Steps

  1. Download the OpenTelemetry .NET Zero-Code Instrumentation package
  2. Download the vFunction Sample Windows .NET Framework OpenTelemetry Dockerfile or copy-and-paste the Dockerfile below
FROM mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2019 AS base

######### Add OTEL and App to Container
COPY app.publish.zip /app.zip
COPY opentelemetry-dotnet-instrumentation-windows.zip /otel.zip

SHELL ["powershell","-command"]
RUN Expand-Archive -Path 'C:\\app.zip' -DestinationPath 'C:\\inetpub\\wwwroot'
RUN Expand-Archive -Path 'C:\\otel.zip' -DestinationPath 'C:\\Program Files\\OpenTelemetry .NET AutoInstrumentation'

######### OTEL Environment Variables
ENV OTEL_DOTNET_AUTO_INSTALL_DIR="C:\\Program Files\\OpenTelemetry .NET AutoInstrumentation"
ENV COR_ENABLE_PROFILING=1
ENV COR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318}
ENV COR_PROFILER_PATH_32="C:\\Program Files\\OpenTelemetry .NET AutoInstrumentation\\win-x86\\OpenTelemetry.AutoInstrumentation.Native.dll"
ENV COR_PROFILER_PATH_64="C:\\Program Files\\OpenTelemetry .NET AutoInstrumentation\\win-x64\\OpenTelemetry.AutoInstrumentation.Native.dll"
ENV DOTNET_ADDITIONAL_DEPS="C:\\Program Files\\OpenTelemetry .NET AutoInstrumentation\\AdditionalDeps"
ENV DOTNET_SHARED_STORE="C:\\Program Files\\OpenTelemetry .NET AutoInstrumentation\\store"
ENV DOTNET_STARTUP_HOOKS="C:\\Program Files\\OpenTelemetry .NET AutoInstrumentation\\net\\OpenTelemetry.AutoInstrumentation.StartupHook.dll"
ENV OTEL_DOTNET_AUTO_HOME="C:\\Program Files\\OpenTelemetry .NET AutoInstrumentation"

######### vFunction Environment Variables
ENV OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
### Set $VF_SERVER_ADDRESS as URL for vFunction Server Login ...
### Such as "http://10.0.0.1" or "https://vfunction.org.com"
ENV OTEL_EXPORTER_OTLP_ENDPOINT=$VF_SERVER_ADDRESS/api/unauth/otlp
ENV OTEL_TRACES_EXPORTER=otlp
ENV OTEL_METRICS_EXPORTER=none
ENV OTEL_LOGS_EXPORTER=none
### Set $VF_APP_ID taken from VF Server UI's "Installation Instructions" link ...
### In the Learning Tab, such as "47a10489-0000-0000-bc6e-579477ed6f40"
ENV OTEL_EXPORTER_OTLP_HEADERS=X-VF-$VF_APP_ID
ENV OTEL_SERVICE_NAME=$MY_SERVICE
  1. Modify the Dockerfile by following the Comments in the Dockerfile, or copy-and-paste the relevant sections into your own Dockerfile
  2. Add the opentelemetry-dotnet-instrumentation-windows.zip that was downloaded in Step #1 to the Artifact Repository so that it will be added to the Build
  3. Build and Deploy the new Docker Container for the Application