docs icon indicating copy to clipboard operation
docs copied to clipboard

Update Application Insights Otel Collector example

Open fabistb opened this issue 8 months ago • 4 comments

What content needs to be created or modified? Update the otel collector version in the application insights example to profit from overall improvements.

The otel collector has changed the default binding addresses to improve security. With version 0.104.0 these changes have become the default. https://opentelemetry.io/blog/2024/hardening-the-collector-one/

Describe the solution you'd like

apiVersion: v1
kind: ConfigMap
metadata:
  name: otel-collector-conf
  labels:
    app: opentelemetry
    component: otel-collector-conf
data:
  otel-collector-config: |
    receivers:
      zipkin:
        endpoint: ${env.MY_POD_IP}:9411
    extensions:
      health_check:
        endpoint: ${env:MY_POD_IP}:13133
      pprof:
        endpoint: ${env.MY_POD_IP}:1888
      zpages:
        endpoint: ${env.MY_POD_IP}:55679
    exporters:
      debug:
        verbosity: basic
      azuremonitor:
        connection_string: "<CONNECTION_STRING>"
        # maxbatchsize is the maximum number of items that can be
        # queued before calling to the configured endpoint
        maxbatchsize: 100
        # maxbatchinterval is the maximum time to wait before calling
        # the configured endpoint.
        maxbatchinterval: 10s
    service:
      extensions: [pprof, zpages, health_check]
      pipelines:
        traces:
          receivers: [zipkin]
          exporters: [azuremonitor,debug]
---
apiVersion: v1
kind: Service
metadata:
  name: otel-collector
  labels:
    app: opencesus
    component: otel-collector
spec:
  ports:
  - name: zipkin # Default endpoint for Zipkin receiver.
    port: 9411
    protocol: TCP
    targetPort: 9411
  selector:
    component: otel-collector
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: otel-collector
  labels:
    app: opentelemetry
    component: otel-collector
spec:
  replicas: 1  # scale out based on your usage
  selector:
    matchLabels:
      app: opentelemetry
  template:
    metadata:
      labels:
        app: opentelemetry
        component: otel-collector
    spec:
      containers:
      - name: otel-collector
        image: otel/opentelemetry-collector-contrib:0.123.0
        command:
          - "/otelcol-contrib"
          - "--config=/conf/otel-collector-config.yaml"
        resources:
          limits:
            cpu: 1
            memory: 2Gi
          requests:
            cpu: 200m
            memory: 400Mi
        ports:
          - containerPort: 9411 # Default endpoint for Zipkin receiver.
        env:
          - name: MY_POD_IP
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: status.podIP
        volumeMounts:
          - name: otel-collector-config-vol
            mountPath: /conf
        livenessProbe:
          httpGet:
            path: /
            port: 13133
        readinessProbe:
          httpGet:
            path: /
            port: 13133
      volumes:
        - configMap:
            name: otel-collector-conf
            items:
              - key: otel-collector-config
                path: otel-collector-config.yaml
          name: otel-collector-config-vol

Where should the new material be placed? https://github.com/dapr/docs/blob/v1.15/daprdocs/static/docs/open-telemetry-collector/open-telemetry-collector-appinsights.yaml

Additional context Predecessor #4594

fabistb avatar Apr 14 '25 12:04 fabistb

@alicejgibbons like we briefly discussed. The issue regarding the otel collector update.

fabistb avatar Apr 14 '25 12:04 fabistb

@fabistb - Would you be open to pushing a PR for this? Would appreciate this.

msfussell avatar Apr 15 '25 20:04 msfussell

@fabistb - Would you be open to pushing a PR for this? Would appreciate this.

Sure, I can create the PR. Let me just do 1-2 additional checks to especially ensure that the pprof and zpages extensions are working as expected.

fabistb avatar Apr 16 '25 09:04 fabistb

@msfussell , sorry for the delay here.

I changed the pprof and zpages endpoints back to the default localhost

      pprof:
        endpoint: :1888
      zpages:
        endpoint: :55679

From my understanding pprof is used for performance profiling and you would utilize it by setup a port forwarding to your local client and then run a command.

Similar for zpages which is used for debugging live data from different components.

fabistb avatar Apr 24 '25 13:04 fabistb

@alicejgibbons - This issue was closed with this PR correct https://github.com/dapr/docs/pull/4660 ?

msfussell avatar Jul 11 '25 22:07 msfussell

REsolved

msfussell avatar Jul 12 '25 03:07 msfussell