DEV Community

Cover image for Crossplane Dynatrace: observability as code driven from Kubernetes
Span Observer
Span Observer

Posted on Originally published at span.observer

Crossplane Dynatrace: observability as code driven from Kubernetes

Your platform team already runs clusters through Kubernetes manifests, yet Dynatrace alerting profiles and dashboards still get edited by hand in the UI. Configuration drifts and nobody can say who changed what. Crossplane Dynatrace answers one operational decision: describe observability configuration like any other Kubernetes object, and let a controller keep it in line.

This article does not replace the Monaco and Terraform courses on this blog. It asks a single question: when should Dynatrace be driven from inside the cluster? It draws on an engineer’s write-up at the vendor, the Upjet repository and the Crossplane and Terraform documentation, all read on 10 November 2026. I did not deploy the setup myself, so anything unverified is flagged as such.

Crossplane Dynatrace: which problem does it solve?

The problem is not creating configuration, it is keeping it faithful. A script run from a laptop or a CI job applies the desired state once, then goes quiet. A manual edit made the next day stays until the next run.

Kubernetes has a native answer: the operator pattern. You declare an object, a controller compares actual and desired state continuously, and it corrects the gap. Crossplane applies that principle to external systems. A provider adds a service’s resources as Kubernetes objects, and the provider pod watches them and creates whatever is missing (Crossplane v2.4 documentation).

For observability the benefit is concrete: teams already deploying through GitOps (see Argo CD and GitOps on Kubernetes) can put their alerts in the same repository, under the same code review.

Where the provider comes from: Terraform under the hood

I cannot cite an official Crossplane provider for Dynatrace: the repository address in my sources did not respond when I checked, so I promise no package to install. The approach the author describes is to generate one.

The tool is Upjet. Its README presents it as a framework that turns a Terraform provider into a Crossplane provider, producing CRDs, controllers and example manifests from the Terraform schema. According to the same README it powers the AWS, Azure and GCP providers and more than fifty community ones.

For Dynatrace, the raw material is the dynatrace-oss/dynatrace Terraform provider, whose documentation covers hundreds of resources. The write-up generates four (alerting, dashboard, metric events, email notification) with provider version 1.66.0 pinned in the Makefile. That is a demonstration choice, not an Upjet limit.

Excerpt from the Dynatrace Terraform provider documentation: the dynatrace\_alerting resource with an AVAILABILITY severity rule

This HCL block comes from the dynatrace_alerting resource page. Upjet reads that resource’s schema and derives a Kubernetes object whose fields mirror Terraform’s. The API token needs the settings.read and settings.write scopes, as stated on that page.

Steps: from generation to the first object

Here is the sequence as the write-up describes it, summarised rather than replayed.

  1. Name the Terraform provider to wrap: source, version and binary name, in the Makefile.
  2. Wire up authentication: the tenant URL and API token are passed to the Terraform provider through the client configuration.
  3. Pick an external identifier strategy for each resource; the write-up uses IdentifierFromProvider.
  4. Register each resource group with a short name, then run make generate. The write-up reports « Generated 4 resources » and CRDs written to package/crds.
  5. Apply the CRDs, create a secret holding the URL and token, then a ProviderConfig that references it.
  6. Create an object (a dashboard, say) and let the controller sync it.

In the demonstration the operator runs locally with make run. That suits learning but is not a production model. For lasting use, the provider is installed as a package through a Provider object whose spec.package field names the image.

Crossplane Provider manifest with the spec.package field, an example from the official documentation

This documentation example installs the AWS S3 provider, not Dynatrace; it only shows the shape of the manifest. The write-up also leaves its full Dashboard object out (a « More config… » placeholder), so I reproduce no Dynatrace manifest that I could not read in full.

What the operator model changes day to day

Drift is corrected, not just detected

A controller replays reconciliation in a loop. If someone deletes an alerting profile in the UI, the Kubernetes object stays the reference. Ask your team: do you really want the screen to be read-only in practice?

The cost of the Terraform engine

The write-up flags an operating point: each reconciliation of an Upjet provider calls Terraform, with a plan then an apply, which can weigh on large estates. The Upjet README does describe three execution modes, two of them without the Terraform CLI (Plugin SDK v2 and Plugin Framework). I did not verify which one a generated Dynatrace provider would use, so measure before you scale up.

Translation limits

The write-up notes that Kubernetes labels have no Terraform equivalent, so you handle them yourself. It also warns that Crossplane v2, still a proposal when it was written (February 2025, updated September 2025), might change composite resources and providers. Check compatibility before pinning a version.

Taking back control: management policies

Crossplane lets you limit what the controller may do to each object through the managementPolicies field. The documentation says the default gives the controller full control and an empty list pauses the object. It also states that the feature is beta and that the provider decides whether to support it.

Excerpt from the Crossplane documentation showing managementPolicies with the values Create, Delete and Observe

For observability this is a useful guardrail: an alerting profile set to Observe only reads. Check the generated provider’s documentation to confirm the feature is enabled before relying on it.

Crossplane, Terraform or Monaco: how to decide

Crossplane is not a Terraform replacement here, since it reuses it. The decision lies elsewhere.

  • You already run Kubernetes clusters and GitOps: a controller in the cluster fits your chain, and state lives in the Kubernetes API.
  • You have no central Kubernetes platform: Terraform or Monaco stay simpler. The Monaco vs Terraform comparison covers that choice.
  • You want to manage Dynatrace objects with the Terraform provider directly: see Terraform for alerts and dashboards.

On targets, the Terraform provider page accepts a SaaS environment URL or a platform URL, but I did not verify how a generated Crossplane provider behaves against a Managed cluster. Treat Managed and SaaS separately and test on a throwaway environment.

Best practices

  • Start with a single resource type and a minimal token scope.
  • Keep the token secret out of the repository and out of manifests.
  • Use Observe before allowing Update and Delete on existing objects.
  • Watch the controller’s load: the Upjet documentation lists dedicated Prometheus metrics, including a gauge of active Terraform invocations.
  • Keep an inventory of what code manages and what remains manual.

Frequently asked questions

Is Crossplane Dynatrace available as a ready-to-install package?

I could not confirm it. The source write-up generates the provider with Upjet; I did not verify that a published, maintained image exists.

Should we drop Terraform?

No. The generated provider reuses the Terraform provider’s logic, and the write-up says the two tools are not mutually exclusive.

What are the risks at scale?

The write-up cites the load from repeated plan and apply runs and the lack of a label equivalent. Test volumes with your own resources.

Conclusion

Choose Crossplane when the cluster is already your control plane, not out of fashion. Begin with one read-only resource, measure the load, then widen. For more on the API side, read the configuration migration from Managed to SaaS.

span.observer is an independent community blog, not affiliated with Dynatrace LLC. Brands mentioned belong to their owners. Tools change quickly: check commands and options against the official documentation.


Originally published on span.observer. French version: https://span.observer/fr/crossplane-dynatrace-observabilite-as-code/.

Top comments (0)