Dynatrace Managed Q&A
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Looking to upgrade from Dynatrace Managed to SaaS? See how

Workflow

tmehta3
Visitor

Hello Community,

I am working on creating a Dynatrace workflow where I start with sample JSON data and need to convert that JSON into the BizEvents format so it can be ingested into Grail.

Could you please help me with the correct JavaScript structure for this conversion? Here’s the sample JSON I am working with and the code I have so far:

javascriptBecause  when i am ingesting and fetching bizevents through DQL  I am getting No records found in the dashboards
The approach I have used is - Trigger->Javascript->Ingest Business events
 
function main() {
  // Sample JSON data
  const data = {
    requestId: "12345",
    dateTime: "2024-04-22T14:30:00.000Z",
    totalProxies: 100,
    proxyList: [
      {
        proxyName: "ddd",
        environment: "hhh",
        revision: 1,
        created: "2024-04-22T14:30:00.000Z",
        lastModified: "2024-04-22T14:30:00.000Z",
        basePath: "/basePath",
        deployState: true,
        TargetServer: ["Server1", "Server2"],
        targetEndpoint: ["/Service1", "/Service2"],
        sharedFlows: ["sgg", "sgg"]
      }
    ]
  };

  // Convert each proxy into a BizEvent
  return data.proxyList.map(proxy => ({
    "event.provider": "apigee",
    "event.type": "apigee.proxy.metadata",
    "event.category": "inventory",
    attributes: {
      bucket: "test-poc",   // custom marker
      requestId: data.requestId,
      dateTime: data.dateTime,
      totalProxies: data.totalProxies,
      proxyName: proxy.proxyName,
      environment: proxy.environment,
      revision: proxy.revision,
      created: proxy.created,
      lastModified: proxy.lastModified,
      basePath: proxy.basePath,
      deployState: proxy.deployState,
      targetServers: proxy.TargetServer,
      targetEndpoints: proxy.targetEndpoint,
      sharedFlows: proxy.sharedFlows
    }
  }));}
 

🔹 My Questions

  1. Is this the correct way to structure BizEvents JSON in a workflow JavaScript step?

  2. Do I need to add or change any mandatory fields for Grail ingestion?

  3. Are there best practices for handling multiple proxies in the array (e.g., batching vs individual events)?

Thanks in advance for your guidance!

3 REPLIES 3

AntonPineiro
DynaMight Guru
DynaMight Guru

Hi,

Since you are in Managed... Are workflows available in your environment?

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

Yes workflows are available in my environment . I am working on staging now 

Hi,

I was not aware workflows were available in Managed environment... Are you in SaaS?

Best regards

❤️ Emacs ❤️ Vim ❤️ Bash ❤️ Perl

Featured Posts