newrelic / nri-mssql

New Relic Infrastructure Mssql Integration
MIT License
8 stars 19 forks source link

Ability to override instance name through configuration #166

Open david-garcia-garcia opened 2 weeks ago

david-garcia-garcia commented 2 weeks ago

Description

Currently, the entity name is constructed internally by the integration like this:

ms-instance:a7c4e04d109d:instance=a7c4e04d109d

Looking at the source code, this comes from:

const instanceNameQuery = "select COALESCE( @@SERVERNAME, SERVERPROPERTY('ServerName'), SERVERPROPERTY('MachineName')) as instance_name"

When working with dockerized/kuberentes environments, this stops making any sense:

image

The aim of the feature request is to add a configuration item that can be used to override the construct used to produce the inventory key manually.

Maybe something like this:

integrations:
# Integración de solo inventario, no requiere mucha frecuencia...
- name: nri-mssql
  env:
    HOSTNAME: ${HOSTNAME}
    USERNAME: ${USERNAME}
    PASSWORD: ${PASSWORD}
    ENABLE_SSL: true
    TRUST_SERVER_CERTIFICATE: true
    TIMEOUT: 8
    INVENTORY: true
    OVERRIDE_SERVERNAME: {myimaginaryserver}
    OVERRIDE_INSTANCENAME: {myinstance}
  interval: 20s
  labels:
    environment:
    role: mssql
  inventory_source: config/mssql

Acceptance Criteria

Describe Alternatives

Adding labels to the integration, and constructing the MSSQL panels on NR based on labels, which makes the out-of-the-box panels and inventories useless.

Dependencies

Additional context

Estimates

For Maintainers Only or Hero Triaging this bug

Suggested Priority (P1,P2,P3,P4,P5): Suggested T-Shirt size (S, M, L, XL, Unknown):

workato-integration[bot] commented 2 weeks ago

https://new-relic.atlassian.net/browse/NR-289942