Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: "3.11"

- name: Install dependencies
run: |
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: "3.11"

- name: Install dependencies
run: |
Expand All @@ -66,7 +66,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Git LFS
run: git lfs install

Expand All @@ -76,7 +76,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.12'
python-version: "3.11.12"

- name: Install dependencies
run: |
Expand All @@ -99,7 +99,7 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Install Git LFS
run: git lfs install

Expand All @@ -109,7 +109,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11.12'
python-version: "3.11.12"

- name: Install dependencies
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ jobs:
run: |
chmod +x *.sh
./package.sh full
BUILD_NUMBER=$(grep 'BUILD =' build/_version.py | awk '{print $3}')
echo "ZIP_NAME=dynatrace_snowflake_observability_agent-${{ steps.get_version.outputs.VERSION }}.${BUILD_NUMBER}.zip" >> $GITHUB_OUTPUT
BUILD_NR=$(grep 'BUILD =' build/_version.py | awk '{print $3}')
echo "ZIP_NAME=dynatrace_snowflake_observability_agent-${{ steps.get_version.outputs.VERSION }}.${BUILD_NR}.zip" >> $GITHUB_OUTPUT
echo "PDF_NAME=Dynatrace-Snowflake-Observability-Agent-${{ steps.get_version.outputs.VERSION }}.pdf" >> $GITHUB_OUTPUT

- name: Upload build artifacts
Expand Down
6 changes: 6 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"tabWidth": 2,
"useTabs": false,
"printWidth": 140,
"proseWrap": "always"
}
11 changes: 10 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"editor.formatOnPaste": true,
"editor.tabSize": 2,
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.rulers": [140],
"debug.javascript.terminalOptions": {},
"debug.javascript.debugByLinkOptions": "on",
"black-formatter.args": [
Expand Down Expand Up @@ -123,6 +124,7 @@
"uuidgen",
"venv",
"Vidhya",
"viewsend",
"Waltham",
"weasyprint",
"xdist",
Expand Down Expand Up @@ -180,9 +182,16 @@
"editor.formatOnSave": false,
"editor.defaultFormatter": null
},
"files.trimTrailingWhitespace": true,
"files.associations": {
".sqlfluff": "ini"
},
"markdown.extension.tableFormatter.normalizeIndentation": true,
"editor.indentSize": "tabSize"
"editor.indentSize": "tabSize",
"[yml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[yaml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
19 changes: 13 additions & 6 deletions .yamllint
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,25 @@ extends: default
rules:
line-length:
max: 140
level: warning
level: error
indentation:
spaces: 2
level: warning
level: error
document-start:
present: false
trailing-spaces:
level: warning
level: error
empty-lines:
max: 2
level: warning
level: error
new-line-at-end-of-file:
level: warning
level: error
brackets:
level: warning
level: error
# GitHub Actions use "on" as a key, which conflicts with the truthy check.
truthy: disable
# Prettier and yamllint have conflicting comment spacing rules.
comments: disable
# Ignore virtual environment directories
ignore: |
.venv/
2 changes: 1 addition & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ Example of task status bizevent payload.
"event.type": "dsoa.task",
"host.name": "snowflakecomputing.com",
"service.name": "dynatrace",
"dsoa.run.context": "self-monitoring",
"dsoa.run.context": "self_monitoring",
"dsoa.run.id": "2c8988a1b94d43aeaa11d3c83d45468b",
"dsoa.task.exec.id": "2025-03-18 10:58:59.364252",
"dsoa.task.exec.status": "STARTED",
Expand Down
5 changes: 3 additions & 2 deletions SEMANTICS.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
| Identifier | Description | Example |
|------------|-------------|---------|
| dsoa.​run.​id | Unique ID of each execution of the Dynatrace Snowflake Observability Agent plugin. It can be used to differentiate between telemetry produced between two executions, e.g., to calculate the change in the system. | 4aa7c76c-e98c-4b8b-a5b3-a8a721bbde2d |
| observed_timestamp | The timestamp (in epoch nanoseconds) when the event was observed. | 1741768500000000000 |
| snowflake.​event.​type | Type of (timestamp based) event | snowflake.table.update |

