Azure / Azure/azure-functions-java-worker
Application insights for Azure Function on Kubernetes
未关闭
@shreyas-gopalakrishna 已经在做这个了。
开始于 2024年2月5日。
area:java-functions
- 主要语言
- Java
- 星标
- 103
- 派生
- 74
- 平均合并
- 4 天 8 小时
- 30 天内合并 PR
- 2
描述
Description of the issue
We're trying to migrate our infrastructure to Kubernetes. That also includes migration of function app. We've manage to do it succesfully, we have a working azure function, however there is a problem with application insights. Namely, it is not working. We don't see any logs not to mention distributed tracing which are vital for us. Is there a way to instrument Java function app insight hosted on kubernetes cluster?
Investigative information
Java version: 11
Here I'm posting a sample configuration from the environment variables of kubernetes deployment:
- name: APPINSIGHTS_INSTRUMENTATIONKEY
valueFrom:
secretKeyRef:
name: external-secrets
key: secret-value
- name: APPLICATIONINSIGHTS_INSTRUMENTATION_SPRING_SCHEDULING_ENABLED
value: "false"
- name: APPLICATIONINSIGHTS_PREVIEW_OTEL_API_SUPPORT
value: "true"
- name: APPLICATIONINSIGHTS_ENABLE_AGENT
value: "true"
- name: XDT_MicrosoftApplicationInsights_Java
value: "1"
- name: ApplicationInsightsAgent_EXTENSION_VERSION
value: ~3
Dockerfile for the image:
FROM mcr.microsoft.com/azure-functions/java:4-java11-core-tools AS installer-env
COPY settings.xml /root/.m2/settings.xml
COPY . /src/java-function-app
RUN cd /src/java-function-app && \
mkdir -p /home/site/wwwroot && \
mvn clean package && \
cd ./target/azure-functions/ && \
cd $(ls -d */|head -n 1) && \
cp -a . /home/site/wwwroot
FROM mcr.microsoft.com/azure-functions/java:4-java11
ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
AzureFunctionsJobHost__Logging__Console__IsEnabled=true
COPY --from=installer-env ["/home/site/wwwroot", "/home/site/wwwroot"]```
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
评估
这个 Issue 还没有评估数据。