cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

appNameStrategy option in cluster agent configuration for auto-instrumentation does not seems to be working

Raja.Vijayakumar
Wanderer

Hi

I tried to use 'appNameStrategy' options as described in doc https://docs.appdynamics.com/display/PRO45/Enable+Auto-Instrumentation+of+Java+Applications as part of enabling auto-instrumentation using cluster agent in k8s cluster ( PKS cluster), but i could not get it work.

 

I am getting below error

 

[WARNING]: 2020-07-29 01:05:47 - deploymenthandler.go:245 - Cannot start instrumentation. Error getting Application and Tier names for deployment demo-app

 

 

 

instrumentationMethod: Env
  nsToInstrumentRegex: demo-ns
  appNameStrategy: label
  appNameLabel: app  
  defaultEnv: JAVA_OPTS
  resourcesToInstrument: [Deployment,StatefulSet]
  imageInfo:
    java:
      image: "dev.registry.ews.int/vendored/docker.io/appdynamics/java-agent:20.6.0"
      agentMountPath: /opt/appdynamics
  netvizInfo:
    bciEnabled: true
    port: 3892

 

 

 

The error is same for 'appNameStrategy: namespace'. 

 

Can someone guide me if i am missing something here ?

4 REPLIES 4

Mario.Morelli
Architect

Hi there

 

Can you share your entire Cluster Agent deployment YAML as well as your java application YAML? to better understand what is configured incorrectly?



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Learn more about me in the Community Member Spotlight Q & A

cluster agent.yaml

 

 

apiVersion: appdynamics.com/v1alpha1
kind: Clusteragent
metadata:
  name: k8s-cluster-agent
  namespace: appdynamics
spec:
  appName: "sbx-cluster-1"
  controllerUrl: "https://*******.saas.appdynamics.com"
  account: "********"
  # docker image info
  image: "dev.registry.ews.int/vendored/docker.io/appdynamics/cluster-agent:20.5.0"
  serviceAccountName: appdynamics-cluster-agent
  logLevel: "DEBUG"
  nsToMonitor:
    - "appdynamics"
    - "cert-manager"
    - "default"
    - "demo-ns"
    - "external-dns"
    - "harness-delegate"
    - "kube-node-lease"
    - "kube-public"
    - "kube-system"
    - "ingress-nginx"
    - "pks-system"
    - "twistlock"
  stdoutLogging: "true"
  instrumentationMethod: Env
  nsToInstrumentRegex: demo-ns
  appNameStrategy: label
  appNameLabel: app
  defaultEnv: JAVA_OPTS
  resourcesToInstrument: [Deployment,StatefulSet]
  imageInfo:
    java:
      image: "dev.registry.ews.int/vendored/docker.io/appdynamics/java-agent:20.6.0"
      agentMountPath: /opt/appdynamics
  netvizInfo:
    bciEnabled: true
    port: 3892

 

 

demo-app.yaml

 

apiVersion: v1
kind: Service
metadata:
  name: demo-app-svc
  namespace: demo-ns
  labels:
    app: demo
    env: dev
    tier: web
    team: dev-team
spec:
  type: ClusterIP
  ports:
    - port: 80
      targetPort: http
      protocol: TCP
      name: http
  selector:
    app: demo
    env: dev
    tier: web
    team: dev-team
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: demo-app
  namespace: demo-ns
  annotations:
    product-documentation: "https://confluence.ews.int/"
    on-call: "000-000-0000"
    email: "pkottam@ews.int"
  labels:
    app: demo
    env: dev
    tier: web
    team: dev-team
spec:
  replicas: 1
  selector:
    matchLabels:
      app: demo
  template:
    metadata:
      annotations:
        product-documentation: "https://confluence.ews.int/"
        on-call: "000-000-0000"
        email: "pkottam@ews.int"
        prometheus.io/scrape: 'true'
        prometheus.io/port: '8080'
        prometheus.io/path: '/actuator/prometheus'
      labels:
        app: demo
        env: dev
        tier: web
        team: dev-team
    spec:
      securityContext:
        runAsUser: 1000
        runAsGroup: 3000
      containers:
        - name: demo-app
          image: "dev.registry.ews.int/ews/demo42b:556"
          imagePullPolicy: Always
          ports:
            - name: http
              containerPort: 8080
              protocol: TCP
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: demo-app-ing
  namespace: demo-ns
  labels:
    app: demo
    env: dev
    tier: web
    team: dev-team
  annotations:
    cert-manager.io/cluster-issuer: cm-vault-issuer
    kubernetes.io/ingress.class: nginx
spec:
  tls:
    - hosts:
        - demo.pks-aws-dev.ews.int
      secretName: demo.pks-aws-dev.ews.int-tls
  rules:
    - host: demo.pks-aws-dev.ews.int
      http:
        paths:
          - path: /
            backend:
              serviceName: demo-app-svc
              servicePort: http

 

 

Note: The same issue exists if i use namespace strategy as well..

 

 

apiVersion: appdynamics.com/v1alpha1
kind: Clusteragent
metadata:
  name: k8s-cluster-agent
  namespace: appdynamics
spec:
  appName: "sbx-cluster-1"
  controllerUrl: "https://******.saas.appdynamics.com"
  account: "**********"
  # docker image info
  image: "dev.registry.ews.int/vendored/docker.io/appdynamics/cluster-agent:20.5.0"
  serviceAccountName: appdynamics-cluster-agent
  logLevel: "DEBUG"
  nsToMonitor:
    - "appdynamics"
    - "cert-manager"
    - "default"
    - "demo-ns"
    - "external-dns"
    - "harness-delegate"
    - "kube-node-lease"
    - "kube-public"
    - "kube-system"
    - "ingress-nginx"
    - "pks-system"
    - "twistlock"
  stdoutLogging: "true"
  instrumentationMethod: Env
  nsToInstrumentRegex: demo-ns
  appNameStrategy: namespace
  #appNameLabel: app
  #defaultAppName: demo-app
  #defaultInstrumentMatchString: demo-app
  #defaultInstrumentationLabelMatch:
  #- app: demo
  defaultEnv: JAVA_OPTS
  resourcesToInstrument: [Deployment,StatefulSet]
  imageInfo:
    java:
      image: "dev.registry.ews.int/vendored/docker.io/appdynamics/java-agent:20.6.0"
      agentMountPath: /opt/appdynamics
  netvizInfo:
    bciEnabled: true
    port: 3892
  ### Uncomment the following two lines if you need pull secrets
  #imagePullSecrets:
  #  name: "<your-docker-pull-secret-name>"
  #instrumentationRules:
  #  - namespaceRegex: demo-ns
  #    appNameLabel: app

 

@Mario.Morelli Just checking if you had a chance to take a look into the above issue. I work along side with @Raja.Vijayakumar.

Hi Vaibhav

 

Can you test manual instrumentation by using the following settings, and provide the logs of what is happening

 

appNameStrategy: manual


 And ensure to provide a value for -   defaultAppName

 

Also can you provide the following information

1. Version of cluster agent you are using?

 



Found something helpful? Click the Accept as Solution button to help others find answers faster.
Liked something? Click the Thumbs Up button.

Learn more about me in the Community Member Spotlight Q & A
Join Us On December 10
Learn how Splunk and AppDynamics are redefining observability


Register Now!

Observe and Explore
Dive into our Community Blog for the Latest Insights and Updates!


Read the blog here