newrelic / infra-integrations-sdk

New Relic Infrastructure Integrations SDK
Apache License 2.0
46 stars 24 forks source link

POC Interface for adding metrics without entity #290

Closed gsanchezgavier closed 2 years ago

gsanchezgavier commented 2 years ago

this is a quick dirty workaround to show what having an interface to add metrics not related to any entity would look like.

IMO we should take the advantage that we are introducing some changes in the protocol to refactor the hole integration package to clearly show that the entity is not the main entry point to add metrics and even if possible i would get rid of most things related to entities since they will be synthesized in the backend.

rogercoll commented 2 years ago

Just to have a clear idea of the goal, is the following output a possible one after the refactor?

{
  "protocol_version":"4",                      
  "integration":{                                                                         
    "name":"integration name",
    "version":"integration version"
  },
  "data":[                                   
    {
      "ignore_entity": true,
      "metrics":[                             
        {
          "name":"powerdns_something",
          "type":"count",                     
          "value":93, 
          "attributes":{}  
        }
      ],
      "common":{}                          
      "inventory":{},         
      "events":[]       
    },
    {
      "ignore_entity": false,
      "metrics":[                             
        {
          "name":"go_routines",
          "type":"count",                     
          "value":93, 
          "attributes":{}  
        }
      ],
      "common":{}                          
      "inventory":{},         
      "events":[]       
    },
  ]
}

Could we have multiple datasets from the same integration and that some datasets could be attached to the host entity and some not?

gsanchezgavier commented 2 years ago

I would be possible but there are no integration at the moment we want to add metrics to the host entity.

gsanchezgavier commented 2 years ago

closing in favor of #291