René's URL Explorer Experiment


Title: Custom logs from a GCP Function do not contain execution-id · Issue #343 · googleapis/python-logging · GitHub

Open Graph Title: Custom logs from a GCP Function do not contain execution-id · Issue #343 · googleapis/python-logging

X Title: Custom logs from a GCP Function do not contain execution-id · Issue #343 · googleapis/python-logging

Description: I am not sure if this is a bug or a misconfiguration issue but we are unable to get the execution-id in our logs. GCP's own function logs like startup/teardown/timeout contain it however our own logs don't. This makes it impossible to co...

Open Graph Description: I am not sure if this is a bug or a misconfiguration issue but we are unable to get the execution-id in our logs. GCP's own function logs like startup/teardown/timeout contain it however our own lo...

X Description: I am not sure if this is a bug or a misconfiguration issue but we are unable to get the execution-id in our logs. GCP's own function logs like startup/teardown/timeout contain it however our ow...

Opengraph URL: https://github.com/googleapis/python-logging/issues/343

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Custom logs from a GCP Function do not contain execution-id","articleBody":"I am not sure if this is a bug or a misconfiguration issue but we are unable to get the `execution-id` in our logs. GCP's own function logs like startup/teardown/timeout contain it however our own logs don't. This makes it impossible to correlate all logs from an instance. \r\n\r\nExample (GCP function startup log)\r\n```\r\n{\r\n  insertId: \"000000-a51b0cd9-1f4d-4396-b812-4b35c8878b69\"\r\n  labels: {\r\n    execution_id: \"j57c7yk340qq\"\r\n  }\r\n  logName: \"projects/PROJECT-ID/logs/cloudfunctions.googleapis.com%2Fcloud-functions\"\r\n  receiveTimestamp: \"2021-06-30T17:37:16.202805413Z\"\r\n  resource: {\r\n    labels: {\r\n      function_name: \"FUNCTION-NAME\",\r\n      project_id: \"PROJECT-ID\",\r\n      region: \"REGION\"\r\n    }\r\n    type: \"cloud_function\"\r\n  }\r\n  severity: \"DEBUG\"\r\n  textPayload: \"Function execution started\"\r\n  timestamp: \"2021-06-30T17:37:05.341077546Z\"\r\n}\r\n```\r\nWe also tried setting a custom label in `CloudLoggingHandler` with a `trace-id` however GCP's own logs don't reflect the custom `trace-id`. This makes me think that GCP is using a separate logger which attaches the `execution-id` and our logs are isolated from that logger. \r\n\r\n#### Environment details\r\n\r\n  - OS type and version: N/A\r\n  - Python version: 3.7.9\r\n  - pip version: 21.1.2\r\n  - `google-cloud-logging` version:  2.3.1\r\n\r\n#### Steps to reproduce\r\n\r\n  1. Create and attach `CloudLoggingHandler` to a logger in a GCP function\r\n  2. Log an `INFO` message\r\n  3. Verify the log does not contain `execution-id` inside `labels`\r\n  \r\n#### Code example\r\nA simplified version of our logging setup and a basic event-trigger function.\r\n\r\n```python\r\nimport logging\r\n\r\nimport google.cloud.logging\r\nfrom google.cloud.logging_v2.handlers.handlers import CloudLoggingHandler\r\n\r\n\r\nclass FunctionLogger(logging.Logger):\r\n\r\n    def __init__(self, level=logging.NOTSET):\r\n        super().__init__(\"logger_name\", level)\r\n\r\n        client = google.cloud.logging.Client()\r\n\r\n        self._handler = CloudLoggingHandler(client)\r\n\r\n        self.propagate = False  # prevent logging from root logger\r\n        self.addHandler(self._handler)\r\n\r\n\r\ndef handler(event, context=None):\r\n    \"\"\"function entry point\"\"\"\r\n    logger = FunctionLogger()\r\n\r\n    logger.info(\"Test message\")\r\n```\r\n\r\nThanks!!","author":{"url":"https://github.com/amertkara","@type":"Person","name":"amertkara"},"datePublished":"2021-06-30T18:06:38.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/343/python-logging/issues/343"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:1e4bc9b8-657d-5179-0ed0-726e0cbc72dd
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA430:2086C7:78CC965:A9A772D:6A50256F
html-safe-nonce09435a9e7c8b655602b01fdd49576145e475edd911e88cae1db916b72199c212
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNDMwOjIwODZDNzo3OENDOTY1OkE5QTc3MkQ6NkE1MDI1NkYiLCJ2aXNpdG9yX2lkIjoiMjkwNzg4NTc5NTQwMTU0MDk3NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac1ca02e283ac7225afc77f23fd3b1fb93090d923fb6df45dab98d658cec9e9802
hovercard-subject-tagissue:933965341
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/googleapis/python-logging/343/issue_layout
twitter:imagehttps://opengraph.githubassets.com/338da7a3d3982e0e0ee3962a668221e695b618b184cd9156c4d248f940a6cd58/googleapis/python-logging/issues/343
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/338da7a3d3982e0e0ee3962a668221e695b618b184cd9156c4d248f940a6cd58/googleapis/python-logging/issues/343
og:image:altI am not sure if this is a bug or a misconfiguration issue but we are unable to get the execution-id in our logs. GCP's own function logs like startup/teardown/timeout contain it however our own lo...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameamertkara
hostnamegithub.com
expected-hostnamegithub.com
Nonea08040246389072795e3b4e7b33c6d9a0c564eee02e829a809326d67c418b069
turbo-cache-controlno-preview
go-importgithub.com/googleapis/python-logging git https://github.com/googleapis/python-logging.git
octolytics-dimension-user_id16785467
octolytics-dimension-user_logingoogleapis
octolytics-dimension-repository_id226992562
octolytics-dimension-repository_nwogoogleapis/python-logging
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id226992562
octolytics-dimension-repository_network_root_nwogoogleapis/python-logging
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
released1b91b18e7330fc458dfd824c61eaed7daa830d6
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/googleapis/python-logging/issues/343#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fpython-logging%2Fissues%2F343
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgoogleapis%2Fpython-logging%2Fissues%2F343
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=googleapis%2Fpython-logging
Reloadhttps://github.com/googleapis/python-logging/issues/343
Reloadhttps://github.com/googleapis/python-logging/issues/343
Reloadhttps://github.com/googleapis/python-logging/issues/343
Please reload this pagehttps://github.com/googleapis/python-logging/issues/343
googleapis https://github.com/googleapis
python-logginghttps://github.com/googleapis/python-logging
Notifications https://github.com/login?return_to=%2Fgoogleapis%2Fpython-logging
Fork 59 https://github.com/login?return_to=%2Fgoogleapis%2Fpython-logging
Star 142 https://github.com/login?return_to=%2Fgoogleapis%2Fpython-logging
Code https://github.com/googleapis/python-logging
Issues 0 https://github.com/googleapis/python-logging/issues
Pull requests 0 https://github.com/googleapis/python-logging/pulls
Actions https://github.com/googleapis/python-logging/actions
Projects https://github.com/googleapis/python-logging/projects
Security and quality 0 https://github.com/googleapis/python-logging/security
Insights https://github.com/googleapis/python-logging/pulse
Code https://github.com/googleapis/python-logging
Issues https://github.com/googleapis/python-logging/issues
Pull requests https://github.com/googleapis/python-logging/pulls
Actions https://github.com/googleapis/python-logging/actions
Projects https://github.com/googleapis/python-logging/projects
Security and quality https://github.com/googleapis/python-logging/security
Insights https://github.com/googleapis/python-logging/pulse
Custom logs from a GCP Function do not contain execution-idhttps://github.com/googleapis/python-logging/issues/343#top
https://github.com/daniel-sanche
api: loggingIssues related to the googleapis/python-logging API.https://github.com/googleapis/python-logging/issues?q=state%3Aopen%20label%3A%22api%3A%20logging%22
priority: p2Moderately-important priority. Fix may not be included in next release.https://github.com/googleapis/python-logging/issues?q=state%3Aopen%20label%3A%22priority%3A%20p2%22
type: questionRequest for information or clarification. Not an issue.https://github.com/googleapis/python-logging/issues?q=state%3Aopen%20label%3A%22type%3A%20question%22
https://github.com/amertkara
amertkarahttps://github.com/amertkara
on Jun 30, 2021https://github.com/googleapis/python-logging/issues/343#issue-933965341
daniel-sanchehttps://github.com/daniel-sanche
api: loggingIssues related to the googleapis/python-logging API.https://github.com/googleapis/python-logging/issues?q=state%3Aopen%20label%3A%22api%3A%20logging%22
priority: p2Moderately-important priority. Fix may not be included in next release.https://github.com/googleapis/python-logging/issues?q=state%3Aopen%20label%3A%22priority%3A%20p2%22
type: questionRequest for information or clarification. Not an issue.https://github.com/googleapis/python-logging/issues?q=state%3Aopen%20label%3A%22type%3A%20question%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.