Google Cloud Platform Logs integration error

Hello everybody and good times!

I want to forward GCP logs using the headerless API.

According to the documentation and the only available option I have is to generate a URL in the first step, the problem is that I get this error when I click the generate URL button:

There was an error while creating your API key

Here is the response from the network tab:

{
    "errors": [
        {
            "locations": [
                {
                    "column": 100,
                    "line": 1
                }
            ],
            "message": "Argument \"keys\" has invalid value {ingest: {accountId: $accountId, ingestType: LICENSE, name: $name, notes: $notes}}.\nIn field \"ingest\": Expected type \"[ApiAccessCreateIngestKeyInput]\", found {accountId: $accountId, ingestType: LICENSE, name: $name, notes: $notes}.\nIn element #1: Expected type \"ApiAccessCreateIngestKeyInput\", found {accountId: $accountId, ingestType: LICENSE, name: $name, notes: $notes}.\nIn field \"accountId\": Expected type \"Int!\", found $accountId."
        }
    ]
}

Is there something wrong with the GCP logs integration?

Could someone check if they can make Google Cloud Platform Logs integration work?
Any Ideas?

Thanks in forward!

1 Like

Hi @abbas.hosseini

Thanks for reaching out, I hope you are well!

Would it be possible for you to confirm what docs you are referencing as well as provide a permalink to where you are getting are getting the error.

I did locate this docs here that may be helpful, Forward logs from Google Cloud Platform | New Relic Documentation, which may be helpful.

Looking forward to hearing from you!

Hi @dcody

Thanks for your response! I’m very well, hope you’re doing great!

I’m using the 1st option -Headerless API- of the document you’ve linked to in you’re response.
link: Use headerless API

I’m stuck in the 1st step : 1. Generate a GCP Pub/Sub ingest URL by getting the following error.

Here is a screenshot and the response from the network tab

[
  {
    "locations": [
      {
        "column": 100,
        "line": 1
      }
    ],
    "message": "Argument \"keys\" has invalid value {ingest: {accountId: $accountId, ingestType: LICENSE, name: $name, notes: $notes}}.\nIn field \"ingest\": Expected type \"[ApiAccessCreateIngestKeyInput]\", found {accountId: $accountId, ingestType: LICENSE, name: $name, notes: $notes}.\nIn element #1: Expected type \"ApiAccessCreateIngestKeyInput\", found {accountId: $accountId, ingestType: LICENSE, name: $name, notes: $notes}.\nIn field \"accountId\": Expected type \"Int!\", found $accountId."
  }
]

And here is the request payload:

{
  "query": "mutation LoggingCreateApiKey($accountId: Int, $name: String, $notes: String) { apiAccessCreateKeys(keys: {ingest: {accountId: $accountId, ingestType: LICENSE, name: $name, notes: $notes}}) { createdKeys { key id __typename } errors { message ... on ApiAccessIngestKeyError { id errorType __typename } __typename } __typename } }",
  "variables": {
    "name": "GCP Logging API Key",
    "notes": "Automatically created by Logging setup"
  }
}
1 Like

Hi @dcody , I’ve also similar case, even change account into Admin the problem still persist.

@newrelic452 @abbas.hosseini

Thanks for reaching out!

I will need to loop in our Engineering team here to have a look as this is slightly out of my scope

Please note they will reach out here with their findings!

Hello @abbas.hosseini and @newrelic452 ,

After investigating, this appears to potentially be an Accounts permission issue on the New Relic side. I am having our Accounts team review. Once they have taken a look, we will update you as soon as we can.

Hi @cconde @dcody , thanks for your support.

Just want to update, the issue already fixed on my side and I’am able to use the feature to send GCP Logs to Newrelic by followign the docs.

1 Like