Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate OT data from a Stated template using Meltini REST APIs #183

Merged
merged 5 commits into from
Aug 11, 2023

Conversation

zhirafovod
Copy link
Member

@zhirafovod zhirafovod commented Aug 9, 2023

Description

Generate OT data from a Stated template using Meltini REST APIs

Type of Change

  • [ X] New Feature

Example usage

Start meltini process

node src/MELTini.js

use fsoc to generate OT data

./fsoc melt meltini --template-file ~/projects/sandbox/meltini/templates/spacefleet_basic.json
Response from meltini: [
  {
    "resource": {
      "attributes": [
        {
          "key": "spacecraft.name",
          "value": {
            "string_value": "LaSirena"
          }
        },
        {
          "key": "spacecraft.registry",
          "value": {
            "string_value": "NCC-2312"
          }
        }
      ]
    },
    "scope_metrics": {
      "scope": {
        "name": "@opentelemetry/appdynamics-simulator",
        "version": "0.0.1"
      },
      "metrics": [
        {
          "sum": {
            "data_points": [
              {
                "time_unix_nano": 1691602873106000000,
                "start_time_unix_nano": 1691602933106000000,
                "as_double": 30617187.069894012
              }
            ],
            "aggregation_temporality": "AGGREGATION_TEMPORALITY_DELTA"
          },
          "name": "spacefleet:speed"
        }
      ]
    }
  },
  {
    "resource": {
      "attributes": [
        {
          "key": "spacecraft.name",
          "value": {
            "string_value": "Phoenix"
          }
        },
        {
          "key": "spacecraft.registry",
          "value": {
            "string_value": "NCC-6522"
          }
        }
      ]
    },
    "scope_metrics": {
      "scope": {
        "name": "@opentelemetry/appdynamics-simulator",
        "version": "0.0.1"
      },
      "metrics": [
        {
          "sum": {
            "data_points": [
              {
                "time_unix_nano": 1691602873106000000,
                "start_time_unix_nano": 1691602933106000000,
                "as_double": 30617187.069894012
              }
            ],
            "aggregation_temporality": "AGGREGATION_TEMPORALITY_DELTA"
          },
          "name": "spacefleet:speed"
        }
      ]
    }
  },
  {
    "resource": {
      "attributes": [
        {
          "key": "spacecraft.name",
          "value": {
            "string_value": "Sarcophagus"
          }
        },
        {
          "key": "spacecraft.registry",
          "value": {
            "string_value": "NCC-3264"
          }
        }
      ]
    },
    "scope_metrics": {
      "scope": {
        "name": "@opentelemetry/appdynamics-simulator",
        "version": "0.0.1"
      },
      "metrics": [
        {
          "sum": {
            "data_points": [
              {
                "time_unix_nano": 1691602873106000000,
                "start_time_unix_nano": 1691602933106000000,
                "as_double": 30617187.069894012
              }
            ],
            "aggregation_temporality": "AGGREGATION_TEMPORALITY_DELTA"
          },
          "name": "spacefleet:speed"
        }
      ]
    }
  },
  {
    "resource": {
      "attributes": [
        {
          "key": "spacecraft.name",
          "value": {
            "string_value": "Scimitar"
          }
        },
        {
          "key": "spacecraft.registry",
          "value": {
            "string_value": "NCC-1653"
          }
        }
      ]
    },
    "scope_metrics": {
      "scope": {
        "name": "@opentelemetry/appdynamics-simulator",
        "version": "0.0.1"
      },
      "metrics": [
        {
          "sum": {
            "data_points": [
              {
                "time_unix_nano": 1691602873106000000,
                "start_time_unix_nano": 1691602933106000000,
                "as_double": 30617187.069894012
              }
            ],
            "aggregation_temporality": "AGGREGATION_TEMPORALITY_DELTA"
          },
          "name": "spacefleet:speed"
        }
      ]
    }
  },
  {
    "resource": {
      "attributes": [
        {
          "key": "spacecraft.name",
          "value": {
            "string_value": "USSPrometheus"
          }
        },
        {
          "key": "spacecraft.registry",
          "value": {
            "string_value": "NCC-4363"
          }
        }
      ]
    },
    "scope_metrics": {
      "scope": {
        "name": "@opentelemetry/appdynamics-simulator",
        "version": "0.0.1"
      },
      "metrics": [
        {
          "sum": {
            "data_points": [
              {
                "time_unix_nano": 1691602873106000000,
                "start_time_unix_nano": 1691602933106000000,
                "as_double": 30617187.069894012
              }
            ],
            "aggregation_temporality": "AGGREGATION_TEMPORALITY_DELTA"
          },
          "name": "spacefleet:speed"
        }
      ]
    }
  }
]

@codecov-commenter
Copy link

codecov-commenter commented Aug 9, 2023

Codecov Report

Merging #183 (14a0e23) into main (04b8e96) will not change coverage.
Report is 2 commits behind head on main.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##             main     #183   +/-   ##
=======================================
  Coverage   29.53%   29.53%           
=======================================
  Files          29       29           
  Lines        3945     3945           
=======================================
  Hits         1165     1165           
  Misses       2693     2693           
  Partials       87       87           


func init() {
meltMelitiniCmd.Flags().String("template-file", "", "path to the stated template file")
meltMelitiniCmd.Flags().String("meltini-url", "http://localhost:3000/", "meltini REST APIs URL")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we think about maybe importing MELTini as a dependency (I will have to make it available on npm)? Hitting that endpoint means we'll be starting a node server on local.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can definitely optionally install/start it once available on npm

@pnickolov pnickolov merged commit 5c412f0 into main Aug 11, 2023
6 checks passed
@pnickolov pnickolov deleted the meltini_generation branch August 11, 2023 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants