{"id":21426019,"url":"https://github.com/bastiankistner/stackdriver-logging-json","last_synced_at":"2025-03-16T21:14:21.060Z","repository":{"id":57369194,"uuid":"313402147","full_name":"bastiankistner/stackdriver-logging-json","owner":"bastiankistner","description":"Plain JSON entries for Stackdriver Logging to be used with Google's logging client or standard streams (e.g. winston, tslog, bunyan, pino). Examples, additional utils and a formatter for GCP managed k8s fluent-bit included.","archived":false,"fork":false,"pushed_at":"2020-11-29T20:32:33.000Z","size":583,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-11T03:41:50.626Z","etag":null,"topics":["bunyan","google","google-cloud-logging","kubernetes","logging","pino","stackdriver","stdout","winston"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bastiankistner.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-16T19:11:18.000Z","updated_at":"2023-03-07T16:57:22.000Z","dependencies_parsed_at":"2022-09-09T13:10:39.822Z","dependency_job_id":null,"html_url":"https://github.com/bastiankistner/stackdriver-logging-json","commit_stats":null,"previous_names":["passionkind/stackdriver-logging-json"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bastiankistner%2Fstackdriver-logging-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bastiankistner%2Fstackdriver-logging-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bastiankistner%2Fstackdriver-logging-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bastiankistner%2Fstackdriver-logging-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bastiankistner","download_url":"https://codeload.github.com/bastiankistner/stackdriver-logging-json/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243933437,"owners_count":20370986,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bunyan","google","google-cloud-logging","kubernetes","logging","pino","stackdriver","stdout","winston"],"created_at":"2024-11-22T21:39:33.192Z","updated_at":"2025-03-16T21:14:21.038Z","avatar_url":"https://github.com/bastiankistner.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JSON Logging for Stackdriver\n\n## Features\n\n- ✅ out of the box support for tracing\n- ✅ out of the box support for error stacks\n- ✅ out of the box support for Google Error Reporting\n- ✅ compliant with @google-cloud/logging\n- ✅ compliant with std output (e.g. for kubernetes)\n- ✅ includes formatter for fluent-bit 1.3.0\n\n## IMPORTANT ⚠️\n\nTo use with typescript, ensure you have `\"strictNullChecks\": true,` set in your `tsconfig.json`. Otherwise typescript will complain about `never` incompatiblity with string related to `resource` when passing an entry to a formatter.\n\nSEE: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-0.html#--strictnullchecks\n\nTODO: maybe we could disble strict null checks and see if we're compatible without too many changes (but removing `undefined` from resource, httpRequest and wherever else we have used it in combination with generics)\n\n## Tracing\n\n- will work out of the box when used with compatible library (e.g. OpenCensus or OpenTelemetry [recommended])\n\n## Error Reporting\n\nsee https://cloud.google.com/error-reporting/docs/formatting-error-messages#json_representation\n\n**Required**\n\n- `serviceContext.service`\n- `message` as `Error.message` and including `Error.stack` (will be extracted automatically if message is instance of `Error`)\n\n## resource\n\nWhen using Stackdriver Logging Client:\nDefine manually if using Stackdriver Client and default `global` does not fit.\n\nWhen using collector agent:\nWill be set automatically.\n\n## Entry comparison\n\n### Cloud Logging Client Entry\n\n### Standard Entry\n\n- you should provide a `logName` unless you're using a collector agent (e.g. fluentd or fluent-bit), which would rewrite `logName` to either `std_out` or `std_err`\n\n## Fluent Bit\n\n- does not need `logName`\n- does not need `resource`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbastiankistner%2Fstackdriver-logging-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbastiankistner%2Fstackdriver-logging-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbastiankistner%2Fstackdriver-logging-json/lists"}