cd_e2e_monitoring_config/tools/serviceDetectionApi
qxz15oi 1339aa41e3 mobile config 2021-05-07 15:32:35 +02:00
..
data custom scripts/tools 2021-05-06 16:03:38 +02:00
README.md custom scripts/tools 2021-05-06 16:03:38 +02:00
config.ini custom scripts/tools 2021-05-06 16:03:38 +02:00
serviceDetectionApi.py mobile config 2021-05-07 15:32:35 +02:00

README.md

Service Detection Rules Configuration

Important: just for Dynatrace Experts. Test the rule first in a PreProd environment to validate it's behavior

  • Enables you to manage the configuration of service detection rules.
  • Split/Merge services based on specific rules

Download configuration

  1. Configure config.ini file:
    downloadConfig = 1
    updateConfig = 0
    
  2. Run the script:
    python serviceDetectionApi.py
    
  3. The configuration will appear under /data//FULL_WEB_REQUEST/<rule_id>.json

Create configuration

Use case: ServiceA has a KeyRequestA used in the SLO dashboard. After a new deployment, the team changed the web server name of their application (ServiceA) causing that Dynatrace detects the service as a new service (ServiceB). This new service doesn't have any keyRequest defined, so the SLO dashboard results incomplete

To fix this situation (or others such as changes in ports), you can create service detection rules to merge services with differences in their metadata

You can also use these rules to further split a service

  1. Configure config.ini file:
    deleteConfig = 0
    downloadConfig = 0
    updateConfig = 1
    
  2. Copy a rule from /data//FULL_WEB_REQUEST/ and paste it in the same folder. (Do not change the file name, it will be automatically changed once the rule is created)
  3. Modify the rule as intended.
  4. Remove the id from the rule and save it
  5. Run the script:
    python serviceDetectionApi.py
    
  6. Check if the file has automatically changed the name and if it has automatically added an "id" key (may be at the bottom)

Move configuration across tenants

  1. Configure config.ini file:
    deleteConfig = 0
    downloadConfig = 0
    updateConfig = 1
    
  2. Copy the <rule_id>.json file from tenantA
  3. Paste the rule into the tenant where you want to create the rule
  4. Delete the id from the rule definition, so the script recognize that it's a new rule
  5. Run the script:
    python serviceDetectionApi.py
    

Delete configuration

  1. Configure config.ini file:
    deleteConfig = 1
    downloadConfig = 0
    updateConfig = 0
    
  2. Remove the file of the rule you want to delete from the folder
  3. Run the script:
    python serviceDetectionApi.py
    
  4. The script will automatically compare the rules in the tenant vs the ones defined in the configuration folder. It will detect that there's one that has been deleted from the folder and it will ask you if you want to proceed deleting it from the tenant.
  • Press y or yes in case you want to proceed with the deletion
  • Press any other key to cancel the operation