diff --git a/README.md b/README.md index 249fed4..700984c 100644 --- a/README.md +++ b/README.md @@ -319,7 +319,7 @@ nrq apps get "production-api" **Table Output:** ``` ID: 12345678 -GUID: MjcxMjY0MHxBUE18QVBQTElDQVRJT058MTIzNDU2Nzg +GUID: MTIzNDU2N3xBUE18QVBQTElDQVRJT058MTIzNDU2Nzg Name: production-api Language: ruby Alert Status: NOT_ALERTING @@ -420,7 +420,7 @@ nrq deployments list 12345678 nrq deployments list --name "My Application" # By entity GUID -nrq deployments list --guid "MjcxMjY0MHxBUE18..." +nrq deployments list --guid "MTIzNDU2N3xBUE18..." # With time filtering nrq deployments list 12345678 --since "7 days ago" --until "yesterday" @@ -459,7 +459,7 @@ nrq deployments create 12345678 --revision v1.2.3 nrq deployments create --name "My Application" --revision v1.2.3 # By entity GUID -nrq deployments create --guid "MjcxMjY0MHxBUE18..." --revision v1.2.3 +nrq deployments create --guid "MTIzNDU2N3xBUE18..." --revision v1.2.3 # Full example nrq deployments create 12345678 \ diff --git a/api/resolve_test.go b/api/resolve_test.go index 1373bcf..80362d3 100644 --- a/api/resolve_test.go +++ b/api/resolve_test.go @@ -12,17 +12,17 @@ import ( func TestEntityGUID_Parse(t *testing.T) { t.Run("valid APM application GUID", func(t *testing.T) { // Create a valid GUID: version|domain|type|entityId - rawGUID := "2712640|APM|APPLICATION|137708979" + rawGUID := "1234567|APM|APPLICATION|123456789" encoded := base64.StdEncoding.EncodeToString([]byte(rawGUID)) guid := EntityGUID(encoded) version, domain, entityType, entityID, err := guid.Parse() assert.NoError(t, err) - assert.Equal(t, "2712640", version) + assert.Equal(t, "1234567", version) assert.Equal(t, "APM", domain) assert.Equal(t, "APPLICATION", entityType) - assert.Equal(t, "137708979", entityID) + assert.Equal(t, "123456789", entityID) }) t.Run("invalid base64", func(t *testing.T) { @@ -36,7 +36,7 @@ func TestEntityGUID_Parse(t *testing.T) { t.Run("invalid format - wrong number of parts", func(t *testing.T) { // Only 3 parts instead of 4 - rawGUID := "2712640|APM|APPLICATION" + rawGUID := "1234567|APM|APPLICATION" encoded := base64.StdEncoding.EncodeToString([]byte(rawGUID)) guid := EntityGUID(encoded) @@ -49,18 +49,18 @@ func TestEntityGUID_Parse(t *testing.T) { func TestEntityGUID_AppID(t *testing.T) { t.Run("valid APM application GUID", func(t *testing.T) { - rawGUID := "2712640|APM|APPLICATION|137708979" + rawGUID := "1234567|APM|APPLICATION|123456789" encoded := base64.StdEncoding.EncodeToString([]byte(rawGUID)) guid := EntityGUID(encoded) appID, err := guid.AppID() assert.NoError(t, err) - assert.Equal(t, "137708979", appID) + assert.Equal(t, "123456789", appID) }) t.Run("non-APM entity", func(t *testing.T) { - rawGUID := "2712640|BROWSER|APPLICATION|137708979" + rawGUID := "1234567|BROWSER|APPLICATION|123456789" encoded := base64.StdEncoding.EncodeToString([]byte(rawGUID)) guid := EntityGUID(encoded) @@ -71,7 +71,7 @@ func TestEntityGUID_AppID(t *testing.T) { }) t.Run("non-APPLICATION type", func(t *testing.T) { - rawGUID := "2712640|APM|HOST|137708979" + rawGUID := "1234567|APM|HOST|123456789" encoded := base64.StdEncoding.EncodeToString([]byte(rawGUID)) guid := EntityGUID(encoded) @@ -84,7 +84,7 @@ func TestEntityGUID_AppID(t *testing.T) { func TestEntityGUID_Validate(t *testing.T) { t.Run("valid GUID", func(t *testing.T) { - rawGUID := "2712640|APM|APPLICATION|137708979" + rawGUID := "1234567|APM|APPLICATION|123456789" encoded := base64.StdEncoding.EncodeToString([]byte(rawGUID)) guid := EntityGUID(encoded) @@ -103,7 +103,7 @@ func TestEntityGUID_Validate(t *testing.T) { } func TestEntityGUID_Domain(t *testing.T) { - rawGUID := "2712640|APM|APPLICATION|137708979" + rawGUID := "1234567|APM|APPLICATION|123456789" encoded := base64.StdEncoding.EncodeToString([]byte(rawGUID)) guid := EntityGUID(encoded) @@ -114,7 +114,7 @@ func TestEntityGUID_Domain(t *testing.T) { } func TestEntityGUID_EntityType(t *testing.T) { - rawGUID := "2712640|APM|APPLICATION|137708979" + rawGUID := "1234567|APM|APPLICATION|123456789" encoded := base64.StdEncoding.EncodeToString([]byte(rawGUID)) guid := EntityGUID(encoded) @@ -125,14 +125,14 @@ func TestEntityGUID_EntityType(t *testing.T) { } func TestEntityGUID_EntityID(t *testing.T) { - rawGUID := "2712640|APM|APPLICATION|137708979" + rawGUID := "1234567|APM|APPLICATION|123456789" encoded := base64.StdEncoding.EncodeToString([]byte(rawGUID)) guid := EntityGUID(encoded) entityID, err := guid.EntityID() assert.NoError(t, err) - assert.Equal(t, "137708979", entityID) + assert.Equal(t, "123456789", entityID) } func TestEntityGUID_String(t *testing.T) { @@ -169,7 +169,7 @@ func TestIsNumeric(t *testing.T) { func TestIsValidEntityGUID(t *testing.T) { t.Run("valid base64 GUID", func(t *testing.T) { - rawGUID := "2712640|APM|APPLICATION|137708979" + rawGUID := "1234567|APM|APPLICATION|123456789" encoded := base64.StdEncoding.EncodeToString([]byte(rawGUID)) assert.True(t, IsValidEntityGUID(encoded)) diff --git a/internal/cmd/dashboards/dashboards.go b/internal/cmd/dashboards/dashboards.go index 5d95635..f11426c 100644 --- a/internal/cmd/dashboards/dashboards.go +++ b/internal/cmd/dashboards/dashboards.go @@ -100,7 +100,7 @@ func newGetCmd(opts *root.Options) *cobra.Command { The GUID is a base64-encoded entity identifier from 'dashboards list' or the New Relic UI (visible in the dashboard URL).`, - Example: ` nrq dashboards get "MjcxMjY0MHxWSVp8REFTSEJPQVJEXDI5Mjg="`, + Example: ` nrq dashboards get "MTIzNDU2N3xWSVp8REFTSEJPQVJEXDI5Mjg="`, Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { return runGet(opts, api.EntityGUID(args[0])) @@ -252,7 +252,7 @@ func newUpdateCmd(opts *root.Options) *cobra.Command { The JSON file format is the same as for 'dashboards create'. The GUID identifies which dashboard to update.`, Example: ` # Update a dashboard from a JSON file - nrq dashboards update "MjcxMjY0MHxWSVp8REFTSEJPQVJEXDI5Mjg=" --from-file dashboard.json`, + nrq dashboards update "MTIzNDU2N3xWSVp8REFTSEJPQVJEXDI5Mjg=" --from-file dashboard.json`, Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { return runUpdate(updateOpts, api.EntityGUID(args[0])) @@ -329,10 +329,10 @@ Use --force to skip the confirmation prompt. WARNING: This action cannot be undone.`, Example: ` # Delete with confirmation - nrq dashboards delete "MjcxMjY0MHxWSVp8REFTSEJPQVJEXDI5Mjg=" + nrq dashboards delete "MTIzNDU2N3xWSVp8REFTSEJPQVJEXDI5Mjg=" # Delete without confirmation (use with caution) - nrq dashboards delete "MjcxMjY0MHxWSVp8REFTSEJPQVJEXDI5Mjg=" --force`, + nrq dashboards delete "MTIzNDU2N3xWSVp8REFTSEJPQVJEXDI5Mjg=" --force`, Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { return runDelete(deleteOpts, api.EntityGUID(args[0])) diff --git a/internal/cmd/deployments/deployments.go b/internal/cmd/deployments/deployments.go index ff413df..9c216b9 100644 --- a/internal/cmd/deployments/deployments.go +++ b/internal/cmd/deployments/deployments.go @@ -64,7 +64,7 @@ Examples: nrq deployments list --name "my-production-app" # By entity GUID - nrq deployments list --guid "MjcxMjY0MHxBUE18QVBQTElDQVRJT058MTM3NzA4OTc5OQ" + nrq deployments list --guid "MTIzNDU2N3xBUE18QVBQTElDQVRJT058MTIzNDU2Nzg5OQ" # With time filtering nrq deployments list 12345678 --since "7 days ago" diff --git a/internal/cmd/logs/logs.go b/internal/cmd/logs/logs.go index 61ba919..92c7b7d 100644 --- a/internal/cmd/logs/logs.go +++ b/internal/cmd/logs/logs.go @@ -60,7 +60,7 @@ Filter syntax uses Lucene query format: Time range flags (--since, --until) set the visible window in the log viewer. Without them, NR defaults to the last 30 minutes which may miss older data.`, Example: ` # Link to error logs for a service (last hour) - nrq logs link 'entity.name:"prd-use1-monitapp-user-api-service" level:"ERROR"' --since "1 hour ago" + nrq logs link 'entity.name:"checkout-service" level:"ERROR"' --since "1 hour ago" # Link to logs in a specific time range nrq logs link 'message:"*timeout*"' --since "2026-03-10" --until "2026-03-11" diff --git a/internal/deeplink/deeplink_test.go b/internal/deeplink/deeplink_test.go index d867cd9..b62ffd9 100644 --- a/internal/deeplink/deeplink_test.go +++ b/internal/deeplink/deeplink_test.go @@ -20,7 +20,7 @@ func TestBuildNRQLDeepLink(t *testing.T) { }{ { name: "simple query", - accountID: 2712640, + accountID: 1234567, nrql: "SELECT count(*) FROM Transaction SINCE 1 hour ago", }, { @@ -79,12 +79,12 @@ func TestBuildLogDeepLink(t *testing.T) { }{ { name: "single entity error filter", - accountID: 2712640, - filterQuery: `entity.name:"prd-use1-monitapp-user-api-service" level:"ERROR"`, + accountID: 1234567, + filterQuery: `entity.name:"checkout-service" level:"ERROR"`, }, { name: "multiple entities", - accountID: 2712640, + accountID: 1234567, filterQuery: `(entity.name:"svc-a" OR entity.name:"svc-b") level:"ERROR"`, }, { @@ -94,7 +94,7 @@ func TestBuildLogDeepLink(t *testing.T) { }, { name: "with time range", - accountID: 2712640, + accountID: 1234567, filterQuery: `level:"ERROR"`, beginMs: 1773323224894, endMs: 1773323344894,