diff --git a/sap_hana/assets/configuration/spec.yaml b/sap_hana/assets/configuration/spec.yaml new file mode 100644 index 0000000000000..07182ce60fb2d --- /dev/null +++ b/sap_hana/assets/configuration/spec.yaml @@ -0,0 +1,49 @@ +name: SAP HANA +files: +- name: sap_hana.yaml + options: + - template: init_config + options: + - template: init_config/db + - template: init_config/default + - template: instances + options: + - name: server + description: The hostname used to connect to the system. + required: true + value: + type: string + - name: port + description: The port used to connect to the system. + value: + type: integer + default: 30015 + - name: username + description: The database user to authenticate as. + required: true + value: + type: string + - name: password + description: The password of `username`. + required: true + value: + type: string + - name: use_hana_hostnames + description: | + Whether or not to use the hostnames contained in HANA's monitoring + views instead of the Agent hostname. + value: + type: boolean + example: false + - name: batch_size + description: The number of rows to return with each query result. + value: + type: integer + default: 1000 + - name: timeout + description: The timeout in seconds for connecting to `server`. + value: + type: integer + default: 10 + - template: instances/db + - template: instances/default diff --git a/sap_hana/datadog_checks/sap_hana/data/conf.yaml.example b/sap_hana/datadog_checks/sap_hana/data/conf.yaml.example index 3368338e6440b..618f38d694a40 100644 --- a/sap_hana/datadog_checks/sap_hana/data/conf.yaml.example +++ b/sap_hana/datadog_checks/sap_hana/data/conf.yaml.example @@ -1,16 +1,27 @@ +## All options defined here are available to all instances. +# init_config: - ## @param global_custom_queries - list - optional + + ## @param global_custom_queries - list of mappings - optional ## See `custom_queries` defined below. ## ## Global custom queries can be applied to all instances using the ## `use_global_custom_queries` setting at the instance level. # # global_custom_queries: - # - metric_prefix: ibm_db2 - # query: + # - query: # columns: # tags: + ## @param service - string - optional + ## Attach the tag `service:` to every metric, event, and service check emitted by this integration. + ## + ## Additionally, this sets the default `service` for every log source. + # + # service: + +## Every instance is scheduled independent of the others. +# instances: ## @param server - string - required @@ -18,10 +29,10 @@ instances: # - server: - ## @param port - integer - required - default: 39015 + ## @param port - integer - optional - default: 30015 ## The port used to connect to the system. # - port: 39015 + # port: ## @param username - string - required ## The database user to authenticate as. @@ -42,61 +53,78 @@ instances: ## @param batch_size - integer - optional - default: 1000 ## The number of rows to return with each query result. # - # batch_size: 1000 + # batch_size: ## @param timeout - integer - optional - default: 10 - ## The timeout for connecting to `server`. + ## The timeout in seconds for connecting to `server`. # - # timeout: 10 - - ## @param tags - list of key:value strings - optional - ## List of tags to attach to every metric and service check emitted by this instance. - ## - ## Learn more about tagging at https://docs.datadoghq.com/tagging - # - # tags: - # - : - # - : + # timeout: ## @param use_global_custom_queries - string - optional - default: true ## How `global_custom_queries` should be used for this instance. There are 3 options: ## - ## 1. true - `global_custom_queries` will override `custom_queries` - ## 2. false - `custom_queries` will override `global_custom_queries` - ## 2. extend - `global_custom_queries` will be used in addition to any `custom_queries` + ## 1. true - `global_custom_queries` override `custom_queries`. + ## 2. false - `custom_queries` override `global_custom_queries`. + ## 3. extend - `global_custom_queries` are used in addition to any `custom_queries`. # - # use_global_custom_queries: true + # use_global_custom_queries: 'true' - ## @param custom_queries - list - optional - ## Each query must have 2 fields: + ## @param custom_queries - list of mappings - optional + ## Each query must have 2 fields, and can have a third optional field: ## - ## 1. query - This is the SQL to execute. It can be a simple statement or a multi-line script. - ## 2. columns - This is a list representing each column, ordered sequentially from left to right. + ## 1. query - The SQL to execute. It can be a simple statement or a multi-line script. + ## Use the pipe `|` if you require a multi-line script. + ## 2. columns - The list representing each column, ordered sequentially from left to right. ## The number of columns must equal the number of columns returned in the query. ## There are 2 required pieces of data: - ## a. name - This is the suffix to append to `sap_hana.` in order to form - ## the full metric name. If `type` is `tag`, this column will - ## instead be considered a tag and will be applied to every + ## a. name - The suffix to append to `.` to form + ## the full metric name. If `type` is `tag`, this column is + ## considered a tag and applied to every ## metric collected by this particular query. - ## b. type - This is the submission method (gauge, monotonic_count, etc.). + ## b. type - The submission method (gauge, monotonic_count, etc.). ## This can also be set to `tag` to tag each metric in the row ## with the name and value of the item in this column. You can ## use the `count` type to perform aggregation for queries that ## return multiple rows with the same or no tags. + ## Columns without a name are ignored. To skip a column, enter: + ## - {} ## 3. tags (optional) - A list of tags to apply to each metric. # # custom_queries: - # - query: | # Use the pipe if you require a multi-line script. - # SELECT DATABASE_NAME, - # COUNT(*) - # FROM SYS_DATABASES.M_DATA_VOLUMES - # GROUP BY DATABASE_NAME + # - query: SELECT foo, COUNT(*) FROM table.events GROUP BY foo # columns: - # # Columns without a name are ignored, put this for any column you wish to skip: - # # - {} - # - name: db - # type: tag - # - name: data_volume.total - # type: gauge + # - name: foo + # type: tag + # - name: event.total + # type: gauge # tags: - # - test:sap_hana + # - test: + + ## @param tags - list of strings - optional + ## A list of tags to attach to every metric and service check emitted by this instance. + ## + ## Learn more about tagging at https://docs.datadoghq.com/tagging + # + # tags: + # - : + # - : + + ## @param service - string - optional + ## Attach the tag `service:` to every metric, event, and service check emitted by this integration. + ## + ## Overrides any `service` defined in the `init_config` section. + # + # service: + + ## @param min_collection_interval - number - optional - default: 15 + ## This changes the collection interval of the check. For more information, see: + ## https://docs.datadoghq.com/developers/write_agent_check/#collection-interval + # + # min_collection_interval: 15 + + ## @param empty_default_hostname - boolean - optional - default: false + ## This forces the check to send metrics with no hostname. + ## + ## This is useful for cluster-level checks. + # + # empty_default_hostname: false diff --git a/sap_hana/manifest.json b/sap_hana/manifest.json index 15dd01f754534..d793f9358c751 100644 --- a/sap_hana/manifest.json +++ b/sap_hana/manifest.json @@ -22,6 +22,9 @@ "is_public": true, "integration_id": "sap-hana", "assets": { + "configuration": { + "spec": "assets/configuration/spec.yaml" + }, "dashboards": { "SAP HANA Overview": "assets/dashboards/overview.json" }, diff --git a/sap_hana/setup.py b/sap_hana/setup.py index d850a99995e5a..149f308f80e5f 100644 --- a/sap_hana/setup.py +++ b/sap_hana/setup.py @@ -27,7 +27,7 @@ def get_dependencies(): return f.readlines() -CHECKS_BASE_REQ = 'datadog-checks-base>=4.2.0' +CHECKS_BASE_REQ = 'datadog-checks-base>=11.0.0' setup(