Developer Q&A Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom app - How to get my settings natively in Gen3 settings app

SjoerdB
Mentor

Hi all,

I would like to upgrade my app to use the Gen3 settings instead of the "settings classic" for my application specific configuration.

What should I change to move to the new app?

SjoerdB_0-1769975917629.png

(as you can see, behind the [MMM] app, there is still an outgoing link symbol, instead of just opening the settings here)

Dynatrace Certified Professional | Dynatrace partner IctCoreBiz B.V.
11 REPLIES 11

SjoerdB
Mentor

Has anyone already done this?

Dynatrace Certified Professional | Dynatrace partner IctCoreBiz B.V.

Hi SjoerdB,

Are you creating your settings using https://developer.dynatracelabs.com/develop/sdks/client-app-settings-v2/ with schemas?

 

Yes. We define our app settings via a schema in settings/schemas (schemaId com.company.app.settings) and access them using App Settings V2.

In the UI we use useSettingsV2 from @dynatrace-sdk/react-hooks, and for direct settings object access we use appSettingsObjectsClient from @dynatrace-sdk/client-app-settings-v2.

const { data: settingsData, isLoading, error } = useSettingsV2({ schemaId: "com.company.app.settings", });
Dynatrace Certified Professional | Dynatrace partner IctCoreBiz B.V.

With this, it still remains a gen2 settings (classic)

Dynatrace Certified Professional | Dynatrace partner IctCoreBiz B.V.

Hi SjoerdB,

We're working on AI support for app creation and it will have a widget skill. However, this will take time until it's released.

Right now there's no low effort way to migrate schemas to widgets and you will have to create them on your own.

 

So, the answer to my question is: convert schema based settings to widget based then it will automatically pop up in the new GEN3 settings (and also be available in Gen2)?

I guess there is a small sample project available somewhere on github to show this works 😉

Dynatrace Certified Professional | Dynatrace partner IctCoreBiz B.V.

Why do you want the settings for your 3rd gen app to be available in Gen2?

There is currently no sample project available. However, we do have on our roadmap the creation of sample apps to be hosted on github for developers to have a reference or starting point on different features.

I don’t need them in gen2, unless that would be required for managed…

i just want to be sure to cope with all types of tenants, including the gen3-only tenants.

Dynatrace Certified Professional | Dynatrace partner IctCoreBiz B.V.

@dani_coll 

I did some additional testing and can now reproduce the behavior consistently.

What I tested:

  • I created a minimal app settings schema with 3 fields:
    • one boolean
    • one string
    • one numeric field
  • Storing and retrieving the settings works as expected.
  • In GEN2, the settings experience behaves normally.
  • In GEN3, schema-based settings still link back to the GEN2 settings page.

I then added a custom settings widget for the same schema, to see whether this would provide a native GEN3 settings experience.

Observed behavior:

  • In GEN2, behavior remains unchanged and still works as before.
  • In GEN3, instead of showing an external-link style fallback, I now see a > navigation entry.
  • When I open that entry, I get an empty page.
  • In the browser console I see CSP-related errors, including a frame-ancestors refusal for the widget URL under /widgets/settings/....

Example symptom:

  • the widget is built and deployed
  • GEN3 attempts to open /widgets/settings/<widget>
  • the page stays blank
  • console shows CSP errors rather than a normal rendering failure

So from my perspective, the main question is:

Are custom app settings widgets currently expected to work inside GEN3 Settings, or is this flow not yet supported?

Right now it looks like:

  • GEN2 fallback works
  • GEN3 detects the widget route
  • but embedding/rendering fails due to CSP restrictions

If helpful, I can also share a minimal repro repository.

Dynatrace Certified Professional | Dynatrace partner IctCoreBiz B.V.

Additional observation:

GEN3 does resolve the app correctly through the App Engine registry and retrieves the isolated app URL successfully.

Example:
GET /platform/app-engine/registry/v1/apps/my.biz.ictcore.testbed?add-fields=isolatedUri

The response contains:

  • isolatedUri.url
  • isolatedUri.baseUrl
  • isolatedUri.widgetUrl

So the issue does not seem to be app discovery or app registration.
GEN3 appears to resolve the app and its widget host correctly, but rendering the settings widget still results in an empty page.

This suggests the problem is more likely in the GEN3 settings widget loading/integration path, for example:

  • widget embedding
  • isolated widget host loading
  • CSP/runtime restrictions
  • or the current GEN3 support level for custom settings widgets

---

Additional technical observation:

The settings widget HTML is actually being loaded. The /widgets/settings/testbed/ page returns a valid HTML document with:

  • a <base href="/widgets/settings/testbed/">
  • the Dynatrace runtime bootstrap script
  • a <div id="root"></div>
  • the widget bundle index.js

So the issue is not that the widget entry page is missing.

It appears that GEN3 does reach the widget HTML, but the page still ends up blank during or after runtime bootstrapping.
This suggests the problem is likely in the GEN3 widget embedding/runtime initialization path rather than in the existence of the widget bundle itself.

 

Dynatrace Certified Professional | Dynatrace partner IctCoreBiz B.V.

pavbot
Dynatrace Advocate
Dynatrace Advocate

Hi,

Our team is working on the Settings app and we are currently in the process of creating customer facing documentation and how-to guides for customers building their own settings. It will take a bit longer to get everything finished and published tho.

In the meantime, I can offer some help if building a settings widget is important and time relevant for you! If integrating into the Settings app is not so important and you can wait until the official documentation and tooling is released, I would suggest that you build the UI for your settings as part of your application. If this is done in a decoupled way, it can then be reused for the Settings app. 

The first thing to note is that the new Settings app no longer provides an auto generated UI. This means that every app must build the relevant settings UI according to the schema they have. 

The entries in the Settings app are called "settings widgets".

The first step is to create the files and then register the widget:

1. Files:
<app-root>/settings/your-settings.widget.tsx

2. app.config.json:

"app": {
  "settings": {
    "your-settings": {
      "name": "<Your-Widget-Name>",
      "description": "<User-Friendly-Description>",
      "schemaIds": ["<Your-Settings-Schema-Ids>"]
    }
  }
}

 

The file `your-settings.widget.tsx` can look something like this:

import { AppRoot } from '@dynatrace/strato-components/core';
import React from 'react';
import { YourSettingsFormContainer } from '../<your-app-code>';

const YourWidget = () => {
  return (
    <>
      <ToastContainer />
      <YourSettingsFormContainer />
    </>
  );
};

const rootElement = document.getElementById('root');
if (rootElement) {
  const root = ReactDom.createRoot(rootElement);

  root.render(
    <AppRoot>
      <YourWidget />
    </AppRoot>,
  );
} else {
  console.error('the root element is not defined');
}

 

Everything in terms of permissions, validation, errors, navigation, etc must be handled. There will be some tooling to offer a consistent look & feel as well as some out of the box functionality.

I'll stop here for now. Please try the above suggestions and let me know if there's any other questions.

Featured Posts