Skip to content

[sql_input] Update manifest format_version to 3.* #14266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ vars:
hosts:
- sqlserver://SA:1234_asdf@{{Hostname}}
driver: "mssql"
sql_queries: "- query: SELECT counter_name, instance_name, cntr_value FROM sys.dm_os_performance_counters\n response_format: table\n- query: go\n response_format: table"
sql_queries: "- query: SELECT counter_name, instance_name, CAST(cntr_value AS VARCHAR(20)) AS cntr_value FROM sys.dm_os_performance_counters\n response_format: table\n- query: go\n response_format: table"
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ vars:
hosts:
- postgres://postgres:mysecretpassword@{{Hostname}}:{{Port}}/postgres?sslmode=disable
driver: "postgres"
sql_queries: "- query: SELECT * FROM pg_stat_database;\n response_format: table\n \n"
sql_queries: "- query: SELECT CAST(blks_read AS VARCHAR), CAST(blks_hit AS VARCHAR), CAST(tup_returned AS VARCHAR), CAST(tup_fetched AS VARCHAR), CAST(tup_inserted AS VARCHAR), CAST(tup_updated AS VARCHAR), CAST(tup_deleted AS VARCHAR) FROM pg_stat_database;\n response_format: table\n \n"
5 changes: 5 additions & 0 deletions packages/sql_input/changelog.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# newer versions go on top
- version: "0.8.0"
changes:
- description: Manifest version update to 3.*
type: enhancement
link: https://github.com/elastic/integrations/pull/14266
- version: "0.7.0"
changes:
- description: Make hosts field secret
Expand Down
2 changes: 1 addition & 1 deletion packages/sql_input/fields/input.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
description: Boolean values collected.
- name: metrics.*
description: Default mapping for metric fields. You need to add your own custom mappings when storing other kinds of information.
type: object
type: keyword
5 changes: 3 additions & 2 deletions packages/sql_input/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
format_version: 2.9.0
format_version: 3.3.2
name: sql
title: "SQL Input"
version: "0.7.0"
version: "0.8.0"
description: "Collects Metrics by querying SQL Databases"
type: input
categories:
Expand Down Expand Up @@ -77,3 +77,4 @@ policy_templates:
Processors are used to reduce the number of fields in the exported event or to enhance the event with metadata. This executes in the agent before the events are shipped. See [Processors](https://www.elastic.co/guide/en/fleet/current/elastic-agent-processor-configuration.html) for details.
owner:
github: elastic/obs-infraobs-integrations
type: elastic
27 changes: 2 additions & 25 deletions packages/sql_input/sample_event.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,31 +60,8 @@
"sql": {
"driver": "postgres",
"metrics": {
"active_time": 0,
"blk_read_time": 0,
"blk_write_time": 0,
"blks_hit": 453,
"blks_read": 87,
"conflicts": 0,
"datid": 0,
"deadlocks": 0,
"idle_in_transaction_time": 0,
"numbackends": 0,
"session_time": 0,
"sessions": 0,
"sessions_abandoned": 0,
"sessions_fatal": 0,
"sessions_killed": 0,
"temp_bytes": 0,
"temp_files": 0,
"tup_deleted": 0,
"tup_fetched": 50,
"tup_inserted": 24,
"tup_returned": 127,
"tup_updated": 5,
"xact_commit": 4,
"xact_rollback": 0
"current_time": "2024-06-19T06:12:37.604443Z"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the sample event does't have any fields from the query we are using now ?

},
"query": "SELECT * FROM pg_stat_database;"
"query": "SELECT NOW() AS current_time"
}
}