Azure / Azure/azure-functions-java-worker

Application insights for Azure Function on Kubernetes

オープン
#744 コメント 0 件 リアクション 0 件 担当者 1 名 @shreyas-gopalakrishna が担当を希望しています GitHub で見る
area:java-functions
主要言語
Java
スター
103
フォーク
74
平均マージ
4日 8時間
マージ済み PR(30日)
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:

```ARG JAVA_VERSION=11
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 をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。