<a name="active_queries_semantics_sec"></a>
Expand Down Expand Up @@ -139,8 +140,8 @@ All telemetry delivered by this plugin is reported as `dsoa.run.context == "data
|------------|-------------|---------|
| db.&#8203;user | The user who issued the query. | SYSTEM |
| snowflake.&#8203;object.&#8203;ddl.&#8203;modified | A JSON array that specifies the objects that were associated with a write operation in the query. | { "DTAGENT_DB.APP.TMP_RECENT_QUERIES": { "objectColumns": "HISTOGRAM_METRICS, COUNTER_METRICS, START_TIME, STATUS_CODE, SESSION_ID, QUERY_ID, DIMENSIONS, END_TIME, NAME, ATTRIBUTES, PARENT_QUERY_ID", "objectDomain": "Table" } } |
| snowflake.&#8203;object.&#8203;ddl.&#8203;operation | The SQL keyword that specifies the operation on the table, view, or column: <br>- ALTER, <br>- CREATE, <br>- DROP, <br>- REPLACE, <br>- UNDROP. | REPLACE |
| snowflake.&#8203;object.&#8203;ddl.&#8203;properties | A JSON array that specifies the object or column properties when you create, modify, drop, or undrop the object or column. There are two types of properties: atomic and compound. | {"creationMode": "CREATE", "columns": {"ADD": ["ATTRIBUTE","JOB_ID"]}} |
| snowflake.&#8203;object.&#8203;ddl.&#8203;operation | The SQL keyword that specifies the operation on the table, view, or column: <br>- ALTER, <br>- CREATE, <br>- DROP, <br>- REPLACE, <br>- UNDROP. | REPLACE |
| snowflake.&#8203;object.&#8203;ddl.&#8203;properties | A JSON array that specifies the object or column properties when you create, modify, drop, or undrop the object or column. There are two types of properties: atomic and compound. | {"creationMode": "CREATE", "columns": {"ADD": ["ATTRIBUTE","JOB_ID"]}} |
| snowflake.&#8203;object.&#8203;id | An identifier for the object, which is unique within a given account and domain. | 747545 |
| snowflake.&#8203;object.&#8203;name | The fully qualified name of the object defined or modified by the DDL operation. | DTAGENT_DB.APP.TMP_RECENT_QUERIES |
| snowflake.&#8203;object.&#8203;type | The domain of the object defined or modified by the DDL operation, which includes all objects that can be tagged and: <br>- MASKING POLICY, <br>- ROW ACCESS POLICY, <br>- TAG. | Table |
Expand Down
29 changes: 16 additions & 13 deletions docs/dashboards/costs-monitoring/costs-monitoring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ tiles:
inputData: null
"1":
type: markdown
content: '# Resource Monitors'
content: "# Resource Monitors"
davis:
componentState:
inputData: null
Expand Down Expand Up @@ -330,19 +330,19 @@ tiles:
rules:
- id: 0
color:
Default: 'var(--dt-colors-charts-categorical-color-09-default, #649438)'
Default: "var(--dt-colors-charts-categorical-color-09-default, #649438)"
comparator: <
label: ""
value: 50
- id: 1
color:
Default: 'var(--dt-colors-charts-categorical-color-14-default, #d56b1a)'
Default: "var(--dt-colors-charts-categorical-color-14-default, #d56b1a)"
comparator: <
label: ""
value: 99
- id: 2
color:
Default: 'var(--dt-colors-charts-categorical-color-12-default, #cd3741)'
Default: "var(--dt-colors-charts-categorical-color-12-default, #cd3741)"
comparator: ≥
label: ""
value: 100
Expand All @@ -364,7 +364,7 @@ tiles:
inputData: null
"4":
type: markdown
content: '# Warehouses'
content: "# Warehouses"
davis:
componentState:
inputData: null
Expand Down Expand Up @@ -407,19 +407,19 @@ tiles:
rules:
- id: 0
color:
Default: 'var(--dt-colors-charts-categorical-color-09-default, #649438)'
Default: "var(--dt-colors-charts-categorical-color-09-default, #649438)"
comparator: =
label: ""
value: INFO
- id: 1
color:
Default: 'var(--dt-colors-charts-categorical-color-14-default, #d56b1a)'
Default: "var(--dt-colors-charts-categorical-color-14-default, #d56b1a)"
comparator: =
label: ""
value: WARN
- id: 2
color:
Default: 'var(--dt-colors-charts-categorical-color-12-default, #cd3741)'
Default: "var(--dt-colors-charts-categorical-color-12-default, #cd3741)"
comparator: =
label: ""
value: ERROR
Expand Down Expand Up @@ -661,19 +661,19 @@ tiles:
rules:
- id: 0
color:
Default: 'var(--dt-colors-charts-categorical-color-09-default, #649438)'
Default: "var(--dt-colors-charts-categorical-color-09-default, #649438)"
comparator: <
label: ""
value: 50
- id: 1
color:
Default: 'var(--dt-colors-charts-categorical-color-14-default, #d56b1a)'
Default: "var(--dt-colors-charts-categorical-color-14-default, #d56b1a)"
comparator: <
label: ""
value: 99
- id: 2
color:
Default: 'var(--dt-colors-charts-categorical-color-12-default, #cd3741)'
Default: "var(--dt-colors-charts-categorical-color-12-default, #cd3741)"
comparator: ≥
label: ""
value: 100
Expand Down Expand Up @@ -782,7 +782,7 @@ tiles:
visibleSections: VISUALIZATION
"10":
type: markdown
content: '# Slow queries'
content: "# Slow queries"
davis:
componentState:
inputData: null
Expand Down Expand Up @@ -1181,7 +1181,10 @@ tiles:
deployment.environment,
snowflake.warehouse.name
}
| fieldsAdd warehouse_events = record( ts = start_events[], event_delay = finish_events[] - start_events[], warehouse_action = warehouse_action[])
| fieldsAdd warehouse_events = record(
ts = start_events[],
event_delay = finish_events[] - start_events[],
warehouse_action = warehouse_action[])
| expand warehouse_events
| fields event_timestamp = warehouse_events[ts],
deployment.environment,
Expand Down
20 changes: 12 additions & 8 deletions docs/dashboards/self-monitoring/self-monitoring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ variables:
| filter in(deployment.environment, array($Accounts))
| filter matchesPattern(db.query.text,
"""'call DTAGENT' ('_' LD:tag)? '_DB.APP.DTAGENT(ARRAY_CONSTRUCT(' ARRAY{SQS:plugin_name ', '?}{1,}:plugin_names '))'""")
| parse `db.query.text`, """'call DTAGENT' ('_' LD:env_tag)? '_DB.APP.DTAGENT(ARRAY_CONSTRUCT(' ARRAY{SQS:plugin_name ', '?}{1,}:plugin_names '))'"""
| parse `db.query.text`,
"""'call DTAGENT' ('_' LD:env_tag)? '_DB.APP.DTAGENT(ARRAY_CONSTRUCT(' ARRAY{SQS:plugin_name ', '?}{1,}:plugin_names '))'"""
| expand plugin_name = plugin_names
| fields plugin_name
| dedup plugin_name
Expand All @@ -73,7 +74,8 @@ variables:
| filter in(deployment.environment, array($Accounts))
| filter matchesPattern(db.query.text,
"""'call DTAGENT' ('_' LD:tag)? '_DB.APP.DTAGENT(ARRAY_CONSTRUCT(' ARRAY{SQS:plugin_name ', '?}{1,}:plugin_names '))'""")
| parse `db.query.text`, """'call DTAGENT' ('_' LD:env_tag)? '_DB.APP.DTAGENT(ARRAY_CONSTRUCT(' ARRAY{SQS:plugin_name ', '?}{1,}:plugin_names '))'"""
| parse `db.query.text`,
"""'call DTAGENT' ('_' LD:env_tag)? '_DB.APP.DTAGENT(ARRAY_CONSTRUCT(' ARRAY{SQS:plugin_name ', '?}{1,}:plugin_names '))'"""
| expand plugin_name = plugin_names
| fields plugin_name
| filter in(plugin_name, array($Plugin_Names))
Expand Down Expand Up @@ -147,7 +149,7 @@ tiles:
query: |-
fetch bizevents
| filter db.system == "snowflake"
| filter dsoa.run.context == "self-monitoring"
| filter dsoa.run.context == "self_monitoring"
| filter in(deployment.environment, array($Accounts))
| filter in(dsoa.task.name, array($Plugin_Names))
| sort timestamp asc
Expand Down Expand Up @@ -215,7 +217,8 @@ tiles:
| filter snowflake.query.execution_status != "SUCCESS"
| filter matchesPattern(db.query.text,
"""'call DTAGENT' ('_' LD:tag)? '_DB.APP.DTAGENT(ARRAY_CONSTRUCT(' ARRAY{SQS:plugin_name ', '?}{1,}:plugin_names '))'""")
| parse `db.query.text`, """'call DTAGENT' ('_' LD:env_tag)? '_DB.APP.DTAGENT(ARRAY_CONSTRUCT(' ARRAY{SQS:plugin_name ', '?}{1,}:plugin_names '))'"""
| parse `db.query.text`,
"""'call DTAGENT' ('_' LD:env_tag)? '_DB.APP.DTAGENT(ARRAY_CONSTRUCT(' ARRAY{SQS:plugin_name ', '?}{1,}:plugin_names '))'"""
| expand plugin_name = plugin_names
| fields plugin_name, timestamp, snowflake.query.execution_status
| makeTimeseries count(), by: {
Expand Down Expand Up @@ -259,7 +262,7 @@ tiles:
query: |-
fetch bizevents
| filter db.system == "snowflake"
| filter dsoa.run.context == "self-monitoring"
| filter dsoa.run.context == "self_monitoring"
| filter in(deployment.environment, array($Accounts))
| filter in(dsoa.task.name, array($Plugin_Names))
| sort timestamp asc
Expand Down Expand Up @@ -305,7 +308,7 @@ tiles:
query: |-
fetch bizevents
| filter db.system == "snowflake"
| filter dsoa.run.context == "self-monitoring"
| filter dsoa.run.context == "self_monitoring"
| filter in(deployment.environment, array($Accounts))
| filter in(dsoa.task.name, array($Plugin_Names))
| sort timestamp asc
Expand Down Expand Up @@ -388,7 +391,7 @@ tiles:
query: |-
fetch bizevents
| filter db.system == "snowflake"
| filter dsoa.run.context == "self-monitoring"
| filter dsoa.run.context == "self_monitoring"
| filter in(deployment.environment, array($Accounts))
| filter in(dsoa.task.name, array($Plugin_Names))
| sort timestamp desc
Expand Down Expand Up @@ -456,7 +459,8 @@ tiles:
| filter in(deployment.environment, array($Accounts))
| filter matchesPattern(db.query.text,
"""'call DTAGENT' ('_' LD:tag)? '_DB.APP.DTAGENT(ARRAY_CONSTRUCT(' ARRAY{SQS:plugin_name ', '?}{1,}:plugin_names '))'""")
| parse `db.query.text`, """'call DTAGENT' ('_' LD:env_tag)? '_DB.APP.DTAGENT(ARRAY_CONSTRUCT(' ARRAY{SQS:plugin_name ', '?}{1,}:plugin_names '))'"""
| parse `db.query.text`,
"""'call DTAGENT' ('_' LD:env_tag)? '_DB.APP.DTAGENT(ARRAY_CONSTRUCT(' ARRAY{SQS:plugin_name ', '?}{1,}:plugin_names '))'"""
| fieldsAdd plugins_count = arraySize(plugin_names)
| expand plugin_name = plugin_names
| filter in(plugin_name, array($Plugin_Names))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"from": "now()-24h",
"to": "now()"
},
"value": "fetch bizevents\n| filter db.system == \"snowflake\"\n| filter dsoa.run.context == \"self-monitoring\"\n| filter deployment.environment == \"PROD\" // <-- set to your configuration CORE.DEPLOYMENT_ENVIRONMENT\n| filter dsoa.task.name == \"active_queries\"\n| sort timestamp asc\n| summarize {\n timestamp = takeFirst(timestamp) + 2h,\n snowagent.run.duration = max(timestamp) - min(timestamp),\n count = count()\n}, by: {\n deployment.environment,\n deployment.environment.tag = coalesce(deployment.environment.tag, env_tag),\n dsoa.task.exec.id,\n dsoa.task.name\n}\n| filter count > 1\n| makeTimeseries {\n snowagent.run.duration = sum(snowagent.run.duration)\n}, by: {\n deployment.environment,\n dsoa.run.context = dsoa.task.name\n}"
"value": "fetch bizevents\n| filter db.system == \"snowflake\"\n| filter dsoa.run.context == \"self_monitoring\"\n| filter deployment.environment == \"PROD\" // <-- set to your configuration CORE.DEPLOYMENT_ENVIRONMENT\n| filter dsoa.task.name == \"active_queries\"\n| sort timestamp asc\n| summarize {\n timestamp = takeFirst(timestamp) + 2h,\n snowagent.run.duration = max(timestamp) - min(timestamp),\n count = count()\n}, by: {\n deployment.environment,\n deployment.environment.tag = coalesce(deployment.environment.tag, env_tag),\n dsoa.task.exec.id,\n dsoa.task.name\n}\n| filter count > 1\n| makeTimeseries {\n snowagent.run.duration = sum(snowagent.run.duration)\n}, by: {\n deployment.environment,\n dsoa.run.context = dsoa.task.name\n}"
},
"visualizationSettings": {
"thresholds": [],
Expand Down
Loading