• Home
  • Deploy
  • Kubernetes
  • Guides
  • Metadata and automation
  • Metadata metric enrichment

Metadata metric enrichment

cloudNativeFullStack

applicationMonitoring

As part of getting started with Kubernetes monitoring, you might want to configure metadata metric enrichment.

Metadata metric enrichment leverages data from OneAgent and Dynatrace Operator by adding additional context or relevant data to the metrics sent. Enrichment means the logs and data are related back to entities (pods, processes, hosts). Every metric prefixed with dt.entity is due to metadata enrichment.

Every application pod that is instrumented by the Dynatrace webhook is automatically enriched with metric metadata.

Activate metadata enrichment

To activate metadata enrichment, you need to create a special token for data ingest and add it to the secret.

  1. Create a dataIngestToken token and enable the Ingest metrics permission (API v2).
  2. Make sure the dynakube secret you create in step 3 of the deployment instructions includes the dataIngestToken token.
  3. Redeploy your monitored pods.

You can add the dataIngestToken token manually at any time by editing the secret:

Add dataIngestToken manually
  1. Edit the existing secret.

    bash
    kubectl edit secret <dynakube>
    bash
    oc edit secret <dynakube>
  2. Add a new dataIngestToken key with your generated token to the secret, as in the example below:

    yaml
    apiVersion: v1 kind: Secret metadata: name: dynakube namespace: dynatrace data: apiToken: <apiToken base64 encoded> dataIngestToken: <dataIngestToken base64 encoded> type: Opaque
  3. Redeploy your monitored pods.

Disable metadata enrichment

To disable the metadata enrichments, add the following annotation to the DynaKube custom resource:

yaml
metadata: annotations: ... feature.dynatrace.com/disable-metadata-enrichment: "true"

Alternatively, you can disable the metadata enrichments by running the command below.

bash
kubectl annotate dynakube -n dynatrace <your_DynaKube_CR> feature.dynatrace.com/disable-metadata-enrichment="true"
bash
oc annotate dynakube -n dynatrace <your_DynaKube_CR> feature.dynatrace.com/disable-metadata-enrichment="true"