Skip to content

Wrong project ID when running cloud monitoring custom metrics sample #244

Closed
@gtaylor

Description

@gtaylor

Trying to run this sample:
https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/monitoring/api/v3/custom_metric.py

Command is:

python custom_metric.py --project_id=evennia-game-directory

Output is:

  File "/home/gtaylor/workspace/evennia-game-dir/evennia_gamedir/views/game_list.py", line 13, in game_list
    metric_poop()
  File "/home/gtaylor/workspace/evennia-game-dir/evennia_gamedir/views/game_list.py", line 60, in metric_poop
    name=project_resource, body=metrics_descriptor).execute()
  File "/home/gtaylor/workspace/evennia-game-dir/lib/oauth2client/util.py", line 137, in positional_wrapper
    return wrapped(*args, **kwargs)
  File "/home/gtaylor/workspace/evennia-game-dir/lib/googleapiclient/http.py", line 760, in execute
    raise HttpError(resp, content, uri=self.uri)
HttpError: <HttpError 403 when requesting https://monitoring.googleapis.com/v3/projects/evennia-game-directory/metricDescriptors?alt=json returned "Google Monitoring API has not been used in project 32555940559 before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/monitoring/overview?project=32555940559 then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.">
INFO     2016-04-07 05:43:27,970 module.py:787] default: "GET / HTTP/1.1" 500 291

It's tossing out a weird project ID, so when I follow the link I get something odd:
image
Seems like it's got me in some invalid project.

If I go to the actual project and look at the permissions, I've got them enabled (as of 20+ minutes ago):
image

Any ideas? I'm aiming to get this working within App Engine, which I'm not sure is even possible. I'm running these samples from my dev machine with the latest gcloud SDK after having done gcloud auth login.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    🚨This issue needs some love.triage meI really want to be triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions