All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
-
Batch Processing for User Profile Service (UPS): Added support for batch processing in
decideAll
anddecideForKeys
, enabling more efficient handling of multiple decisions in the User Profile Service. (#394) -
Optimized Logging: Reduced log verbosity in the Decision flow by shifting info-level logs to debug. This change will significantly reduce the volume of logs at the info level, improving readability and performance for applications with high decision-making activity. (#390)
The 2.0.0 release introduces a new primary feature, Advanced Audience Targeting enabled through integration with Optimizely Data Platform (ODP) (#350, #353, #354, #355).
You can use ODP, a high-performance Customer Data Platform (CDP), to easily create complex real-time segments (RTS) using first-party and 50+ third-party data sources out of the box. You can create custom schemas that support the user attributes important for your business, and stitch together user behavior done on different devices to better understand and target your customers for personalized user experiences. ODP can be used as a single source of truth for these segments in any Optimizely or 3rd party tool.
With ODP accounts integrated into Optimizely projects, you can build audiences using segments pre-defined in ODP. The SDK will fetch the segments for given users and make decisions using the segments. For access to ODP audience targeting in your Feature Experimentation account, please contact your Optimizely Customer Success Manager.
This version includes the following changes:
-
New API added to
OptimizelyUserContext
:-
FetchQualifiedSegments()
: this API will retrieve user segments from the ODP server. The fetched segments will be used for audience evaluation. The fetched data will be stored in the local cache to avoid repeated network delays. -
When an
OptimizelyUserContext
is created, the SDK will automatically send an identify request to the ODP server to facilitate observing user activities.
-
-
New APIs added to
OptimizelyClient
:SendOdpEvent()
: customers can build/send arbitrary ODP events that will bind user identifiers and data to user profiles in ODP.
For details, refer to our documentation pages:
- ODPManager in the SDK is enabled by default. Unless an ODP account is integrated into the Optimizely projects, most ODPManager functions will be ignored. If needed, ODPManager can be disabled when
OptimizelyClient
is instantiated. - Minimum golang version changed from 1.13 to 1.21.0. (#369, #380)
- Module name has been changed to
github.com/optimizely/go-sdk/v2
.
- Logged correct error message in HTTP requests. (#374)
- Stopped all tickers to prevent goroutine leak. (#375).
- Client is closed gracefully to dispatch queued events. (#376)
- Convert warning into error log for SyncConfig failure. (#383)
- Github issue template is updated. (#379)
- Helper function for passing notification center is added. (#381)
- OpenTelemetry tracing support is added. (#385)
- New ClientOptionFunc
WithTracer()
is added to initiateOptimizelyClient
with OpenTelemetry tracer. - New method
WithTraceContext()
is added toOptimizelyClient
to set the trace context before calling APIs.
- New ClientOptionFunc
- Fixed a bug in the HTTP Requester logging. Now correct error message is logged. (#374)
The 2.0.0-beta release introduces a new primary feature, Advanced Audience Targeting enabled through integration with Optimizely Data Platform (ODP) (#350, #353, #354, #355).
You can use ODP, a high-performance Customer Data Platform (CDP), to easily create complex real-time segments (RTS) using first-party and 50+ third-party data sources out of the box. You can create custom schemas that support the user attributes important for your business, and stitch together user behavior done on different devices to better understand and target your customers for personalized user experiences. ODP can be used as a single source of truth for these segments in any Optimizely or 3rd party tool.
With ODP accounts integrated into Optimizely projects, you can build audiences using segments pre-defined in ODP. The SDK will fetch the segments for given users and make decisions using the segments. For access to ODP audience targeting in your Feature Experimentation account, please contact your Optimizely Customer Success Manager.
This version includes the following changes:
-
New API added to
OptimizelyUserContext
:-
FetchQualifiedSegments()
: this API will retrieve user segments from the ODP server. The fetched segments will be used for audience evaluation. The fetched data will be stored in the local cache to avoid repeated network delays. -
When an
OptimizelyUserContext
is created, the SDK will automatically send an identify request to the ODP server to facilitate observing user activities.
-
-
New APIs added to
OptimizelyClient
:SendOdpEvent()
: customers can build/send arbitrary ODP events that will bind user identifiers and data to user profiles in ODP.
For details, refer to our documentation pages:
- ODPManager in the SDK is enabled by default. Unless an ODP account is integrated into the Optimizely projects, most ODPManager functions will be ignored. If needed, ODPManager can be disabled when
OptimizelyClient
is instantiated. - Minimum golang version changed from 1.13 to 1.19. (#369)
- We updated our README.md and other non-functional code to reflect that this SDK supports both Optimizely Feature Experimentation and Optimizely Full Stack. (#366)
- Add option to set custom http.Client on HTTPRequester. (#335)
- Fixes issue with visitor where dispatch timestamp was used instead of userEvent creation timestamp. (#345)
- Add additional validation for numeric attribute types when building an event object. (#341)
- Add validation for user attribute types when building an event object. Only allow primitive types (#339)
-
Add a set of new APIs for overriding and managing user-level flag, experiment and delivery rule decisions. These methods can be used for QA and automated testing purposes. They are an extension of the OptimizelyUserContext interface (#324, #326, #328):
- setForcedDecision
- getForcedDecision
- removeForcedDecision
- removeAllForcedDecisions
-
For details, refer to our documentation pages: OptimizelyUserContext and Forced Decision methods.
- Add new public properties to
OptimizelyConfig
. (#322, #312)- SdkKey
- EnvironmentKey
- Attributes
- Audiences
- Events
- ExperimentRules and DeliveryRules to
OptimizelyFeature
- Audiences to
OptimizelyExperiment
- For details, refer to our documentation page: https://docs.developers.optimizely.com/full-stack/v4.0/docs/optimizelyconfig-go.
OptimizelyFeature.ExperimentsMap
ofOptimizelyConfig
is deprecated as of this release. Please useOptimizelyFeature.ExperimentRules
andOptimizelyFeature.DeliveryRules
. (#322)
- Fix issues for decision variables and reasons. #309
Introducing a new primary interface for retrieving feature flag status, configuration and associated experiment decisions for users (#304, #303, #299, #298, #297). The new OptimizelyUserContext
class is instantiated with CreateUserContext
and exposes the following APIs to get OptimizelyDecision
:
- SetAttribute
- Decide
- DecideAll
- DecideForKeys
- TrackEvent
For details, refer to our documentation page: https://docs.developers.optimizely.com/full-stack/v4.0/docs/go-sdk.
- Add "enabled" field to decision metadata structure (#301)
- Correct logic for rollout service (#296)
- Add support for sending flag decisions along with decision metadata (#292)
-
Add MatchRegistry for custom match implementations. (#286) …
-
Added and refactored audience evaluation logs. (#280)
-
Add datafile accessor to access config as json string. (#290)
-
Support version audience evaluation following semantic versioning implementation. (#289)
-
Support number 'less than or equal to' and 'greater than or equal to'. (#289)
- Fixed a spelling mistake in go.mod file. (#285)
- Add support for JSON feature variables (#250, #251, #253)
- Add support for authenticated datafiles (#267)
- Expose ability to customize URL for event dispatcher. (#268)
- Provide synchronization for Notification Center Cache (#273)
- Fix unbounded memory allocation in event dispatcher (#275)
- Provide synchronization for Notification Center Cache (#273)
- Bring back old constructors for static manager (#271)
- Add support for JSON feature variables (#250, #251, #253)
- Add support for authenticated datafiles (#267)
- Expose ability to customize URL for event dispatcher. (#268)
- feat: support for multi-rule rollouts #247
- logger not set for httpDispatcher #254
- refact: Update logging field keys to be consumable in structured logs #246
- feat: Logging sdk key masked value with every log message. The masking is by default and can be disabled or set to a custom mapping. #242
- feat: Allow ClientName and Version to be set at compile time. #227
- feat: Add explicit json mappings. #228
- refact(snapshot): Made decisions optional for snapshot entity. #226
- feat: set specific error from default project config manager when CDN returns 403 response #232
- feat: OnEvent should be part of the event processor interface #233
- feat: add valid datafile version check #234
- fix: Properly instantiate event processor with dispatcher. #239
- feat: Return variables as an interface{} from GetAllFeatureVariables. #235
This is the General Availability release of the Go SDK.
- feat(onTrack): Added onTrack callback. #198
- feat: Add observability metrics for event queue. #211
- feat: Implement OptimizelyConfig API. #216
- feat: Add observability metrics for event queue. #223
- fix: Revert signature changes to PollingProjectConfigManager. #209
- fix(notification): race detected send notification issue. #222
- feat(PollingConfigManager): Implemented caching headers in PollingConfigManager. #189
- feat(api): Add top-level wrapper for more convenient usage. #191
- fix(audience-evaluation): Fixed null-bubbling issues. #177
- fix: correct error returned when SDK key is invalid #203
- fix: Invalid datafile JSON should return an error #205
- feat: Method for removing forced variations #176
- fix: Update built-in map-based ExperimentOverrideStore implementation to be concurrently usable #171
- fix: Add a public constructor for MapExperimentOverridesStore #174
- fix: don't return error when there is a good projectConfig in polling manager #179
- fix(decision): Logs produced by the various decision services. #180
- fix(exists-condition) Fixed exists comparison for leaf condition. #185
- Fix config managers so that they don't try and parse on error returned from CDN. #170
- When event batch size has been reached only start one batch event processing go routine.
- When queue size is met, log a message and do not add to the queue.
- Duration used was setting the time too far into the future by multiplying by second and then by milliseconds. Flush interval is now any duration, default is 30 seconds. If you don't pass in a multiplier the duration created is in microseconds. #167
- fixed parsing for audience conditions. [#165] (#165)
- Check nil to prevent panic. [#162] (#162)
- fix: support audience ids. [#161] (#161)
- fix(ExperimentWhitelistService): Fix finding variation by key #155
- feat(logger): Expand LogConsumer interface to have explicit field mapping. #147
- refac(client): Revise how the client handles and returns errors. #151
- Refactored EventProcessor and ConfigManager components to no longer require an ExecutionContext be passed in during construction. It will be injected into them by the client factory. #130
- Moved the entire
optimizely
package fromgithub.com/optimizely/go-sdk/optimizely
togithub.com/optimizely/go-sdk/pkg
to better follow convention and best practices. #135
- Introduces the
Activate
andGetVariation
APIs for running A/B tests. - Makes the top-level client components public:
DecisionService, ConfigManager, EventProcessor
.
- Added decision listeners and project config update listeners.
- Added optional configuration parameters to NewProcessor.
- This method
OptimizelyFactory.ClientWithOptions()
has been removed in favor ofOptimizelyFactory.Client(clientOptions ...OptionFunc)
This release of the SDK introduces Feature Management capabilities for running both Feature Rollouts as well as Feature Tests using Optimizely Feature Management.
- Introduces feature variable getters via
GetFeatureVariable*
for parameterizing your feature tests. - Introduces the
Track
API call for sending conversion events to Optimizely. - The
IsFeatureEnabled
API will now send impression events if there is a feature test attached to the feature being accessed.
- Vendored packages have been removed in favor of declaring dependencies and their versions using
go.mod
.
This is the initial release of the SDK, which includes support for running Feature Rollouts using Optimizely Feature Management.
- Introduces the
IsFeatureEnabled
API for determining whether the feature is enabled for a user or not. Please see our README.