Metadata metric enrichment
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.
- Create a
dataIngestTokentoken and enable the Ingest metrics permission (API v2).
- Make sure the
dynakubesecret you create in step 3 of the deployment instructions includes the
- Redeploy your monitored pods.
You can add the
dataIngestToken token manually at any time by editing the secret:
Edit the existing secret.bash
kubectl edit secret <dynakube>bash
oc edit secret <dynakube>
Add a new
dataIngestTokenkey 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
Redeploy your monitored pods.
Disable metadata enrichment
To disable the metadata enrichments, add the following annotation to the DynaKube custom resource:
metadata: annotations: ... feature.dynatrace.com/disable-metadata-enrichment: "true"
Alternatively, you can disable the metadata enrichments by running the command below.
kubectl annotate dynakube -n dynatrace <your_DynaKube_CR> feature.dynatrace.com/disable-metadata-enrichment="true"
oc annotate dynakube -n dynatrace <your_DynaKube_CR> feature.dynatrace.com/disable-metadata-enrichment="true"