Azure / Azure/azure-functions-java-worker

Application insights for Azure Function on Kubernetes

Đang mở
#744 0 bình luận 0 reaction 1 người được giao Được @shreyas-gopalakrishna nhận Xem trên GitHub
area:java-functions
Ngôn ngữ chính
Java
Star
103
Fork
74
Merge trung bình
4 ngày 8 giờ
Pull request đã merge (30 ngày)
2

Mô tả

#### 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"]```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.