sentrysoftware / metricshub

Universal Metrics Collection for OpenTelemetry
https://metricshub.com
GNU Affero General Public License v3.0
12 stars 4 forks source link

Develop JDBC Extension #422

Open NassimBtk opened 3 hours ago

NassimBtk commented 3 hours ago

Specification

JDBC User's Configuration

metricshub.yaml

resources:
  db-host:
    attributes:
    # ...
    protocols:
      sql:
        username: #
        password: #
        url: #  
        timeout: # 
        type: # 
        port: # 
        database: #
Attribute Data Type Description Default Value
username string The username used to authenticate with the database. null
password char[] The password used for authentication (can be encrypted). null
url char[] The connection URL for the database (can be encrypted). null or generated based on type and database.
timeout int The time in seconds before a connection attempt times out. 120 seconds
type string The type of database engine (e.g., oracle, postgresql, mariadb, mssql, informix, derby, h2, ...). null
port int The port number to connect to the database. null or generated based on type
database string The database name to connect to. null

JDBC Source

<source-name>:
   type: sql
   query: # 
Attribute Key Data Type Description
type string Specifies the type of SQL source (sql).
query string The SQL query string to be executed (e.g., SELECT Column1, Column2 FROM TABLE).

To differentiate the current source, which executes inner SQL queries using the internal MetricsHub DB engine, we should consider renaming the type of the inner SQL source to reflect its engine-based nature. A suitable option could be coreSql.

NassimBtk commented 2 hours ago

@bertysentry your thoughts! 😉