newrelic / nri-flex

An application-agnostic, all-in-one New Relic integration integration
https://docs.newrelic.com/docs/introduction-new-relics-flex-integration
Apache License 2.0
107 stars 119 forks source link

Azure SQL Custom query configuration using nri-flex unable to connect to the database #511

Closed Chelladurai-Selvaraj closed 1 month ago

Chelladurai-Selvaraj commented 1 month ago

^^ Provide a general summary of the issue in the title above. ^^

Description

I have configured the Azure SQL integration using flex for custom query execution. But facing below error message and its not able to connect to the database. I have checked the connectivity from the same server to Azure SQL database and its working fine.

err="sql: unknown driver \\"\\" (forgotten import?)"

Expected Behavior

Custom query configured in the flex yaml to be executed in the Azure SQL database and output data visible in Newrelic portal.

Troubleshooting or [NR Diag]

Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="Starting integrations group." component=integrations.Manager file=/etc/newrelic-infra/integrations.d/docker-config.yml Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="Starting integrations group." component=integrations.Manager file=/etc/newrelic-infra/integrations.d/flex-sql.yml Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="Watching for integrations file changes." component=integrations.Manager function=watchForChanges Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="Watching for logging config file changes." component=integrations.Supervisor process=config-changes-watcher Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="Running task." component=integrations.Definition integration_name=nri-flex Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="Running through all discovery matches." component=integrations.Definition discovery_matchers="map[]" discovery_name= discovery_type= integration_name=nri-flex Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="Creating discovered file." component=integrations.Definition file=/tmp/discovered1667693115 Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="Executing task." component=integrations.Definition integration_name=nri-flex Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="Waiting while the integration instances run." component=integrations.runner.Runner integration_name=nri-flex runner_uid=241daa5c93 Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="Running command." command=/opt/newrelic-infra/newrelic-integrations/bin/nri-flex component=integrations.Executor env="[NRI_CONFIG_INTERVAL=30s CONFIG_PATH=/tmp/discovered1667693115 PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin VERBOSE=1 NRI_HOST_ID=5182f782-7768-4bed-b98a-bab3f4545ae1 TEMP_DIR=/tmp/nr-integrations]" integration_name=nri-flex path=/opt/newrelic-infra/newrelic-integrations/bin/nri-flex Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="integration log" GOARCH=amd64 GOOS=linux component=integrations.runner.Runner fields.level=info fields.msg=com.newrelic.nri-flex fields.time="2024-07-12T10:33:52Z" integration_name=nri-flex runner_uid=241daa5c93 version=1.15.0 Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="integration log" component=integrations.runner.Runner fields.level=debug fields.msg="config: git sync configuration not set" fields.time="2024-07-12T10:33:52Z" integration_name=nri-flex runner_uid=241daa5c93 Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="integration log" component=integrations.runner.Runner fields.level=debug fields.msg="config: running async" fields.time="2024-07-12T10:33:52Z" integration_name=nri-flex name=TestAzureSQLDbFlex runner_uid=241daa5c93 Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="integration log" apis=1 component=integrations.runner.Runner fields.level=debug fields.msg="config: processing apis" fields.time="2024-07-12T10:33:52Z" integration_name=nri-flex name=TestAzureSQLDbFlex runner_uid=241daa5c93 Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="integration log" component=integrations.runner.Runner fields.level=debug fields.msg="fetch: collect data" fields.time="2024-07-12T10:33:52Z" integration_name=nri-flex name=TestAzureSQLDbFlex runner_uid=241daa5c93 Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="integration log" component=integrations.runner.Runner database=TESTSQL fields.level=debug fields.msg="database: process queries" fields.time="2024-07-12T10:33:52Z" integration_name=nri-flex name=TestAzureSQLDbFlex runner_uid=241daa5c93 Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="integration log" component=integrations.runner.Runner database=TESTSQL err="sql: unknown driver \\"\\" (forgotten import?)" fields.level=debug fields.msg="database: unable to connect" fields.time="2024-07-12T10:33:52Z" integration_name=nri-flex name=TestAzureSQLDbFlex runner_uid=241daa5c93 Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="integration log" component=integrations.runner.Runner fields.level=debug fields.msg="processor-data: running data handler" fields.time="2024-07-12T10:33:52Z" integration_name=nri-flex name=TestAzureSQLDbFlex runner_uid=241daa5c93 Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="integration log" apis=1 component=integrations.runner.Runner fields.level=debug fields.msg="config: finished variable processing apis" fields.time="2024-07-12T10:33:52Z" integration_name=nri-flex name=TestAzureSQLDbFlex runner_uid=241daa5c93 Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="integration log" component=integrations.runner.Runner configs=1 fields.level=info fields.msg="flex: completed processing configs" fields.time="2024-07-12T10:33:52Z" integration_name=nri-flex runner_uid=241daa5c93 Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=debug msg="Received payload." component=integrations.emitter.Emitter env="map[NRI_CONFIG_INTERVAL:30s]" integration_name=nri-flex payload="{\"name\":\"com.newrelic.nri-flex\",\"protocol_version\":\"3\",\"integration_version\":\"1.15.0\",\"data\":[{\"metrics\":[{\"errorMsg\":\"sql: unknown driver \\"\\" (forgotten import?)\",\"event_type\":\"TESTSQLError\"},{\"event_type\":\"flexStatusSample\",\"flex.Hostname\":\"vm-new-relic-linux\",\"flex.IntegrationVersion\":\"1.15.0\",\"flex.counter.ConfigsProcessed\":1,\"flex.counter.EventCount\":1,\"flex.counter.EventDropCount\":0,\"flex.counter.TESTSQLError\":1,\"flex.time.elapsedMs\":4,\"flex.time.endMs\":1720780432441,\"flex.time.startMs\":1720780432437}],\"inventory\":{},\"events\":[]}]}" Jul 12 10:33:52 vm-new-relic-linux newrelic-infra-service[196198]: time="2024-07-12T10:33:52Z" level=info msg="Integration health check finished with success" component=integrations.runner.Runner integration_name=nri-flex runner_uid=241daa5c93

Steps to Reproduce

Install the newrelic infrastructure agent and configure the flex yaml file as below. A user has to be created in Azure SQL DB with read only permission.

integrations:

Your Environment

Newrelic Infrastructure agent version - 1.53.0 Operating System - Ubuntu 20.04.6

Additional context

For Maintainers Only or Hero Triaging this bug

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

workato-integration[bot] commented 1 month ago

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

davidgit commented 1 month ago

Hi ,

The next best step is to visit New Relic Support, where you can engage the New Relic Support Community or open a support ticket depending on your support level. The support team is best positioned to assist with your specific needs.

Please provide a link to this GitHub issue when submitting your community post or support ticket.

Thanks!