Azure / Azure/azure-functions-java-worker

Application insights for Azure Function on Kubernetes

Abierto
#744 0 comentarios 0 reacciones 1 asignado Reclamado por @shreyas-gopalakrishna Ver en GitHub
area:java-functions
Lenguaje dominante
Java
Estrellas
103
Forks
74
Merge medio
4 d 8 h
PR fusionados (30 d)
2

Descripción

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

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.