下载安装包 tingyun-agent-netcore-版本.exe
双击安装包, 配置license, 选择安装路径, 进行安装
更改dotnet应用启动脚本,在应用启动脚本内增加 call 安装路径\tingyun-enable.bat
例如,原dotnet应用启动脚本如下:
...
dotnet c:\interpub\myapp\myapp.dll
假设探针安装在C:\Program Files (x86)\Networkbench.COM\NetCore Profiler 更改后的dotnet应用启动脚本如下:
...
call C:\Program Files (x86)\Networkbench.COM\NetCore Profiler\tingyun-enable.bat
dotnet c:\interpub\myapp\myapp.dll
重启应用 如果应用采用部署到IIS上的模式,请同时安装 .NET 探针(tingyun-agent-dotnet-版本.exe),并通过.NET 探针图形化界面启用探针
下载安装包 tingyun-agent-netcore-版本.bin
运行tingyun-agent-netcore-版本.bin, 配置license, 选择安装路径, 进行安装
[user@localhost tmp]$ chmod +x tingyun-agent-netcore-版本.bin
[user@localhost tmp]$ sudo ./tingyun-agent-netcore-版本.bin
unzip to /usr/lib/tingyun-dotnet ...
Enter license key (请录入授权码):
更改dotnet应用启动脚本,在应用启动脚本内增加tingyun-enable
. tingyun-enable
例如,原dotnet应用启动脚本如下:
...
dotnet /opt/myapp/myapp.dll
更改后的dotnet应用启动脚本如下:
...
. tingyun-enable
dotnet /opt/myapp/myapp.dll
. /安装路径/bin/tingyun-enable
例如,原dotnet应用启动脚本如下:
...
dotnet /opt/myapp/myapp.dll
假设探针安装在 /opt/tingyun/ 下 更改后的dotnet应用启动脚本如下:
...
. /opt/tingyun/bin/tingyun-enable
dotnet /opt/myapp/myapp.dll
重启应用
下载安装包 tingyun-agent-netcore-版本.bin到Dockerfile目录
更改Dockerfile
脚本仅是举例说明,请酌情按照自己的实际情况修改
FROM microsoft/dotnet:2.2.1-aspnetcore-runtime
# web application
RUN mkdir /app
WORKDIR /app
COPY publish /app
ENV ASPNETCORE_URLS http://*:5000
# install tingyun agent
COPY tingyun-agent-netcore-版本号.bin /tmp
RUN chmod +x /tmp/tingyun-agent-netcore-版本号.bin
RUN /tmp/tingyun-agent-netcore-版本号.bin --license=授权码
RUN rm -f /tmp/tingyun-agent-netcore-版本号.bin
# run web application with tingyun agent
RUN echo "#! /bin/bash" > /app/run.sh
RUN echo ". tingyun-enable" >> /app/run.sh
RUN echo "dotnet /app/demo.dll" >> /app/run.sh
RUN chmod +x /app/run.sh
ENTRYPOINT ["/app/run.sh"]
或
FROM microsoft/dotnet:2.2.1-aspnetcore-runtime
# web application
RUN mkdir /app
WORKDIR /app
COPY publish /app
ENV ASPNETCORE_URLS http://*:5000
# install tingyun agent
COPY tingyun-agent-netcore-版本号.bin /tmp
RUN chmod +x /tmp/tingyun-agent-netcore-版本号.bin
RUN /tmp/tingyun-agent-netcore-版本号.bin --license=授权码
RUN rm -f /tmp/tingyun-agent-netcore-版本号.bin
# setup env for tingyun agent
ENV CORECLR_ENABLE_PROFILING 1
ENV CORECLR_PROFILER {8BEB2128-D285-4E1D-91B6-11ACD43EC0EE}
ENV CORECLR_PROFILER_PATH /usr/lib/tingyun-dotnet/x64/tingyun_profiler.so
ENV LD_LIBRARY_PATH /usr/lib/tingyun-dotnet/x64:$LD_LIBRARY_PATH
ENV TINGYUN_NETCORE_HOME /usr/lib/tingyun-dotnet
# run web application with tingyun agent
ENTRYPOINT ["dotnet", "/app/demo.dll"]
重新编译镜像
docker build .