Skip to content

Commit

Permalink
added monitoring tab, retrieve cep id from backend
Browse files Browse the repository at this point in the history
  • Loading branch information
ck-c8y committed Dec 14, 2023
1 parent 36d1cda commit cd12109
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
- [Build Custom Extension](#build-custom-extension)
- [Options for Custom Extension](#options-for-custom-extension)
- [Samples Repositories and Building Custom Extensions](#samples-repositories-and-building-custom-extensions)
- [Monitoring](#monitoring)
- [Installation](#installation-of-plugin-as-community-plugin)
- [Build Instructions](#build-instructions)
- [Analytics Builder Extension Backend](#analytics-builder-extension-backend)
Expand Down Expand Up @@ -63,14 +64,23 @@ In addition you can view the EPL (event processing language) source code:

![View source code](resources/images/samples-view-code.png)

Buildin a custom extension starts by selecting the blocks from the list of samples. On selection of blocks an action in the table header appears `Custom Extension`.
Building a custom extension starts by selecting the blocks from the list of samples. On selection of blocks an action in the table header appears `Custom Extension`.
The modal dialog provides the option:
* to name the custom extension
* to upload the extension automatically to the Cumulocity Inventory. The created custom extension is otherwise downloaded to locally. It still requires the restart of the analytics engine.
* to restart the stremaning analytics engine to load the created custom extension.

![Create Extension](resources/images/create-extension-modal.png)

## Monitoring

On the monitoring tab you can view the latest alarms and events for the Streaming Analytics Engine. This is especially helpful if after an upload of a new extension no extension is loaded.

This is an indication that the engine was started in **Safe Mode**, i.e. without loading any extension. In this case you have to delete the latest uploaded extension and restart the engine again.

![Monitoring](resources/images/monitoring.png)


## Installation of plugin as community plugin

> **NOTE**
Expand Down
11 changes: 6 additions & 5 deletions analytics-service/c8y_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,18 @@ def get_cep_id(self, request_headers):
self._logger.info(f"Found app id: {app_id}")
# break
filter = f"$filter=applicationId eq '{app_id}' and name eq '{self.APAMA_CTRL_APPLICATION_NAME}'"
self._logger.info(f"Build filter: {filter}")

# managed_objects_app = self.c8yapp.get_tenant_instance(
# headers=request_headers
# ).inventory.select(query=query)
self._logger.info(f"Build filter: {filter}")
params = {"query": filter}
response = self.c8yapp.get_tenant_instance(headers=request_headers).get(
resource=f"/inventory/managedObjects?query={filter}"
resource=f"/inventory/managedObjects", params=params
)
cep_id = response["managedObjects"][0]["id"]
self._logger.info(f"Found managed object for app: {cep_id}")

# managed_objects_app = self.c8yapp.get_tenant_instance(
# headers=request_headers
# ).inventory.select(query=query)
# managed_object_id = None
# for managed_object in managed_objects_app:
# self._logger.info(
Expand Down
4 changes: 2 additions & 2 deletions analytics-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion analytics-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "analytics-extension",
"version": "2.2.5",
"version": "2.2.4",
"description": "Extends the standard Cumulocity administration web application with a dialog to add Analytics Builder extensions.",
"repository": {
"type": "git",
Expand Down
Binary file modified resources/images/create-extension-animated.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/images/extension-installation-animated.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cd12109

Please sign in to comment.