From be30ec76990492b9b55ef3eb3890992f2f04057b Mon Sep 17 00:00:00 2001 From: Michael Hoffmann Date: Tue, 7 Nov 2023 10:53:45 +0100 Subject: [PATCH 1/4] rfc(decision): DRAFT: Environment Variable conventions --- README.md | 2 +- ...-draft-environment-variable-conventions.md | 35 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 text/0121-draft-environment-variable-conventions.md diff --git a/README.md b/README.md index 15f699ef..30b31825 100644 --- a/README.md +++ b/README.md @@ -58,4 +58,4 @@ This repository contains RFCs and DACIs. Lost? - [0101-revamping-the-sdk-performance-api](text/0101-revamping-the-sdk-performance-api.md): Revamping the SDK Performance API - [0106-artifact-indices](text/0106-artifact-indices.md): Improvements to Source Maps Processing - [0116-sentry-semantic-conventions](text/0116-sentry-semantic-conventions.md): Sentry Semantic Conventions -- [0117-mobile-transactions-and-spans](text/0117-mobile-transactions-and-spans.md): Transactions and Spans for Mobile Platforms \ No newline at end of file +- [0117-mobile-transactions-and-spans](text/0117-mobile-transactions-and-spans.md): Transactions and Spans for Mobile Platforms- [0121-draft-environment-variable-conventions](text/0121-draft-environment-variable-conventions.md): DRAFT: Environment Variable conventions diff --git a/text/0121-draft-environment-variable-conventions.md b/text/0121-draft-environment-variable-conventions.md new file mode 100644 index 00000000..5f433e08 --- /dev/null +++ b/text/0121-draft-environment-variable-conventions.md @@ -0,0 +1,35 @@ +- Start Date: 2023-11-07 +- RFC Type: decision +- RFC PR: https://github.com/getsentry/rfcs/pull/121 +- RFC Status: draft + +# Summary + +One paragraph explanation of the feature or document purpose. + +# Motivation + +Why are we doing this? What use cases does it support? What is the expected outcome? + +# Background + +The reason this decision or document is required. This section might not always exist. + +# Supporting Data + +[Metrics to help support your decision (if applicable).] + +# Options Considered + +If an RFC does not know yet what the options are, it can propose multiple options. The +preferred model is to propose one option and to provide alternatives. + +# Drawbacks + +Why should we not do this? What are the drawbacks of this RFC or a particular option if +multiple options are presented. + +# Unresolved questions + +- What parts of the design do you expect to resolve through this RFC? +- What issues are out of scope for this RFC but are known? From 981a68074565162055ddd13d052e90130441393f Mon Sep 17 00:00:00 2001 From: Michael Hoffmann Date: Tue, 7 Nov 2023 12:29:17 +0100 Subject: [PATCH 2/4] Add inital RFC --- ...-draft-environment-variable-conventions.md | 38 ++++++++++++------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/text/0121-draft-environment-variable-conventions.md b/text/0121-draft-environment-variable-conventions.md index 5f433e08..16f3f809 100644 --- a/text/0121-draft-environment-variable-conventions.md +++ b/text/0121-draft-environment-variable-conventions.md @@ -5,31 +5,41 @@ # Summary -One paragraph explanation of the feature or document purpose. +We already expose certain environment variables that are consumed by SDKs, such as `SENTRY_DSN` and `SENTRY_RELEASE`. +To further ease usage, we should expose more options as such. +This RFC aims to find a set of conventions mainly aimed for server-side SDKs. # Motivation -Why are we doing this? What use cases does it support? What is the expected outcome? +Changing the SDK configuration most often requires a re-deployment of the application. This can be cumbersome for small changes, +such as updating the `traces_sample_rate`. Given the rise in populairty of server-less or containerized deployments, where +most configuration hails from envrionment variables, we should strive to make this workflow less cumbersome for our users. # Background -The reason this decision or document is required. This section might not always exist. +The Laravel SDK exposes the majority of its configuration as environment variables, making it a breeze to update the configuration of the SDK easily. +For a complete list of exposed variables, see https://github.com/getsentry/sentry-laravel/blob/9624a88c9cd9a50c22443fcdf3a0f77634b11210/config/sentry.php -# Supporting Data +# Options Considered -[Metrics to help support your decision (if applicable).] +A first list of environment variables that all server sides SDKs should support could look like: -# Options Considered +- `SENTRY_DSN` +- `SENTRY_RELEASE` +- `SENTRY_ENVIRONMENT` +- `SENTRY_SAMPLE_RATE` +- `SENTRY_TRACES_SAMPLE_RATE` +- `SENTRY_PROFILES_SAMPLE_RATE` -If an RFC does not know yet what the options are, it can propose multiple options. The -preferred model is to propose one option and to provide alternatives. +Further additions could include but are not limited to: -# Drawbacks +- `SENTRY_TAGS_` - An environment variable of `SENTRY_TAGS_foo = "bar"` would result in a tag of `foo: bar` being attached to all events. -Why should we not do this? What are the drawbacks of this RFC or a particular option if -multiple options are presented. +or SDK/framework-specific options, such as to control integrations or features -# Unresolved questions +- `SENTRY_BREADCRUMBS_LOGS_ENABLED` +- `SENTRY_TRACE_MISSING_ROUTES_ENABLED` + +# Drawbacks -- What parts of the design do you expect to resolve through this RFC? -- What issues are out of scope for this RFC but are known? +TBD From 58f68e8083ae4789b60599ba6b22acaf3f8f3759 Mon Sep 17 00:00:00 2001 From: Michael Hoffmann Date: Tue, 7 Nov 2023 12:37:56 +0100 Subject: [PATCH 3/4] Fix README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 30b31825..6eef1cdb 100644 --- a/README.md +++ b/README.md @@ -58,4 +58,5 @@ This repository contains RFCs and DACIs. Lost? - [0101-revamping-the-sdk-performance-api](text/0101-revamping-the-sdk-performance-api.md): Revamping the SDK Performance API - [0106-artifact-indices](text/0106-artifact-indices.md): Improvements to Source Maps Processing - [0116-sentry-semantic-conventions](text/0116-sentry-semantic-conventions.md): Sentry Semantic Conventions -- [0117-mobile-transactions-and-spans](text/0117-mobile-transactions-and-spans.md): Transactions and Spans for Mobile Platforms- [0121-draft-environment-variable-conventions](text/0121-draft-environment-variable-conventions.md): DRAFT: Environment Variable conventions +- [0117-mobile-transactions-and-spans](text/0117-mobile-transactions-and-spans.md): Transactions and Spans for Mobile Platforms +- [0121-draft-environment-variable-conventions](text/0121-draft-environment-variable-conventions.md): Environment Variable conventions From a295f11a034a8a6fb15cc3086637c3f81b799871 Mon Sep 17 00:00:00 2001 From: Michael Hoffmann Date: Mon, 13 Nov 2023 10:35:16 +0100 Subject: [PATCH 4/4] Add `SENTRY_DEBUG` --- text/0121-draft-environment-variable-conventions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/text/0121-draft-environment-variable-conventions.md b/text/0121-draft-environment-variable-conventions.md index 16f3f809..96aee604 100644 --- a/text/0121-draft-environment-variable-conventions.md +++ b/text/0121-draft-environment-variable-conventions.md @@ -30,6 +30,7 @@ A first list of environment variables that all server sides SDKs should support - `SENTRY_SAMPLE_RATE` - `SENTRY_TRACES_SAMPLE_RATE` - `SENTRY_PROFILES_SAMPLE_RATE` +- `SENTRY_DEBUG` Further additions could include but are not limited to: