• Home
  • Extend Dynatrace
  • Extend metric observability
  • Reference
  • Enrich ingested metrics

Enrich ingested metrics with Dynatrace-specific dimensions

When you use Metric scripting integration or OneAgent metric API, your ingested metrics are automatically enriched with the host context by assigning the dt.entity.host dimension.

You can also enrich your metrics with the context of the process group instance of the app you use to ingest metrics to Dynatrace. To do that, use the OneAgent-exposed file-open interface. The app you use to ingest metrics into Dynatrace needs to perform some basic file actions.

OneAgent file-open interface

To add Dynatrace-specific dimensions to your metrics:

  1. Use a file-open function to open the file named dt_metadata_e617c525669e072eebe3d0f08212e8f2.json or dt_metadata_e617c525669e072eebe3d0f08212e8f2.properties.
    • For Linux, use open, fopen, or open64; for Windows, use open or CreateFile.
    • Use the exact filename with no added path.
    • The file extension (json or properties) determines the format in which OneAgent writes the Dynatrace-specific dimensions: Java-style properties or JSON.
  2. When you run the file-open function, OneAgent creates a file containing the Dynatrace-specific dimensions in the OneAgent configuration directory. The full path to this file is provided in the indirection file opened in the first file-open call.
  3. Your app should now read the file at the previously returned path and add the Dynatrace-specific dimensions to your metrics using the metrics ingestion protocol. Depending on the format you selected, the file contents will look like one of the following examples:
    ini
    dt.entity.process_group_instance=PROCESS_GROUP_INSTANCE-27204EFED3D8466E dt.entity.host=HOST-A0FE2A03244B9728
    or
    json
    { "dt.entity.process_group_instance": "PROCESS_GROUP_INSTANCE-27204EFED3D8466E", "dt.entity.host": "HOST-A0FE2A03244B9728" }

Limitations

  • Supported for full-stack and application-only deep-monitored processes
  • The stat and other if (exists) checks will fail for the file. These checks are not required for the mechanism to work.
  • syscalls used directly for file access aren't supported. This also means that the Go-based applications used for metric ingestion aren't supported unless you use the OneAgent SDK as explained in Send data to Dynatrace: Without OneAgent.