Use Markdown front matter to update DataDog's ServiceCatalog
Add this line to your application's Gemfile:
gem 'datadog-service_catalog'
You need:
Add the following to your Rakefile:
require 'datadog/service_catalog/rake_tasks'
namespace :service_catalog do
Datadog::ServiceCatalog.configure do |config|
config.datadog_api_key = '..'
config.datadog_application_key = '..'
config.markdown_file = 'service_info.md'
end
Datadog::ServiceCatalog::RakeTasks::Validate.new
Datadog::ServiceCatalog::RakeTasks::UploadAll.new(['service_catalog:validate'])
end
This provides two new rake tasks:
service_catalog:validate
- validate your service definitionservice_catalog:upload_all
- upload service definitions for alldatadog_service_identifiers
Add YAML front matter to the configuration specified Markdown file that follows the Service Catalog Schema. The one exception is a mandatory key datadog_service_identifiers
that is used by this gem to know what service(s) should get the specified service definition. You can review a full example in the sample_frontmatter.md file.
---
team: Homestars Enablement Team
datadog_service_identifiers:
- accounts-contracts-api
- accounts-contracts-api-postgres
- accounts-contracts-api-que
tags:
- accounts-contracts-api
# continue adding service catalog supported keys and values here ...
---
As you build your service definition, use rake service_catalog:validate
to ensure it is valid. Once your definition is complete use rake service_catalog:upload_all
to create or update your service catalog entries to DataDog.
Bug reports and pull requests are welcome on GitHub at https://github.com/homestars/datadog-service_catalog.