github.com/lulzWill/go-agent@v2.1.2+incompatible/internal/crossagent/cross_agent_tests/datastores/README.md (about) 1 ## Datastore instance tests 2 3 The datastore instance tests provide attributes similar to what an agent could expect to find regarding a database configuration and specifies the expected [datastore instance metric](https://source.datanerd.us/agents/agent-specs/blob/master/Datastore-Metrics-PORTED.md#datastore-metric-namespace) that should be generated. The table below lists types attributes and whether will will always be included or optionally included in each test case. 4 5 | Name | Present | Description | 6 |---|---|---| 7 | system_hostname | always | the hostname of the machine | 8 | db_hostname | sometimes | the hostname reported by the database adapter | 9 | product | always | the database product for this configuration 10 | port | sometimes | the port reported by the database adapter | 11 | unix_socket | sometimes |the path to a unix domain socket reported by a database adapter | 12 | database_path | sometimes |the path to a filesystem database | 13 | expected\_instance\_metric | always | the instance metric expected to be generated from the given attributes | 14 15 ## Implementing the test cases 16 The idea behind these test cases are that you are able to determine a set of configuration properties from a database connection, and based on those properties you should generate the `expected_instance_metric`. Sometimes the properties available are minimal and will mean that you will need to fall back to defaults to obtain some of the information. When there is missing information from a database adapter the guiding principle is to fill in the defaults when they can be inferred, but do not make guesses that could be incorrect or misleading. Some agents may have access to better data and may not need to make inferences. If this applies to your agent then many of these tests will not be applicable.