Skip to content
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

Cherry-pick #17378 to 7.x: [Metricbeat] Add a switch to the driver definition on SQL module to use pretty names #17708

Merged
merged 3 commits into from
May 5, 2020

Conversation

sayden
Copy link
Contributor

@sayden sayden commented Apr 14, 2020

Cherry-pick of PR #17378 to 7.x branch. Original message:

What does this PR do?

SQL module directly passes the driver name to the sqlx library. This must match the library name used in Metricbeat: mysql for MySQL, postgresql for PostgreSQL but godror for Oracle which is ugly in terms of UX.

Why is it important?

Docs shouldn't fix UX issues so this PR fixes this in code.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

  • Launch Oracle Docker Image
docker run --name oracle -d -p 1521:1521 store/oracle/database-enterprise:12.2.0.1
# Module: sql
# Docs: https://www.elastic.co/guide/en/beats/metricbeat/7.7/metricbeat-module-sql.html

- module: sql
  metricsets:
    - query
  period: 10s
  hosts: ["oracle://sys:Oradoc_db1@172.17.0.2:1521/ORCLPDB1.localdomain?sysdba=1"]

  driver: "oracle"
  sql_query: "SELECT TABLESPACE_NAME, TABLESPACE_SIZE, ALLOCATED_SPACE, FREE_SPACE FROM DBA_TEMP_FREE_SPACE"
  sql_response_format: table
  • An event is generated with the driver name oracle

@sayden sayden self-assigned this Apr 14, 2020
@sayden sayden added Metricbeat Metricbeat Team:Services (Deprecated) Label for the former Integrations-Services team labels Apr 14, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-services (Team:Services)

@sayden sayden merged commit 2deccde into elastic:7.x May 5, 2020
@sayden sayden deleted the backport_17378_7.x branch October 29, 2021 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport Metricbeat Metricbeat review Team:Services (Deprecated) Label for the former Integrations-Services team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants