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

MSSQL and MySQL peer format can be changed to the same format as java by configuration #543

Merged
merged 4 commits into from
Feb 27, 2023

Conversation

inversionhourglass
Copy link
Contributor

@inversionhourglass inversionhourglass commented Feb 23, 2023

Please answer these questions before submitting pull request

  • Why submit this pull request?

  • Bug fix

  • New feature provided

  • Improve performance

  • Related issues


Bug fix

  • Bug description.

  • How to fix?


New feature or improvement

  • Describe the details and related test reports.
    The database peer format in java is unified as host:port
    public ConnectionInfo(OfficialComponent component, String dbType, String host, int port, String databaseName) {
        this.dbType = dbType;
        this.databasePeer = host + ":" + port;
        this.databaseName = databaseName;
        this.component = component;
    }

But in .NET, DbConnection.DataSource is generally used directly, and this format is generally not host:port. Different formats of the same database peer in .NET and Java will result in separate statistics for virtual databases. I've only changed the format for MSSQL and MySQL so far because I only use those two.

java agent数据库采集部分peer采用了统一的格式host:port,.NET中一般直接使用DbConnection.DataSource,格式基本都不是host:port,如果.NET和java使用同一个库,最后在虚拟数据库界面上会显示两个实例,这个PR增加了一个配置可以支持使用java agent相同的格式,默认还是之前的格式。这个PR中只支持MSSQL和MySQL,其他数据库我没用到就先不改了。

{
  "SkyWalking": {
    "Tracing": {
      "DbPeerSimpleFormat": false      // default false
    }
  }
}

@wu-sheng wu-sheng added this to the 2.2.0 milestone Feb 23, 2023
@wu-sheng wu-sheng added the enhancement New feature or request label Feb 23, 2023
@liuhaoyang
Copy link
Collaborator

LGTM

@inversionhourglass
Copy link
Contributor Author

Is this forgot to merge?

@wu-sheng wu-sheng merged commit 06d0fa8 into SkyAPM:main Feb 27, 2023
@wu-sheng
Copy link
Member

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants