CiscoDevNet / appdynamics-charts

Helm charts for AppDynamics
https://appdynamics.github.io/appdynamics-charts/
Apache License 2.0
21 stars 38 forks source link

Using Auto-instrumentation #10

Closed arcosta closed 3 years ago

arcosta commented 3 years ago

Can I use the auto-instrumentation feature using this chart ? If yes, can you please point some directions ?

rootd00d commented 3 years ago

The documentation is a little scattered, it seems. It was difficult to really piece some things together, but in the end ya, it works. Now I get to remove all of the AppDynamics NodeJS dependencies from our services, which is nice.

helm repo add  appdynamics-charts https://appdynamics.github.io/appdynamics-charts
kubectl create ns appdynamics
helm upgrade --install john-doe appdynamics-charts/cluster-agent --namespace appdynamics -f - <<EOF
deploymentMode: MASTER
imageInfo:
  agentImage: docker.io/appdynamics/cluster-agent
  agentTag: 20.11.0
  operatorImage: docker.io/appdynamics/cluster-agent-operator
  operatorTag: 0.6.5
  imagePullPolicy: Always                               # Will be used for operator pod
controllerInfo:
  url: https://<YOUR_URL>:443
  account: <YOUR_ACCOUNT>
  username: <YOUR_USER> # Not sure that username and password are required ??
  password: <YOUR_PASSWORD>
  accessKey: <YOUR_ACCCESS_KEY>
createServiceAccount: true
agentServiceAccount: appdynamics-cluster-agent
operatorServiceAccount: appdynamics-operator
clusterAgent:
  nsToMonitor:
    - default
  clusterMetricsSyncInterval: 60
  metadataSyncInterval: 60
  eventUploadInterval: 10
  httpClientTimeout: 30
  podBatchSize: 6
  imagePullSecret: ""
  containerProperties:
    containerBatchSize: 5
    containerParallelRequestLimit: 1
    containerRegistrationInterval: 120
  logProperties:
    logFileSizeMb: 5
    logFileBackups: 3
    logLevel: DEBUG    # Adjust this
  metricProperties:
    metricsSyncInterval: 30
    metricUploadRetryCount: 2
    metricUploadRetryIntervalMilliSeconds: 5
podFilter: {}
instrumentationConfig:
  enabled: true
  instrumentationMethod: Env
  nsToInstrumentRegex: default
  appNameStrategy: manual
  defaultAppName: JANE-DOE
  instrumentationRules:
    - matchString: ^some-deployment-a
      language: nodejs
      instrumentContainer: select
      containerMatchString: ^some-container-a
      imageInfo:
        image: "docker.io/appdynamics/nodejs-agent:20.8.0-stretch-slimv14"
        agentMountPath: /opt/appdynamics
        imagePullPolicy: "IfNotPresent"
      analyticsHost: <HOST>
      analyticsPort: 443
      analyticsSslEnabled: true
    - matchString: ^some-deployment-b
      language: nodejs
      instrumentContainer: select
      containerMatchString: ^some-container-a
      imageInfo:
        image: "docker.io/appdynamics/nodejs-agent:20.8.0-stretch-slimv14"
        agentMountPath: /opt/appdynamics
        imagePullPolicy: "IfNotPresent"
      analyticsHost: <HOST>
      analyticsPort: 443
      analyticsSslEnabled: true
agentPod:
  nodeSelector: {}
  tolerations: []
  resources:
    limits:
      cpu: "1250m"
      memory: "300Mi"
    requests:
      cpu: "250m"      # Default here was too high for my single-node cluster
      memory: "150Mi"
operatorPod:
  nodeSelector: {}
  tolerations: []
  resources:
    limits:
      cpu: 200m
      memory: 128Mi
    requests:
      cpu: 100m
      memory: 64Mi
install:
  metrics-server: false
EOF

I had to use the select method because we're using LinkerD so there's multiple containers in each pod.

If you want to see what's in the chart, just do --

helm pull appdynamics-charts/cluster-agent

and take a look at the values.yaml and the rest of the templates to see what they do.

arcosta commented 3 years ago

Seems good to me, thanks @rootd00d