OpenTelemetry Agent - .NET Linux 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 vFunction Sample Linux .NET OpenTelemetry Dockerfile or copy-and-paste the Dockerfile below
FROM almalinux:9

######### OTEL Workflow #########

### Set $VF_SERVER_ADDRESS as URL for vFunction Server Login, such as "http://10.0.0.1" or "https://vfunction.org.com"
### Set $VF_APP_ID taken from VF Server UI's "Installation Instructions" link in the Learning Tab, such as "47a10489-0000-0000-bc6e-579477ed6f40"
### Set $MY_SERVICE for this component of your Application, such as "Receipt Handler"

ENV OTEL_EXPORTER_OTLP_PROTOCOL=http/protobuf
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
ENV OTEL_EXPORTER_OTLP_HEADERS=X-VF-APP=$VF_APP_ID
ENV OTEL_SERVICE_NAME=$MY_SERVICE

### If the App connects to Microsoft SQL DB, uncomment:
# ENV OTEL_DOTNET_AUTO_SQLCLIENT_SET_DBSTATEMENT_FOR_TEXT=true

### If the App connects to an Oracle DB, uncomment:
# ENV OTEL_DOTNET_AUTO_ORACLEMDA_SET_DBSTATEMENT_FOR_TEXT=true

RUN curl -sSfL https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/releases/latest/download/otel-dotnet-auto-install.sh -O && \
  sh ./otel-dotnet-auto-install.sh && \
  chmod +x $HOME/.otel-dotnet-auto/instrument.sh

######### Start the Container #########

### Set APPLICATION as workflow to start the application if using the Dotnet CLI
CMD ["/bin/bash", "-c", ". $HOME/.otel-dotnet-auto/instrument.sh dotnet $APPLICATION"]
### Set APPLICATION_EXECUTABLE as workflow to start the application if using an executable
#CMD ["/bin/bash", "-c", ". $HOME/.otel-dotnet-auto/instrument.sh $APPLICATION_EXECUTABLE"]
  1. Modify the Dockerfile by following the Comments in the Dockerfile
  2. Copy-and-paste the new sections of the Dockerfile into the Application’s existing Dockerfile
  3. Build and Deploy the new Docker Container for the Application