Skip to content
Open
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
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,20 @@ settings_value = {

settings_object = SettingsObjectCreate(schema_id="builtin:anomaly-detection.metric-events", value=settings_value, scope="environment")
dt.settings.create_object(validate_only=False, body=settings_object)

events = [
{
"id": "HOST-82F576674F19AC16",
"tags:custom.test": {"test": "test"},
}
]
response = dt.openpipeline.smartscape_eventv1_ingest(events)
print(response.status_code)
```

## Implementation Progress


### Environment API V2

API | Level | Access |
Expand Down Expand Up @@ -250,3 +260,12 @@ dt.settings.create_object(validate_only=False, body=settings_object)
Service - IBM MQ tracing | :x: | |
Service - Request attributes | :x: | |
Service - Request naming | :x: | |

### OpenPipeline

API | Level | Access |
:----------------------------------------|:------------------:|:------------------------------------------|
ingest Built-in Smartscape v1 events | :heavy_check_mark: | `dt.openpipeline.smartscape_eventv1_ingest` |
ingest Generic Events | :x: | |
ingest SDLC Events | :x: | |
ingest Security Events | :x: | |
2 changes: 2 additions & 0 deletions dynatrace/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
from dynatrace.environment_v2.service_level_objectives import SloService
from dynatrace.environment_v2.logs import LogService
from dynatrace.environment_v2.settings import SettingService
from dynatrace.openpipeline.ingest import OpenPipelineService

from dynatrace.http_client import HttpClient

Expand Down Expand Up @@ -144,3 +145,4 @@ def __init__(

# New implementations should be done here, above is deprecated
self.config_v1: ConfigurationV1 = ConfigurationV1(self.__http_client)
self.openpipeline: OpenPipelineService = OpenPipelineService(self.__http_client)
Empty file.
31 changes: 31 additions & 0 deletions dynatrace/openpipeline/ingest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""
Copyright 2026 Dynatrace LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""

from typing import Any, Dict, List

from requests import Response

from dynatrace.http_client import HttpClient


class OpenPipelineService:
SMARTSCAPE_ENDPOINT = "/platform/ingest/v1/smartscape.events"

def __init__(self, http_client: HttpClient):
self.__http_client = http_client

def smartscape_eventv1_ingest(self, events: List[Dict[str, Any]]):
return self.__http_client.make_request(self.SMARTSCAPE_ENDPOINT, params=events, method="POST")
Empty file added test/openpipeline/__init__.py
Empty file.
11 changes: 11 additions & 0 deletions test/openpipeline/test_smartscape_events.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from dynatrace import Dynatrace


def test_ingest(dt: Dynatrace):
events = [
{
"id": "HOST-82F576674F19AC16",
"tags:custom.test": {"test": "test"},
}
]
response = dt.openpipeline.smartscape_eventv1_ingest(events)