Open Raymondloh2022 opened 1 year ago
@finbar-rollbar ; FYI @phil-losty-rb FYI @rollbar-bborsits FYI
Here is an example with additional payload options...
const string rollbarAccessToken = "TOKEN";
const string rollbarEnvironment = "ENVIRONMENT";
RollbarInfrastructureConfig config = new RollbarInfrastructureConfig(
rollbarAccessToken,
rollbarEnvironment
);
Rollbar.DTOs.Server rollbarServerConfig = new Rollbar.DTOs.Server();
RollbarPayloadAdditionOptions addconfig = new RollbarPayloadAdditionOptions();
rollbarServerConfig.Host = "[myapp.com](http://myapp.com/)";
rollbarServerConfig.CodeVersion = "1.0.0";
addconfig.Server = rollbarServerConfig;
addconfig.CodeVersion = "1.0.0";
config.RollbarLoggerConfig.RollbarPayloadAdditionOptions.Reconfigure(addconfig);
//RollbarDataSecurityOptions dataSecurityOptions = new RollbarDataSecurityOptions();
//dataSecurityOptions.ScrubFields = new string[]
//{
// "url",
// "method",
//};
//config.RollbarLoggerConfig.RollbarDataSecurityOptions.Reconfigure(dataSecurityOptions);
RollbarInfrastructure.Instance.Init(config);
Describe the bug CodeVersion is an attribute that Rollbar allows us to affiliate when sending payload to Rollbar. The expected location in the payload is documented in create-item documentation (https://docs.rollbar.com/reference/create-item). (Search for code_version)
What users have experienced from .Net SDK is finding codeversion value declared under config.RollbarPayloadAdditionOptions.CodeVersion instead. Since it is in the incorrect location, the payload version functionality does not work.
With that, Rollbar won't recognize this as the version of the code specifically
To Reproduce
Suggestion It would be great if code_version was a parameter to this method // create valid Rollbar configuration: RollbarInfrastructureConfig rollbarInfrastructureConfig = new RollbarInfrastructureConfig( RollbarSamplesSettings.AccessToken, RollbarSamplesSettings.Environment );