011b378bae
Bumps [sentry-sdk](https://github.com/getsentry/sentry-python) from 1.41.0 to 1.42.0. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/getsentry/sentry-python/releases">sentry-sdk's releases</a>.</em></p> <blockquote> <h2>1.42.0</h2> <h3>Various fixes & improvements</h3> <ul> <li> <p><strong>New integration:</strong> <a href="https://docs.sentry.io/platforms/python/integrations/openai/">OpenAI integration</a> (<a href="https://redirect.github.com/getsentry/sentry-python/issues/2791">#2791</a>) by <a href="https://github.com/colin-sentry"><code>@colin-sentry</code></a></p> <p>We added an integration for OpenAI to capture errors and also performance data when using the OpenAI Python SDK.</p> <p>Useage:</p> <p>This integrations is auto-enabling, so if you have the <code>openai</code> package in your project it will be enabled. Just initialize Sentry before you create your OpenAI client.</p> <pre lang="python"><code>from openai import OpenAI <p>import sentry_sdk</p> <p>sentry_sdk.init( dsn="<em><strong>PUBLIC_DSN</strong></em>", enable_tracing=True, traces_sample_rate=1.0, )</p> <p>client = OpenAI() </code></pre></p> <p>For more information, see the documentation for <a href="https://docs.sentry.io/platforms/python/integrations/openai/">OpenAI integration</a>.</p> </li> <li> <p>Discard open OpenTelemetry spans after 10 minutes (<a href="https://redirect.github.com/getsentry/sentry-python/issues/2801">#2801</a>) by <a href="https://github.com/antonpirker"><code>@antonpirker</code></a></p> </li> <li> <p>Propagate sentry-trace and baggage headers to Huey tasks (<a href="https://redirect.github.com/getsentry/sentry-python/issues/2792">#2792</a>) by <a href="https://github.com/cnschn"><code>@cnschn</code></a></p> </li> <li> <p>Added Event type (<a href="https://redirect.github.com/getsentry/sentry-python/issues/2753">#2753</a>) by <a href="https://github.com/szokeasaurusrex"><code>@szokeasaurusrex</code></a></p> </li> <li> <p>Improve scrub_dict typing (<a href="https://redirect.github.com/getsentry/sentry-python/issues/2768">#2768</a>) by <a href="https://github.com/szokeasaurusrex"><code>@szokeasaurusrex</code></a></p> </li> <li> <p>Dependencies: bump types-protobuf from 4.24.0.20240302 to 4.24.0.20240311 (<a href="https://redirect.github.com/getsentry/sentry-python/issues/2797">#2797</a>) by <a href="https://github.com/dependabot"><code>@dependabot</code></a></p> </li> </ul> </blockquote> </details> <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/getsentry/sentry-python/blob/master/CHANGELOG.md">sentry-sdk's changelog</a>.</em></p> <blockquote> <h2>1.42.0</h2> <h3>Various fixes & improvements</h3> <ul> <li> <p><strong>New integration:</strong> <a href="https://docs.sentry.io/platforms/python/integrations/openai/">OpenAI integration</a> (<a href="https://redirect.github.com/getsentry/sentry-python/issues/2791">#2791</a>) by <a href="https://github.com/colin-sentry"><code>@colin-sentry</code></a></p> <p>We added an integration for OpenAI to capture errors and also performance data when using the OpenAI Python SDK.</p> <p>Useage:</p> <p>This integrations is auto-enabling, so if you have the <code>openai</code> package in your project it will be enabled. Just initialize Sentry before you create your OpenAI client.</p> <pre lang="python"><code>from openai import OpenAI <p>import sentry_sdk</p> <p>sentry_sdk.init( dsn="<em><strong>PUBLIC_DSN</strong></em>", enable_tracing=True, traces_sample_rate=1.0, )</p> <p>client = OpenAI() </code></pre></p> <p>For more information, see the documentation for <a href="https://docs.sentry.io/platforms/python/integrations/openai/">OpenAI integration</a>.</p> </li> <li> <p>Discard open OpenTelemetry spans after 10 minutes (<a href="https://redirect.github.com/getsentry/sentry-python/issues/2801">#2801</a>) by <a href="https://github.com/antonpirker"><code>@antonpirker</code></a></p> </li> <li> <p>Propagate sentry-trace and baggage headers to Huey tasks (<a href="https://redirect.github.com/getsentry/sentry-python/issues/2792">#2792</a>) by <a href="https://github.com/cnschn"><code>@cnschn</code></a></p> </li> <li> <p>Added Event type (<a href="https://redirect.github.com/getsentry/sentry-python/issues/2753">#2753</a>) by <a href="https://github.com/szokeasaurusrex"><code>@szokeasaurusrex</code></a></p> </li> <li> <p>Improve scrub_dict typing (<a href="https://redirect.github.com/getsentry/sentry-python/issues/2768">#2768</a>) by <a href="https://github.com/szokeasaurusrex"><code>@szokeasaurusrex</code></a></p> </li> <li> <p>Dependencies: bump types-protobuf from 4.24.0.20240302 to 4.24.0.20240311 (<a href="https://redirect.github.com/getsentry/sentry-python/issues/2797">#2797</a>) by <a href="https://github.com/dependabot"><code>@dependabot</code></a></p> </li> </ul> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href=" |
||
---|---|---|
.. | ||
server | ||
README.md |
README.md
Cirrus
Cirrus is a feature configuration server that allows clients to obtain a set of features based on their provided client_id
and context
information.
This document provides information on setting up the Cirrus environment, including required environment variables and commands for running and testing Cirrus.
Environment Setup
To set up the Cirrus environment, follow these steps:
-
Create a
.env
file inside thecirrus/server
directory. -
Copy the contents of
.env.example
into.env
by running the following command:cp .env.example .env
-
Open the
.env
file and modify the values of the following environment variables:CIRRUS_REMOTE_SETTING_URL=https://firefox.settings.services.mozilla.com/v1/buckets/main/collections/nimbus-web-experiments/records CIRRUS_REMOTE_SETTING_REFRESH_RATE_IN_SECONDS=10 CIRRUS_APP_ID=test_app_id CIRRUS_APP_NAME=test_app_name CIRRUS_CHANNEL=developer CIRRUS_FML_PATH=./feature_manifest/sample.fml.yaml CIRRUS_SENTRY_DSN=dsn_url CIRRUS_INSTANCE_NAME=cirrus_pod_app_v1 CIRRUS_ENV_NAME=test_app_stage CIRRUS_GLEAN_MAX_EVENTS_BUFFER=10
Here's what each variable represents:
CIRRUS_REMOTE_SETTING_URL
: The URL of the remote settings where the experiments data is stored. In this case, it points to the collection of nimbus web experiments.CIRRUS_REMOTE_SETTING_REFRESH_RATE_IN_SECONDS
: The refresh rate in seconds for fetching the experiments recipes from the remote settings. Set it to10
to retrieve the latest data every 10 seconds.CIRRUS_APP_ID
: Replacetest_app_id
with the actual ID of your application for examplefirefox-desktop
.CIRRUS_APP_NAME
: Replacetest_app_name
with the desired name for your application for examplefirefox_desktop
.CIRRUS_CHANNEL
: Replacedeveloper
with the channel likebeta
,release
etc.CIRRUS_FML_PATH
: The file path to the feature manifest file. Set it to./feature_manifest/sample.fml.yaml
or specify the correct path to your feature manifest file.CIRRUS_SENTRY_DSN
: Replacedsn_url
with the appropriate DSN value.CIRRUS_INSTANCE_NAME
: Replace with the instance name.CIRRUS_ENV_NAME:
Replace with the concatenation of project and environment nameCIRRUS_GLEAN_MAX_EVENTS_BUFFER
: This value represents the max events buffer size for glean. You can set the value from range 1 to 500, by default Cirrus sets it to 10.
Adjust the values of these variables according to your specific configuration requirements.
By following these steps, you will create the .env
file and configure the necessary environment variables for the Cirrus application.
Commands
The following are the available commands for working with Cirrus:
-
cirrus_build: Builds the Cirrus container.
- Usage:
make cirrus_build
- Usage:
-
cirrus_up: Starts the Cirrus container.
- Usage:
make cirrus_up
- Usage:
-
cirrus_down:
cirrus_down
: Stops the Cirrus container.- Usage:
make cirrus_down
- Usage:
-
cirrus_test: Runs tests for the Cirrus application.
- Usage:
make cirrus_test
- Usage:
-
cirrus_check: Performs various checks on the Cirrus application including Ruff linting, Black code formatting check, Pyright static type checking, pytest tests, and documentation generation..
- Usage:
make cirrus_check
- Usage:
-
cirrus_code_format: Formats the code in the Cirrus application.
- Usage:
make cirrus_code_format
- Usage:
-
cirrus_typecheck_createstub: Performs static type checking and creates stub files.
- Usage:
make cirrus_typecheck_createstub
- Usage:
-
cirrus_generate_docs: Generates documentation for the Cirrus application such as openapi schema.
- Usage:
make cirrus_generate_docs
- Usage:
OpenAPI Schema
OpenAPI schema for the Cirrus API
Cirrus Server to get Feature configuration API structure
Api Doc
Cirrus Api Doc for the Cirrus API
Endpoint
POST /v1/features/
- When making a POST request, please make sure to set headers content type as JSON
headers: { "Content-Type": "application/json", }
Input
The input should be a JSON object with the following properties:
client_id
(string): Used for bucketing calculation.context
(object): Used for context. It can have any key-value pair.any-key
(anytype).language
(string): Optional fieldregion
(string): Optional field
Note: Make sure to provide a key-value pair when making a call, setting the context
value as {}
will be considered as False
value. For testing you can set value such as
context: { key: "example-key" }
Example input:
{
"client_id": "4a1d71ab-29a2-4c5f-9e1d-9d9df2e6e449",
"context": {
"key1": "value1",
"key2": {
"key2.1": "value2",
"key2.2": "value3"
}
}
}
- To target clients based on
languages
you can use key aslanguage
and it supports list of languages
Example input:
{
"client_id": "4a1d71ab-29a2-4c5f-9e1d-9d9df2e6e449",
"context": {
"language": "en"
}
}
- To target clients based on
country
you can use key asregion
and it supports list of countries
Example input:
{
"client_id": "4a1d71ab-29a2-4c5f-9e1d-9d9df2e6e449",
"context": {
"region": "US"
}
}
- To target client based on both
language
andcountry
Example input:
{
"client_id": "4a1d71ab-29a2-4c5f-9e1d-9d9df2e6e449",
"context": {
"language": "en",
"region": "US"
}
}
- You can make your custom field to target too. Prepare what fields you want to be be able to target on, and then work backwards to construct it and populate a targeting context that will satisfy that. Example input:
{
"client_id": "4a1d71ab-29a2-4c5f-9e1d-9d9df2e6e449",
"context": {
"random_key": "random_value",
}
}
Output
The output will be a JSON object with the following properties:
features
(object): An object that contains the set of features. Each feature is represented as a sub-object with its own set of variables.
Example output:
{
"Feature1": {
"Variable1.1": "valueA",
"Variable1.2": "valueB"
},
"Feature2": {
"Variable2.1": "valueC",
"Variable2.2": "valueD"
},
"FeatureN": {
"VariableN.1": "valueX",
"VariableN.2": "valueY"
}
}
Notes
- This API only accepts POST requests.
- All parameters should be supplied in the body as JSON.