-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[discovery] Enable discovery mode for SQL Server receiver (#5109)
* SQL Server auto discovery * Update CHANGELOG.md * Update cmd/otelcol/config/collector/config.d.linux/receivers/sqlserver.discovery.yaml * Update internal/confmapprovider/discovery/README.md Co-authored-by: jvoravong <47871238+jvoravong@users.noreply.github.com> * Remove duplicate instructions, keep just the env variables --------- Co-authored-by: jvoravong <47871238+jvoravong@users.noreply.github.com> Co-authored-by: Dmitrii Anoshin <anoshindx@gmail.com> Co-authored-by: Antoine Toulme <antoine@lunar-ocean.com>
- Loading branch information
1 parent
a067a16
commit 07d294a
Showing
11 changed files
with
310 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
cmd/otelcol/config/collector/config.d.linux/receivers/sqlserver.discovery.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
##################################################################################### | ||
# This file is generated by the Splunk Distribution of the OpenTelemetry Collector. # | ||
# # | ||
# It reflects the default configuration bundled in the Collector executable for use # | ||
# in discovery mode (--discovery) and is provided for reference or customization. # | ||
# Please note that any changes made to this file will need to be reconciled during # | ||
# upgrades of the Collector. # | ||
##################################################################################### | ||
# sqlserver: | ||
# enabled: true | ||
# rule: | ||
# docker_observer: type == "container" and any([name, image, command], {# matches "(?i)mssql"}) and not (command matches "splunk.discovery") | ||
# host_observer: type == "hostport" and command matches "(?i)mssql" and not (command matches "splunk.discovery") | ||
# k8s_observer: type == "port" and pod.name matches "(?i)mssql" | ||
# config: | ||
# default: | ||
# username: splunk.discovery.default | ||
# password: splunk.discovery.default | ||
# server: '`host`' | ||
# port: '`port`' | ||
# resource_attributes: | ||
# sqlserver.instance.name: | ||
# enabled: true | ||
# metrics: | ||
# # Enable all OOTB dashboard default metrics | ||
# sqlserver.batch.request.rate: | ||
# enabled: true | ||
# sqlserver.batch.sql_compilation.rate: | ||
# enabled: true | ||
# sqlserver.batch.sql_recompilation.rate: | ||
# enabled: true | ||
# sqlserver.database.count: | ||
# enabled: true | ||
# sqlserver.database.io: | ||
# enabled: true | ||
# sqlserver.database.latency: | ||
# enabled: true | ||
# sqlserver.database.operations: | ||
# enabled: true | ||
# sqlserver.lock.wait.rate: | ||
# enabled: true | ||
# sqlserver.page.buffer_cache.hit_ratio: | ||
# enabled: true | ||
# sqlserver.processes.blocked: | ||
# enabled: true | ||
# sqlserver.resource_pool.disk.throttled.read.rate: | ||
# enabled: true | ||
# sqlserver.resource_pool.disk.throttled.write.rate: | ||
# enabled: true | ||
# sqlserver.user.connection.count: | ||
# enabled: true | ||
# # Disable upstream default metrics that OOTB dashboards don't use | ||
# sqlserver.lock.wait_time.avg: | ||
# enabled: false | ||
# sqlserver.page.checkpoint.flush.rate: | ||
# enabled: false | ||
# sqlserver.page.lazy_write.rate: | ||
# enabled: false | ||
# sqlserver.page.life_expectancy: | ||
# enabled: false | ||
# sqlserver.page.operation.rate: | ||
# enabled: false | ||
# sqlserver.page.split.rate: | ||
# enabled: false | ||
# sqlserver.transaction.rate: | ||
# enabled: false | ||
# sqlserver.transaction.write.rate: | ||
# enabled: false | ||
# sqlserver.transaction_log.flush.data.rate: | ||
# enabled: false | ||
# sqlserver.transaction_log.flush.rate: | ||
# enabled: false | ||
# sqlserver.transaction_log.flush.wait.rate: | ||
# enabled: false | ||
# sqlserver.transaction_log.growth.count: | ||
# enabled: false | ||
# sqlserver.transaction_log.shrink.count: | ||
# enabled: false | ||
# sqlserver.transaction_log.usage: | ||
# enabled: false | ||
# | ||
# status: | ||
# metrics: | ||
# - status: successful | ||
# strict: sqlserver.database.io | ||
# message: sqlserver receiver is working! | ||
# statements: | ||
# - status: failed | ||
# regexp: "connection refused" | ||
# message: The container is not serving http connections. | ||
# - status: failed | ||
# regexp: "unable to open tcp connection" | ||
# message: Unable to resolve sql server tcp endpoint | ||
# - status: partial | ||
# regexp: "Login failed for user" | ||
# message: >- | ||
# Make sure your user credentials are correctly specified using the | ||
# `SPLUNK_DISCOVERY_RECEIVERS_sqlserver_CONFIG_username="<username>"` and | ||
# `SPLUNK_DISCOVERY_RECEIVERS_sqlserver_CONFIG_password="<password>"` environment variables. | ||
# - status: partial | ||
# regexp: "The user does not have permission" | ||
# message: >- | ||
# Specified user does not have proper permissions. User must have view `SERVER STATE` permissions. | ||
# This can be accomplished by: `GRANT VIEW SERVER STATE TO [username]` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
100 changes: 100 additions & 0 deletions
100
internal/confmapprovider/discovery/bundle/bundle.d/receivers/sqlserver.discovery.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
##################################################################################### | ||
# Do not edit manually! # | ||
# All changes must be made to associated .tmpl file before running 'make bundle.d'. # | ||
##################################################################################### | ||
sqlserver: | ||
enabled: true | ||
rule: | ||
docker_observer: type == "container" and any([name, image, command], {# matches "(?i)mssql"}) and not (command matches "splunk.discovery") | ||
host_observer: type == "hostport" and command matches "(?i)mssql" and not (command matches "splunk.discovery") | ||
k8s_observer: type == "port" and pod.name matches "(?i)mssql" | ||
config: | ||
default: | ||
username: splunk.discovery.default | ||
password: splunk.discovery.default | ||
server: '`host`' | ||
port: '`port`' | ||
resource_attributes: | ||
sqlserver.instance.name: | ||
enabled: true | ||
metrics: | ||
# Enable all OOTB dashboard default metrics | ||
sqlserver.batch.request.rate: | ||
enabled: true | ||
sqlserver.batch.sql_compilation.rate: | ||
enabled: true | ||
sqlserver.batch.sql_recompilation.rate: | ||
enabled: true | ||
sqlserver.database.count: | ||
enabled: true | ||
sqlserver.database.io: | ||
enabled: true | ||
sqlserver.database.latency: | ||
enabled: true | ||
sqlserver.database.operations: | ||
enabled: true | ||
sqlserver.lock.wait.rate: | ||
enabled: true | ||
sqlserver.page.buffer_cache.hit_ratio: | ||
enabled: true | ||
sqlserver.processes.blocked: | ||
enabled: true | ||
sqlserver.resource_pool.disk.throttled.read.rate: | ||
enabled: true | ||
sqlserver.resource_pool.disk.throttled.write.rate: | ||
enabled: true | ||
sqlserver.user.connection.count: | ||
enabled: true | ||
# Disable upstream default metrics that OOTB dashboards don't use | ||
sqlserver.lock.wait_time.avg: | ||
enabled: false | ||
sqlserver.page.checkpoint.flush.rate: | ||
enabled: false | ||
sqlserver.page.lazy_write.rate: | ||
enabled: false | ||
sqlserver.page.life_expectancy: | ||
enabled: false | ||
sqlserver.page.operation.rate: | ||
enabled: false | ||
sqlserver.page.split.rate: | ||
enabled: false | ||
sqlserver.transaction.rate: | ||
enabled: false | ||
sqlserver.transaction.write.rate: | ||
enabled: false | ||
sqlserver.transaction_log.flush.data.rate: | ||
enabled: false | ||
sqlserver.transaction_log.flush.rate: | ||
enabled: false | ||
sqlserver.transaction_log.flush.wait.rate: | ||
enabled: false | ||
sqlserver.transaction_log.growth.count: | ||
enabled: false | ||
sqlserver.transaction_log.shrink.count: | ||
enabled: false | ||
sqlserver.transaction_log.usage: | ||
enabled: false | ||
|
||
status: | ||
metrics: | ||
- status: successful | ||
strict: sqlserver.database.io | ||
message: sqlserver receiver is working! | ||
statements: | ||
- status: failed | ||
regexp: "connection refused" | ||
message: The container is not serving http connections. | ||
- status: failed | ||
regexp: "unable to open tcp connection" | ||
message: Unable to resolve sql server tcp endpoint | ||
- status: partial | ||
regexp: "Login failed for user" | ||
message: >- | ||
Make sure your user credentials are correctly specified using the | ||
`SPLUNK_DISCOVERY_RECEIVERS_sqlserver_CONFIG_username="<username>"` and | ||
`SPLUNK_DISCOVERY_RECEIVERS_sqlserver_CONFIG_password="<password>"` environment variables. | ||
- status: partial | ||
regexp: "The user does not have permission" | ||
message: >- | ||
Specified user does not have proper permissions. User must have view `SERVER STATE` permissions. | ||
This can be accomplished by: `GRANT VIEW SERVER STATE TO [username]` |
96 changes: 96 additions & 0 deletions
96
internal/confmapprovider/discovery/bundle/bundle.d/receivers/sqlserver.discovery.yaml.tmpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
{{ receiver "sqlserver" }}: | ||
enabled: true | ||
rule: | ||
docker_observer: type == "container" and any([name, image, command], {# matches "(?i)mssql"}) and not (command matches "splunk.discovery") | ||
host_observer: type == "hostport" and command matches "(?i)mssql" and not (command matches "splunk.discovery") | ||
k8s_observer: type == "port" and pod.name matches "(?i)mssql" | ||
config: | ||
default: | ||
username: {{ defaultValue }} | ||
password: {{ defaultValue }} | ||
server: '`host`' | ||
port: '`port`' | ||
resource_attributes: | ||
sqlserver.instance.name: | ||
enabled: true | ||
metrics: | ||
# Enable all OOTB dashboard default metrics | ||
sqlserver.batch.request.rate: | ||
enabled: true | ||
sqlserver.batch.sql_compilation.rate: | ||
enabled: true | ||
sqlserver.batch.sql_recompilation.rate: | ||
enabled: true | ||
sqlserver.database.count: | ||
enabled: true | ||
sqlserver.database.io: | ||
enabled: true | ||
sqlserver.database.latency: | ||
enabled: true | ||
sqlserver.database.operations: | ||
enabled: true | ||
sqlserver.lock.wait.rate: | ||
enabled: true | ||
sqlserver.page.buffer_cache.hit_ratio: | ||
enabled: true | ||
sqlserver.processes.blocked: | ||
enabled: true | ||
sqlserver.resource_pool.disk.throttled.read.rate: | ||
enabled: true | ||
sqlserver.resource_pool.disk.throttled.write.rate: | ||
enabled: true | ||
sqlserver.user.connection.count: | ||
enabled: true | ||
# Disable upstream default metrics that OOTB dashboards don't use | ||
sqlserver.lock.wait_time.avg: | ||
enabled: false | ||
sqlserver.page.checkpoint.flush.rate: | ||
enabled: false | ||
sqlserver.page.lazy_write.rate: | ||
enabled: false | ||
sqlserver.page.life_expectancy: | ||
enabled: false | ||
sqlserver.page.operation.rate: | ||
enabled: false | ||
sqlserver.page.split.rate: | ||
enabled: false | ||
sqlserver.transaction.rate: | ||
enabled: false | ||
sqlserver.transaction.write.rate: | ||
enabled: false | ||
sqlserver.transaction_log.flush.data.rate: | ||
enabled: false | ||
sqlserver.transaction_log.flush.rate: | ||
enabled: false | ||
sqlserver.transaction_log.flush.wait.rate: | ||
enabled: false | ||
sqlserver.transaction_log.growth.count: | ||
enabled: false | ||
sqlserver.transaction_log.shrink.count: | ||
enabled: false | ||
sqlserver.transaction_log.usage: | ||
enabled: false | ||
|
||
status: | ||
metrics: | ||
- status: successful | ||
strict: sqlserver.database.io | ||
message: sqlserver receiver is working! | ||
statements: | ||
- status: failed | ||
regexp: "connection refused" | ||
message: The container is not serving http connections. | ||
- status: failed | ||
regexp: "unable to open tcp connection" | ||
message: Unable to resolve sql server tcp endpoint | ||
- status: partial | ||
regexp: "Login failed for user" | ||
message: >- | ||
Make sure your user credentials are correctly specified using the | ||
`{{ configPropertyEnvVar "username" "<username>" }}` and | ||
`{{ configPropertyEnvVar "password" "<password>" }}` environment variables. | ||
- status: partial | ||
regexp: "The user does not have permission" | ||
message: >- | ||
Specified user does not have proper permissions. User must have view `SERVER STATE` permissions. | ||
This can be accomplished by: `GRANT VIEW SERVER STATE TO [username]` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters