From 96976714b8bdd897dccf6a1f4c745068276466ef Mon Sep 17 00:00:00 2001 From: abasha1234 Date: Wed, 29 May 2024 16:05:45 +0530 Subject: [PATCH] feat: Retrive tags from entity api chore: Add log to view entity results --- pkg/entities/entities_api.go | 59 ++++++++++++++++++++++++++++++++++++ pkg/entities/types.go | 1 + 2 files changed, 60 insertions(+) diff --git a/pkg/entities/entities_api.go b/pkg/entities/entities_api.go index 122c3bd7..71d766ee 100644 --- a/pkg/entities/entities_api.go +++ b/pkg/entities/entities_api.go @@ -3,6 +3,7 @@ package entities import ( "context" + "log" "github.com/newrelic/newrelic-client-go/v2/pkg/common" "github.com/newrelic/newrelic-client-go/v2/pkg/errors" @@ -2056,6 +2057,8 @@ func (a *Entities) GetEntitySearchByQueryWithContext( return nil, err } + log.Printf("[INFO] Entity results %v", &resp.Actor.EntitySearch) + return &resp.Actor.EntitySearch, nil } @@ -2079,16 +2082,28 @@ const getEntitySearchByQuery = `query( permalink reporting type + tags { + key + values + } ... on ApmApplicationEntityOutline { __typename applicationId language + tags { + key + values + } } ... on ApmDatabaseInstanceEntityOutline { __typename host portOrPath vendor + tags { + key + values + } } ... on ApmExternalServiceEntityOutline { __typename @@ -2099,6 +2114,10 @@ const getEntitySearchByQuery = `query( agentInstallType applicationId servingApmApplicationId + tags { + key + values + } } ... on DashboardEntityOutline { __typename @@ -2106,9 +2125,17 @@ const getEntitySearchByQuery = `query( dashboardParentGuid permissions updatedAt + tags { + key + values + } } ... on ExternalEntityOutline { __typename + tags { + key + values + } } ... on GenericEntityOutline { __typename @@ -2120,24 +2147,44 @@ const getEntitySearchByQuery = `query( ... on GenericInfrastructureEntityOutline { __typename integrationTypeCode + tags { + key + values + } } ... on InfrastructureAwsLambdaFunctionEntityOutline { __typename integrationTypeCode runtime + tags { + key + values + } } ... on InfrastructureHostEntityOutline { __typename + tags { + key + values + } } ... on MobileApplicationEntityOutline { __typename applicationId + tags { + key + values + } } ... on SecureCredentialEntityOutline { __typename description secureCredentialId updatedAt + tags { + key + values + } } ... on SyntheticMonitorEntityOutline { __typename @@ -2148,14 +2195,26 @@ const getEntitySearchByQuery = `query( } ... on ThirdPartyServiceEntityOutline { __typename + tags { + key + values + } } ... on UnavailableEntityOutline { __typename + tags { + key + values + } } ... on WorkloadEntityOutline { __typename createdAt updatedAt + tags { + key + values + } } } nextCursor diff --git a/pkg/entities/types.go b/pkg/entities/types.go index c0a0f198..15decd22 100644 --- a/pkg/entities/types.go +++ b/pkg/entities/types.go @@ -17345,6 +17345,7 @@ type EntityOutlineInterface interface { GetGUID() common.EntityGUID GetName() string GetType() string + GetTags() []EntityTag } // UnmarshalEntityOutlineInterface unmarshals the interface into the correct type