# Use the metadata charm helper to load the metadata.yaml for datadog
# charm dynamically and parse requires relations
integrations = metadata().get('requires').keys()
# Loop over all the integrations defined in the charms metadata and
# check if they're available (ready to be configured)
for integration in integrations:
if is_state('{}.available'.format(integration)):
# Load up the interfaces from reactive, extract the goodies
# and write out configuration files
rel_data = RelationBase.from_state(integration)
config_keys = rel_data.auto_accessors
configuration = {k: rel_data.k() for k in config_keys}