iblancasa / appdynamics-k8s-webhook-instrumentor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AppDynamics K8S Webhook Instrumentor

This project provides K8S mutating webhook, which, by pre-set rules, auto-instruments pods at their creation time with AppDynamics or OpenTelemetry agents.

Why?

Why different autoinstrumentation for AppDynamics?

AppDynamics offers autoinstrumentation functionality via Cluster Agent and it's configuration. Cluster Agent uses a strategy of modifying Deployments, DeploymentConfigs (on OpenShift), and StatefulSets when those match pre-set criteria, when pod specifications are modified so, that agent for supported languages is automatically injected into application container. Kubernetes control plane then creates appropriate number of already instrumented pods.

While this approach offers a few benefits, among all ability to reverse instrumentation changes in inprobable case of issues introduced by an agent, there are also a few drawbacks, especially when using modern popular CD tooling such as Argo CD. In some cases, Cluster Agent is unable to detect changes in deployment specification made by those tools, which results in application not being instrumented, in other cases, like when using Argo CD, Cluster Agent and CD deployment tool end up in endless cycle of back and forth modifications of deployment specification, resulting in undesired number of application restarts and inconsistent monitoring.

This project brings a method of agent injection directly to pod specification upon their instantiation wia mutating webhook, avoiding most of the corner cases mentioned above (the only significant being for example Argo CD deploying Pod directly and not via ReplicaSet specification or Deployment/StatefulSet etc.).

Other use cases made possible

With OpenTelemetry support in AppDynamics SaaS, it can be assumed users will want the same level of ease of agent installation as in case of traditional AppDynamics agents. While there is an official OpenTelemetry autoistrumentation functionality available at https://github.com/open-telemetry/opentelemetry-operator for official OpenTelemetry agents, AppDynamics offers also hybrid agent functionality in AppDynamics agents where agents emit both native and OpenTelemetry telemetry data.

This project supports both AppDynamics hybrid agents and OpenTelemetry agents in several ways including ability to create OpenTelemetry collectors with speciified custom configuration.

Supported Agents

Language AppDynamics Native AppDynamics Hybrid OpenTelemetry
Java
.NET (Core) 🤔 🏗️
Node.js 🏗️
Apache 🤔 🔬
Nginx 🔬
Go 🤔
Icon Support level
Supported
No plans at this time.
🔬 Experimental
🤔 Under consideration / in planning
🏗️ Under construction.

How to install?

Using Helm:

  1. Add Helm chart repository
helm repo add mwh https://cisco-open.github.io/appdynamics-k8s-webhook-instrumentor/
  1. Update Helm repository cache
helm repo update
  1. Deploy chart with values
helm install --namespace=<namespace> <chart-name> mwh/webhook-instrumentor --values=<values-file>

to upgrade after values change:

  • on OpenShift, you can use helm upgrade
  • on Kubernetes, use helm delete <chart-name> helm install ... commands for the time being

How to configure?

If using helm, modify values.yaml for helm chart parameters

See values-sample.yaml for inspiration and this Blog Post to get started.

More examples and documentation is coming soon.

DB Agent support

DB Agent can be provisioned with the instrumentor, too. Add following section to your values file, note there can be multiple DB agents provisioned:

dbAgents:
  # db agent name MUST be DNS friendly - only lowercase, numbers and "-"
  md-db-agent-k8s:
    image:
      image: docker.io/appdynamics/db-agent:latest
      imagePullPolicy: Always

DB Agent will automatically register to the AppDynamics controller specified for instrumentation in the values file.

About

License:Apache License 2.0


Languages

Language:Go 85.4%Language:HTML 4.3%Language:Dockerfile 3.1%Language:JavaScript 2.1%Language:Shell 1.6%Language:Makefile 1.2%Language:C# 1.2%Language:CSS 0.7%Language:Smarty 0.2%