We use Dynatrace Operator initContainer method prvision our pods with full stack. I can see that all the technolofy stack libraries (.so files) are present and LD_LIBRARY is also correctly set.
But Golang has been disabled (intentionally not selected) from Dynatrace monitoring because it might interfere with “other” things.
One example is istio sidecar proxy container that is running in the same pod. Say we don’t want this container to be monitored but want our app containers (the names of which can be anything based on what teams want - and there are 1000s of them of them - some are Golang based).
Because of this Goland has been turned off but we would like to support that.
Is there any way to override the supported technologies via some annotation or something ?
Or
There is a limitation of what we can do in kubernetes environment and Dynatrace does not support this use case?
@bhantol ,
You can’t exclude based on technology, but there are a couple of approaches that you can take to help minimise this.
First is to use an opt-in based approach (monitor nothing by default).
This is done by setting up a webhook label, and only applying that label to a namespace where you want monitored. Configure monitoring for namespaces and pods - Dynatrace Docs, this way only workloads that require Dynatrace will get it. This is a little more work on deployment teams, but they can add it into their build templates.
They can also go fine grain on specific deployments and or containers.
Second - which is is an opt-out based approach (monitor everything by default).
In the Dynakube CRD, you can set up a rule like below for metadata enrichment and one agent (both need to be the same or else injection will occur anyway)
---
### Excluded Namespace - must be added to metadata enrichment as well ## namespaceSelector: matchExpressions: - key: kubernetes.io/metadata.name operator: NotIn values: # kubernetes - calico-apiserver - calico-system - cluster-operation - default - kube-node-lease - kube-public - kube-system - tigera-operator # container squad - gatekeeper-system - istio-system - tlsrouter # Services and Agents - crossplane-system # application namespaces
- namespace-A
This will then exclude monitoring from the k8s critical components (where most of the go is) and anything else you might not want monitored, whilst monitoring all the workload by default. This will also help protect your platform from not crashing (something we have had outstanding issues with when the oneagent-init container fails - e.g proxy issue).
I haven’t seen any issues with the istio-proxy sidecar getting instrumented, but if you wanted to exclude (same as any other deployment) you can always add the relevant annotation ‘oneagent.dynatrace.com/inject: “false”’ to the deployment or in the instance of istio, the istio mesh configmap.
By default, Dynatrace Operator injects OneAgent into all namespaces, except for:
Namespaces prefixed with kube- or openshift-.
The namespace where Dynatrace Operator was installed.
You can safely turn on Golang instrumentation unless your apps run in the kube-* / openshift-* namespaces. You should not run your custom workload in those anyway.
The technology type Go has been globally disabled.
Hence the DT override:-
DT_AGENT_TYPE_OVERIDE=‘go=on’
In that case again asking the question is the source codebase is available to understand or why the dynatrace UI does not show monitoring for this kubernetes workload.
The logs are unclear if the agent is working.
The dynatrace ui settings → status does not show this working either.
If you see agent version in the process group instance properties, the code module is injected. Injection might not happen due to various reasons. What deployment mode ldo you use in your dynakube?
Basically we are disabling Go but opting it in using a special environment variable linked in the post.
In short this is in a userland namespace and dynatrace install-oneagent init containers will install oneagent-pass related data the logs linked are captured from the /opt/dynatrace/oneagent-pass/agent/go/ruxit…log
The logs indicate the the version and I am not able to understand the logs because I don’t have the source code.
Wondering if you have any insights in the logs. Like why it says agent Inactivated ?
If you’re saying that GO is not being injected - then it is either
The way the GO App has been built is not compatible:
https://{environmentid}.live.dynatrace.com/ui/settings/builtin:monitored-technologies.go
There is really not much else to monitoring GO apps. It will do it by default unless disabled or it’s not built in a way that Dynatrace can instrument (this will show a reason on process view or Deployment Status screen)
Thanks