Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
0438441
#7 Ensure dsoa.run.context is available as metric dimensions for bett…
sebastiankruk Oct 24, 2025
2fe1b5f
#7 updating tests
sebastiankruk Oct 24, 2025
7291ad8
#8 set custom context name in telemetry_sender
sebastiankruk Oct 24, 2025
05b4563
#5 default configurations for selecting telemetry types sent
sebastiankruk Oct 24, 2025
e75d22d
#5 only setting telemetry which is allowed
sebastiankruk Oct 24, 2025
147f126
#5 enabling to disable telemetry channels
sebastiankruk Oct 27, 2025
65fe658
Merge branch 'release/0.9.2' into dev/skruk/telemetry-types-config
sebastiankruk Oct 27, 2025
0f24560
#5 refactoring returned values from process() into a telemetry counts…
sebastiankruk Oct 28, 2025
6e08028
#5 refactoring plugin process() functions to return dicts with counts…
sebastiankruk Oct 28, 2025
59dc4a2
#5 finishing process() results
sebastiankruk Oct 28, 2025
5f47831
#5 code quality
sebastiankruk Oct 28, 2025
0d0e252
#5 adjusting tests
sebastiankruk Oct 28, 2025
10e85cd
#5 fixing code thanks to tests
sebastiankruk Oct 28, 2025
b9f1ea8
#5 detailed tests wip
sebastiankruk Oct 30, 2025
8417c59
#5 extending tests to test disabled telemetry
sebastiankruk Oct 30, 2025
93ab93d
#5 improve tests
sebastiankruk Oct 30, 2025
e9de42f
#5 complete tests for selective telemetry types sending
sebastiankruk Oct 31, 2025
81bb72a
#5 small updates to the documentation
sebastiankruk Oct 31, 2025
6c24913
#5 small code style fixes
sebastiankruk Oct 31, 2025
f0333ea
#5 improving code around the tests
sebastiankruk Oct 31, 2025
d55eb2b
# disabled by default part of default config
sebastiankruk Oct 31, 2025
f87ea6d
# fixing tests
sebastiankruk Oct 31, 2025
ff84caf
#5 PR small improvements
sebastiankruk Nov 3, 2025
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
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
"libgdk",
"libpango",
"libpangocairo",
"lineterm",
"listagg",
"Luhansk",
"Majeure",
Expand Down Expand Up @@ -112,6 +113,7 @@
"Suri",
"timeadd",
"timediff",
"tofile",
"Trapelo",
"tzlocal",
"UNDROP",
Expand All @@ -123,6 +125,7 @@
"Vidhya",
"Waltham",
"weasyprint",
"xdist",
"Xometry"
],
"cSpell.ignorePaths": [
Expand Down
44 changes: 24 additions & 20 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,26 +219,30 @@ The `sources` parameter specifies the content to be sent to Dynatrace and can be
* a single object, or
* an array of objects.

The `params` parameter is an object with the following keys (parameters) that can be used to control the behavior of the `DTAGENT_DB.APP.SEND_TELEMETRY` procedure:

| Param Name | Default Value | Description |
| -------------- | ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `auto_mode` | `true` | If not set to `false`, Dynatrace Snowflake Observability Agent expects that data delivered in the `source` follows Dynatrace Snowflake Observability Agent data structure. |
| `context` | `telemetry_sender` | Name of the context to identify the data source. This way we can differentiate between data delivered via `SEND_TELEMETRY` or even use `F_LAST_PROCESSED_TS()` |
| `metrics` | `true` | Should we send metrics based on `METRICS` (auto-mode only). |
| `logs` | `true` | `false` will disable sending telemetry as logs. |
| `events` | `$auto_mode` | `false` will disable sending events based on `EVENT_TIMESTAMPS` (auto-mode); otherwise, `true` will enable sending custom objects as events. |
| `biz_events` | `false` | `true` will enable sending custom objects as bizevents. |
| `davis_events` | `false` | `true` will enable sending custom objects as Davis events. |

This stored procedure returns a tuple with number of objects sent:

* all entries,
* entries sent as logs,
* entries sent as metrics,
* entries sent as events,
* entries sent as BizEvents, and
* entries sent as Davis events.
The `params` object controls how `DTAGENT_DB.APP.SEND_TELEMETRY` works. Key options:

| Param | Default | Description |
| -------------- | ------------------ | ---------------------------------------------------------------------------------------------- |
| `auto_mode` | `true` | Expects data in [default structure](#default-data-structure) unless set to `false`. |
| `context` | `telemetry_sender` | Identifies custom data source; used for tracking with `F_LAST_PROCESSED_TS()`. |
| `metrics` | `true` | Enables sending metrics (only in auto-mode). |
| `logs` | `true` | Enables/disables sending logs. |
| `events` | `$auto_mode` | In auto-mode, disables/enables events from `EVENT_TIMESTAMPS`; in manual mode, enables events. |
| `biz_events` | `false` | Enables sending custom objects as bizevents. |
| `davis_events` | `false` | Enables sending custom objects as Davis events. |

This stored procedure returns a object with number of records sent:

```jsonc
{
"entries": 100, // all entries sent,
"log_lines": 100, // entries sent as logs,
"metrics": 150, // entries sent as metrics,
"events": 10, // entries sent as events,
"biz_events": 2, // entries sent as bizevents,
"davis_events": 0, // entries sent as davis_events,
}
```

### Default data structure

Expand Down
104 changes: 91 additions & 13 deletions PLUGINS.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@ In case the global property `PLUGINS.DISABLED_BY_DEFAULT` is set to `true`, you
"SCHEDULE": "USING CRON */6 * * * * UTC",
"IS_DISABLED": false,
"FAST_MODE": true,
"REPORT_EXECUTION_STATUS": []
"REPORT_EXECUTION_STATUS": [],
"TELEMETRY": [
"LOGS",
"METRICS",
"SPANS",
"BIZ_EVENTS"
]
}
}
}
Expand Down Expand Up @@ -101,7 +107,13 @@ In case the global property `PLUGINS.DISABLED_BY_DEFAULT` is set to `true`, you
"BUDGETS": {
"QUOTA": 10,
"SCHEDULE": "USING CRON 30 0 * * * UTC",
"IS_DISABLED": false
"IS_DISABLED": false,
"TELEMETRY": [
"LOGS",
"METRICS",
"EVENTS",
"BIZ_EVENTS"
]
}
}
}
Expand Down Expand Up @@ -129,6 +141,10 @@ In case the global property `PLUGINS.DISABLED_BY_DEFAULT` is set to `true`, you
"EXCLUDE": [],
"INCLUDE": [
"%"
],
"TELEMETRY": [
"EVENTS",
"BIZ_EVENTS"
]
}
}
Expand Down Expand Up @@ -170,7 +186,11 @@ In case the global property `PLUGINS.DISABLED_BY_DEFAULT` is set to `true`, you
"%.%.TMP_%"
],
"SCHEDULE": "USING CRON 30 0,4,8,12,16,20 * * * UTC",
"IS_DISABLED": false
"IS_DISABLED": false,
"TELEMETRY": [
"METRICS",
"BIZ_EVENTS"
]
}
}
}
Expand Down Expand Up @@ -208,7 +228,12 @@ In case the global property `PLUGINS.DISABLED_BY_DEFAULT` is set to `true`, you
],
"SCHEDULE": "USING CRON */30 * * * * UTC",
"SCHEDULE_GRANTS": "USING CRON 30 */12 * * * UTC",
"IS_DISABLED": false
"IS_DISABLED": false,
"TELEMETRY": [
"METRICS",
"LOGS",
"BIZ_EVENTS"
]
}
}
}
Expand Down Expand Up @@ -262,7 +287,13 @@ In case the global property `PLUGINS.DISABLED_BY_DEFAULT` is set to `true`, you
"RETENTION_HOURS": 12,
"SCHEDULE": "USING CRON */30 * * * * UTC",
"SCHEDULE_CLEANUP": "USING CRON 0 * * * * UTC",
"IS_DISABLED": false
"IS_DISABLED": false,
"TELEMETRY": [
"METRICS",
"LOGS",
"BIZ_EVENTS",
"SPANS"
]
}
}
}
Expand Down Expand Up @@ -297,7 +328,12 @@ In case the global property `PLUGINS.DISABLED_BY_DEFAULT` is set to `true`, you
"PLUGINS": {
"EVENT_USAGE": {
"SCHEDULE": "USING CRON 0 * * * * UTC",
"IS_DISABLED": false
"IS_DISABLED": false,
"TELEMETRY": [
"METRICS",
"LOGS",
"BIZ_EVENTS"
]
}
}
}
Expand Down Expand Up @@ -334,7 +370,11 @@ In case the global property `PLUGINS.DISABLED_BY_DEFAULT` is set to `true`, you
"PLUGINS": {
"LOGIN_HISTORY": {
"SCHEDULE": "USING CRON */30 * * * * UTC",
"IS_DISABLED": false
"IS_DISABLED": false,
"TELEMETRY": [
"LOGS",
"BIZ_EVENTS"
]
}
}
}
Expand Down Expand Up @@ -373,7 +413,13 @@ In case the global property `PLUGINS.DISABLED_BY_DEFAULT` is set to `true`, you
"SCHEDULE": "USING CRON */30 * * * * UTC",
"IS_DISABLED": false,
"SLOW_QUERIES_THRESHOLD": 10000,
"SLOW_QUERIES_TO_ANALYZE_LIMIT": 50
"SLOW_QUERIES_TO_ANALYZE_LIMIT": 50,
"TELEMETRY": [
"METRICS",
"LOGS",
"BIZ_EVENTS",
"SPANS"
]
}
}
}
Expand Down Expand Up @@ -419,7 +465,13 @@ In case the global property `PLUGINS.DISABLED_BY_DEFAULT` is set to `true`, you
"PLUGINS": {
"RESOURCE_MONITORS": {
"SCHEDULE": "USING CRON */30 * * * * UTC",
"IS_DISABLED": false
"IS_DISABLED": false,
"TELEMETRY": [
"LOGS",
"METRICS",
"EVENTS",
"BIZ_EVENTS"
]
}
}
}
Expand Down Expand Up @@ -458,6 +510,11 @@ In case the global property `PLUGINS.DISABLED_BY_DEFAULT` is set to `true`, you
],
"INCLUDE": [
"%.%.%"
],
"TELEMETRY": [
"LOGS",
"EVENTS",
"BIZ_EVENTS"
]
}
}
Expand Down Expand Up @@ -495,7 +552,13 @@ In case the global property `PLUGINS.DISABLED_BY_DEFAULT` is set to `true`, you
"PLUGINS": {
"TASKS": {
"SCHEDULE": "USING CRON 30 * * * * UTC",
"IS_DISABLED": false
"IS_DISABLED": false,
"TELEMETRY": [
"LOGS",
"METRICS",
"EVENTS",
"BIZ_EVENTS"
]
}
}
}
Expand Down Expand Up @@ -527,7 +590,13 @@ In case the global property `PLUGINS.DISABLED_BY_DEFAULT` is set to `true`, you
"TRUST_CENTER": {
"SCHEDULE": "USING CRON 30 */12 * * * UTC",
"LOG_DETAILS": false,
"IS_DISABLED": false
"IS_DISABLED": false,
"TELEMETRY": [
"METRICS",
"LOGS",
"EVENTS",
"BIZ_EVENTS"
]
}
}
}
Expand Down Expand Up @@ -569,7 +638,11 @@ In case the global property `PLUGINS.DISABLED_BY_DEFAULT` is set to `true`, you
"IS_DISABLED": false,
"IS_HASHED": true,
"RETAIN_EMAIL_HASH_MAP": false,
"ROLES_MONITORING_MODE": []
"ROLES_MONITORING_MODE": [],
"TELEMETRY": [
"LOGS",
"BIZ_EVENTS"
]
}
}
}
Expand Down Expand Up @@ -599,7 +672,12 @@ In case the global property `PLUGINS.DISABLED_BY_DEFAULT` is set to `true`, you
"PLUGINS": {
"WAREHOUSE_USAGE": {
"SCHEDULE": "USING CRON 0 * * * * UTC",
"IS_DISABLED": false
"IS_DISABLED": false,
"TELEMETRY": [
"LOGS",
"METRICS",
"BIZ_EVENTS"
]
}
}
}
Expand Down
21 changes: 15 additions & 6 deletions src/dtagent.conf/otel-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,31 @@
"MAX_CONSECUTIVE_API_FAILS": 10,
"LOGS": {
"EXPORT_TIMEOUT_MILLIS": 10000,
"MAX_EXPORT_BATCH_SIZE": 100
"MAX_EXPORT_BATCH_SIZE": 100,
"IS_DISABLED": false
},
"SPANS": {
"EXPORT_TIMEOUT_MILLIS": 10000,
"MAX_EXPORT_BATCH_SIZE": 50,
"MAX_EVENT_COUNT": 2000,
"MAX_ATTRIBUTES_PER_EVENT_COUNT": 250,
"MAX_SPAN_ATTRIBUTES": 250
"MAX_SPAN_ATTRIBUTES": 250,
"IS_DISABLED": false
},
"METRICS": {
"MAX_RETRIES": 5,
"MAX_BATCH_SIZE": 1000000
"MAX_BATCH_SIZE": 1000000,
"IS_DISABLED": false
},
"EVENTS": {
"MAX_RETRIES": 5,
"RETRY_DELAY_MS": 10000
"RETRY_DELAY_MS": 10000,
"IS_DISABLED": false
},
"DAVIS_EVENTS": {
"MAX_RETRIES": 5,
"RETRY_DELAY_MS": 10000
"RETRY_DELAY_MS": 10000,
"IS_DISABLED": false
},
"BIZ_EVENTS": {
"MAX_RETRIES": 5,
Expand All @@ -33,7 +38,11 @@
429,
502,
503
]
],
"IS_DISABLED": false
}
},
"PLUGINS": {
"DISABLED_BY_DEFAULT": false
}
}
14 changes: 12 additions & 2 deletions src/dtagent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,14 @@ def __init__(self, session: snowpark.Session) -> None:

self._configuration = self._get_config(session)

self.telemetry_allowed = set(
[
k
for k, v in self._configuration.get(key="OTEL", default_value={}).items()
if isinstance(v, dict) and not v.get("is_disabled", False)
]
)

if self._configuration:
resource = _gen_resource(self._configuration)
self._instruments = Instruments(self._configuration)
Expand Down Expand Up @@ -139,9 +147,11 @@ def _get_config(self, session: snowpark.Session) -> Configuration:
return Configuration(session)

def report_execution_status(self, status: str, task_name: str, exec_id: str, details_dict: Optional[dict] = None):
"""Sends BizEvent for given task with given status"""
"""Sends BizEvent for given task with given status if BizEvents are allowed and send_bizevents_on_run is enabled"""

if self._configuration.get(plugin_name="self_monitoring", key="send_bizevents_on_run", default_value=True):
if "biz_events" in self.telemetry_allowed and self._configuration.get(
plugin_name="self_monitoring", key="send_bizevents_on_run", default_value=True
):

data_dict = {
"event.provider": str(self._configuration.get(context="resource.attributes", key="host.name")),
Expand Down
Loading
Loading