Currently the queue entity schema only supports componentOf but not dependsOn nor dependencyOf, whereas the datastore entity schema supports all three.
For example, I have a service entity that depends on queue entities with names that include an env suffix.
For the purposes of this example, you can imagine these queues as having env-qualified names because they all live in one AWS account, but in practice I've encountered this in various situations where business or compliance requirements dictate that resource names include the env, even when they exist in separate accounts, brokers, vhosts, etc.
Now I could include the queue names in the service entity's spec.dependsOn field, but doing so would mean hard-coding queue names that are normally interpolated from variables that vary across target envs.
Having tried this, I can also report that the Datadog UI seems to then show all of those queues as dependencies for that service, regardless of what env filter I have set.
(For example, imagine I'm trying to avoid hard-coding my_queue_test1, my_queue_test2, my_queue_test3, and so on, because those are normally interpolated as my_queue_{env}, and the service entity is only included in my terraform module for env:production; hopefully this helps demonstrate how messy this becomes, even in a simplified/toy example.)
It would be better if I could instead include the service entity's (non-env-qualified) name in each queue entity's spec.dependencyOf field.
This would allow me to express that this env-specific queue is a dependency of this service within its specific env.
Ideally this would work such that each env-specific queue would only appear in the Datadog UI when I am filtered to its specific env.
Obviously that is unlikely to be the case today, but I think the first step toward getting there would be amending the schemas to allow us to accurately express that relationship.
datastore.schema.json
|
"spec": { |
|
"type": "object", |
|
"additionalProperties": false, |
|
"properties": { |
|
"lifecycle": { |
|
"type": "string", |
|
"description": "The lifecycle state of the datastore.", |
|
"examples": [ |
|
"experimental", |
|
"production", |
|
"deprecated" |
|
], |
|
"minLength": 1 |
|
}, |
|
"tier": { |
|
"type": "string", |
|
"description": "The importance of the datastore", |
|
"examples": [ |
|
"1", |
|
"High" |
|
], |
|
"minLength": 1 |
|
}, |
|
"type": { |
|
"description": "The type of datastore", |
|
"examples": [ |
|
"redis", |
|
"postgres", |
|
"cassandra" |
|
], |
|
"type": "string" |
|
}, |
|
"componentOf": { |
|
"description": "A list of components the datastore is a part of", |
|
"examples": [ |
|
"system:my-example-system", |
|
"service:myapp" |
|
], |
|
"type": "array", |
|
"items": { |
|
"type": "string" |
|
} |
|
}, |
|
"dependsOn": { |
|
"description": "A list of components the datastore depends on", |
|
"examples": [ |
|
"service:myapp", |
|
"queue:myqueue", |
|
"datastore:mydatastore", |
|
"library:mylibrary" |
|
], |
|
"type": "array", |
|
"items": { |
|
"type": "string" |
|
} |
|
}, |
|
"dependencyOf": { |
|
"description": "A list of components the datastore is a dependency of", |
|
"examples": [ |
|
"service:parentapp" |
|
], |
|
"type": "array", |
|
"items": { |
|
"type": "string" |
|
} |
|
} |
|
} |
|
}, |
queue.schema.json
|
"spec": { |
|
"type": "object", |
|
"additionalProperties": false, |
|
"properties": { |
|
"lifecycle": { |
|
"type": "string", |
|
"description": "The lifecycle state of the queue.", |
|
"examples": [ |
|
"experimental", |
|
"production", |
|
"deprecated" |
|
], |
|
"minLength": 1 |
|
}, |
|
"tier": { |
|
"type": "string", |
|
"description": "The importance of the queue", |
|
"examples": [ |
|
"1", |
|
"High" |
|
], |
|
"minLength": 1 |
|
}, |
|
"type": { |
|
"description": "The type of queue", |
|
"examples": [ |
|
"kafka", |
|
"rabbitmq" |
|
], |
|
"type": "string" |
|
}, |
|
"componentOf": { |
|
"description": "A list of components the queue is a part of", |
|
"examples": [ |
|
"system:my-example-system", |
|
"service:myapp" |
|
], |
|
"type": "array", |
|
"items": { |
|
"type": "string" |
|
} |
|
} |
|
} |
|
}, |
Currently the queue entity schema only supports
componentOfbut notdependsOnnordependencyOf, whereas the datastore entity schema supports all three.For example, I have a service entity that depends on queue entities with names that include an
envsuffix.For the purposes of this example, you can imagine these queues as having env-qualified names because they all live in one AWS account, but in practice I've encountered this in various situations where business or compliance requirements dictate that resource names include the env, even when they exist in separate accounts, brokers, vhosts, etc.
Now I could include the queue names in the service entity's
spec.dependsOnfield, but doing so would mean hard-coding queue names that are normally interpolated from variables that vary across target envs.Having tried this, I can also report that the Datadog UI seems to then show all of those queues as dependencies for that service, regardless of what env filter I have set.
(For example, imagine I'm trying to avoid hard-coding
my_queue_test1,my_queue_test2,my_queue_test3, and so on, because those are normally interpolated asmy_queue_{env}, and the service entity is only included in my terraform module forenv:production; hopefully this helps demonstrate how messy this becomes, even in a simplified/toy example.)It would be better if I could instead include the service entity's (non-env-qualified) name in each queue entity's
spec.dependencyOffield.This would allow me to express that this env-specific queue is a dependency of this service within its specific env.
Ideally this would work such that each env-specific queue would only appear in the Datadog UI when I am filtered to its specific env.
Obviously that is unlikely to be the case today, but I think the first step toward getting there would be amending the schemas to allow us to accurately express that relationship.
datastore.schema.jsonschema/service-catalog/v3/datastore.schema.json
Lines 30 to 97 in c29d30d
queue.schema.jsonschema/service-catalog/v3/queue.schema.json
Lines 30 to 73 in c29d30d